sharepoint - SPList.GetItems defaultView returning different fields than are actually present in the DefaultView of the list -


i binding splist items gridview getting datatable, getting entirely different fields in datatable fields present in defaultview of splist.

not field names changed (internal names/ title) , fields different ones present in list's default view.

i using following code:

gridview gd = new gridview();              gd.datasource = list.getitems(list.defaultview).getdatatable(); 

this due list.defaultview either not being populated or correct. try setting value before call items. i.e..

spview defview = list.defaultview; gd.datasource = list.getitems(list.defaultview).getdatatable(); 

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -