In our website we have automatically generated grid. Basically on our .aspx we keep the radgrid declaration:
We populate that grid with columns inside odsAuto (ObjectDataSource)'s Selecting item. We discovered that we have to clear all the columns and add them again each time the selecting happens. If we won't do so then radgrid doesn't display data correctly - headers of grid have no captions and cell are either empty or contain "DataRowView" inside. Thanks to clearing and recreating columns inside Selecting event - paging for grid works. Unfortunately sorting fails. Data in cells are still displayed correctly in cells, but captions in headers disappear and there is no sorting applied to order inside grid. If you need any information - i'm willing to provide anything what's needed.
<
telerik:RadGrid
ID
=
"rgAutoGrid"
AllowSorting
=
"true"
DataSourceID
=
"odsAuto"
runat
=
"server"
OnItemCreated
=
"rgAutoGrid
_ItemCreated"
AllowPaging
=
"true"
ShowFooter
=
"true"
AutoGenerateColumns
=
"false"
OnItemDataBound
=
"rgAutoGrid
_ItemDataBound"
Skin
=
"WebBlue"
OnPageSizeChanged
=
"Grid_SizeChanged"
OnSortCommand
=
"rgAutoGrid
_SortCommand"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
Position
=
"TopAndBottom"
AlwaysVisible
=
"true"
/>
</
telerik:RadGrid
>
We populate that grid with columns inside odsAuto (ObjectDataSource)'s Selecting item. We discovered that we have to clear all the columns and add them again each time the selecting happens. If we won't do so then radgrid doesn't display data correctly - headers of grid have no captions and cell are either empty or contain "DataRowView" inside. Thanks to clearing and recreating columns inside Selecting event - paging for grid works. Unfortunately sorting fails. Data in cells are still displayed correctly in cells, but captions in headers disappear and there is no sorting applied to order inside grid. If you need any information - i'm willing to provide anything what's needed.