I have a RadGrid with a DetailTableView. I populate a detail table in the OnDetailTableDataBind handler when the node is expanded.
However, when I postback the page, the DetailTableViews data will be empty.
Is there a way to persist the data?
I have tried to set ViewStateMode="Enabled" on the GridTableView.
The attached screenshot1.png depicts the grid after I have populated the detail table:
When I have changed the starttime for the RadGrid table item, the detail table is now emptied.
The attached screenshot2.png shows what it will look like.
Here is the declaration of the RadGrid:
<
telerik:RadGrid
ID
=
"grd"
AutoGenerateColumns
=
"False"
OnDetailTableDataBind
=
"grdActivitiesToCopy_OnDetailTableDataBind"
AllowMultiRowSelection
=
"True"
runat
=
"server"
ViewStateMode
=
"Enabled"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"DetailCheckColumn"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Date"
DataField
=
"StartDay"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Time"
DataField
=
"TimeInterval"
/>
<
telerik:GridBoundColumn
DataField
=
"EventName"
HeaderText
=
"Activity"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"New starttime"
>
<
ItemTemplate
>
<
telerik:RadDateTimePicker
runat
=
"server"
SelectedDate='<%#Eval("DateStart") %>'
AutoPostBackControl="Both"
OnSelectedDateChanged="GrdActivities_OnStartDateChanged"/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"New endtime"
>
<
ItemTemplate
>
<
telerik:RadDateTimePicker
ID
=
"endDateTime"
runat
=
"server"
SelectedDate='<%#Eval("DateEnd") %>'/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
DetailTables
>
<
telerik:GridTableView
ShowHeadersWhenNoRecords
=
"True"
Name
=
"Child"
/>
</
DetailTables
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
grdActivitiesToCopy_OnDetailTableDataBind is called when the item is expanded (every time). I would prefer to have the detail tables populated in the Page_Load event.
Is that possible?