Hi Folks,
I having an issue when i set some rows ClientSelectColumn checkboxes to checked server side, but when i access them client side in the RowCreated event I get the wrong answer.
function
RowCreated(sender, args) {
var
ID = args.getDataKeyValue(
"InstrumentID"
);
if
(selected[ID]) {
args.get_gridDataItem().set_selected(
true
);
ExpandGroups(args);
}
if
(args.get_gridDataItem().get_selected()) { //Always False!
RowSelected(sender, args);
}
else
RowDeselected(sender, args);
}
The Server side is setting the checkbox like:
//load the Grid
foreach (GridDataItem gdi in _GrdFunds.MasterTableView.Items)
{
if (gdi["selectColumn"] != null)
{
CheckBox gdiCheckbox = (CheckBox)gdi["selectColumn"].Controls[0];
if (isInstrumentSaved(gdi["InstrumentId"].Text, report))
{
gdiCheckbox.Checked = true;
gdi.Selected = true;
}
else
{
gdiCheckbox.Checked = false;
gdi.Selected = false;
}
}
}
And Grid is defined as:
<telerik:RadGrid ID="_GrdFunds"
runat="server"
AllowMultiRowSelection="True"
AllowFilteringByColumn="True"
CellSpacing="0"
GridLines="None"
ShowGroupPanel="True"
Skin="Metro"
DataSourceID="FundsList"
Style="margin-top: 5px;"
OnColumnCreated="_GrdFunds_ColumnCreated"
OnItemCreated="_GrdFunds_ItemCreated"
OnItemDataBound="_GrdFunds_ItemDataBound"
OnGroupsChanging="_GrdFunds_GroupsChanging" AllowSorting="True" Font-Size="X-Small" Height="100%">
<GroupingSettings CaseSensitive="False" ShowUnGroupButton="True" />
<ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<Selecting AllowRowSelect="True"></Selecting>
<Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowResizeToFit="True" ShowRowIndicatorColumn="True"></Resizing>
<ClientEvents OnRowCreated="RowCreated" OnRowDeselected="RowDeselected" OnRowSelected="RowSelected" OnGridCreated="GridCreated"
OnColumnCreated="_GrdFunds_OnColumnCreated" OnMasterTableViewCreated="_GrdFunds_OnMasterTableViewCreated" />
<Animation AllowColumnReorderAnimation="True" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="True" ClientDataKeyNames="InstrumentID" DataKeyNames="InstrumentID" DataSourceID="FundsList" GroupLoadMode="Client" GroupsDefaultExpanded="False" TableLayout="Fixed">
<CommandItemSettings ExportToPdfText="Export to PDF" />
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="False">
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
</ExpandCollapseColumn>
<Columns>
<telerik:GridClientSelectColumn DataType="System.Boolean" Reorderable="False" Resizable="False" UniqueName="selectColumn">
<HeaderStyle Width="36px" />
<ItemStyle Width="36px" />
</telerik:GridClientSelectColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>