set delegate and datasource properties automatically