I have a RadGrid with some GridTemplateColumns. I have an ItemTemplate and EditItemTemplate. In the ItemTemplate I have an <asp:CheckBox>. On page load everything is fine (pic1), but when I add a new row client-side (no postback) using the following javascript function the new row does not show the CheckBox in the ItemTemplate. The column (look at "Analytical Method Required") looks blank (pic2). The EditItemTemplate appears to work...if I click the column on that row the checkbox appears and I can set it (pic3). Then when focus leaves the column the text "true" is displayed instead of the ItemTemplate's checkbox (pic4).
I have tried debugging in the javascript and can't seem to get a reference to the ItemTemplate's checkbox control (using row.findElement())...it returns null.
Anyone know how I can get the ItemTemplate's checkbox to be present when I add a new row client-side? Thanks.
JS:
function AddNewRowInGrid(sender, args) {
var grid = $find("<%= grdActivityType.ClientID %>");
var masterTable = grid.get_masterTableView();
grid.get_batchEditingManager().addNewRecord(masterTable); }
TemplateColumn:
<
telerik:GridTemplateColumn
DataField
=
"AnalyticalMethodRequired"
UniqueName
=
"AnalyticalMethodRequired"
HeaderText
=
"Analytical Method Required"
HeaderStyle-Width
=
"10%"
SortExpression
=
"IGNORE_CASE actyp_anl_mth_req_yn"
ItemStyle-VerticalAlign
=
"Top"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"chkAnalyticalMethodRequiredItemTemplate"
runat
=
"server"
Checked='<%# Eval("AnalyticalMethodRequired") %>' onclick='checkBoxClicked(this, event);' />
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:CheckBox
ID
=
"chkAnalyticalMethodRequiredEditItemTemplate"
runat
=
"server"
Checked='<%# Bind("AnalyticalMethodRequired") %>' />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>