Hi,
I was hoping to keep any ticked check boxes ticked when my radgrid rebinds. I found this tutorial: http://www.telerik.com/help/aspnet-ajax/grid-selecting-row-with-checkbox-server-side.html however my "onCheckedItem" events never fire, instead my "needDataSource" event is fired and that is the end of it (I verified this using debug mode and checkpoints). I'm assuming this is because I'm using advanced data binding unlike in the tutorial. I need to keep advanced data binding for features such as grid export. Also it's important the checkboxes are server side because I want to be able to build functions in c# which rely on what tick boxes are selected. Below is the code for my radgrid
Let me know if you need any more code. Thanks in advance
[code]
<telerik:RadGrid ID="batchGrid" runat="server"
AllowFilteringByColumn="True" AllowSorting="True"
CellSpacing="0" GridLines="None" OnNeedDataSource="batchGrid_NeedDataSource"
EnableViewState="False" AutoGenerateColumns="True" OnColumnCreated="batchGrid_ColumnCreated"
OnExportCellFormatting="batchGrid_ExportCellFormatting"><ExportSettings ExportOnlyData="true" HideStructureColumns="true" >
<Excel Format="Html"/>
</ExportSettings> <ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick="false" >
<Selecting AllowRowSelect="false"/>
<Resizing AllowResizeToFit="true" />
</ClientSettings> <MasterTableView NoMasterRecordsText="No batch found containing this part, with the current filters">
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false" Reorderable="false" >
<ItemTemplate>
<asp:CheckBox ID="MyCheckBox" runat="server" OnCheckedChanged="ToggleRowSelection" AutoPostBack="true" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState" AutoPostBack="true" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
</Columns>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView> <FilterMenu EnableImageSprites="False" ></FilterMenu>
</telerik:RadGrid>
[/code]
I was hoping to keep any ticked check boxes ticked when my radgrid rebinds. I found this tutorial: http://www.telerik.com/help/aspnet-ajax/grid-selecting-row-with-checkbox-server-side.html however my "onCheckedItem" events never fire, instead my "needDataSource" event is fired and that is the end of it (I verified this using debug mode and checkpoints). I'm assuming this is because I'm using advanced data binding unlike in the tutorial. I need to keep advanced data binding for features such as grid export. Also it's important the checkboxes are server side because I want to be able to build functions in c# which rely on what tick boxes are selected. Below is the code for my radgrid
Let me know if you need any more code. Thanks in advance
[code]
<telerik:RadGrid ID="batchGrid" runat="server"
AllowFilteringByColumn="True" AllowSorting="True"
CellSpacing="0" GridLines="None" OnNeedDataSource="batchGrid_NeedDataSource"
EnableViewState="False" AutoGenerateColumns="True" OnColumnCreated="batchGrid_ColumnCreated"
OnExportCellFormatting="batchGrid_ExportCellFormatting"><ExportSettings ExportOnlyData="true" HideStructureColumns="true" >
<Excel Format="Html"/>
</ExportSettings> <ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick="false" >
<Selecting AllowRowSelect="false"/>
<Resizing AllowResizeToFit="true" />
</ClientSettings> <MasterTableView NoMasterRecordsText="No batch found containing this part, with the current filters">
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false" Reorderable="false" >
<ItemTemplate>
<asp:CheckBox ID="MyCheckBox" runat="server" OnCheckedChanged="ToggleRowSelection" AutoPostBack="true" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState" AutoPostBack="true" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
</Columns>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView> <FilterMenu EnableImageSprites="False" ></FilterMenu>
</telerik:RadGrid>
[/code]