I have a client-bind Grid which has GridTemplateColumn to show a checkbox.
<
telerik:RadGrid ID="RadGrid1" EnableViewState="False" Skin="WebBlue" runat="server"
AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
AutoGenerateColumns="False" Width="100%"
EnableAJAXLoadingTemplate="True" EnableAJAX="True" GridLines="None" >
<MasterTableView AllowNaturalSort="false" AccessKey="x"
AllowFilteringByColumn="True"
ClientDataKeyNames="IsReviewed, ID, Message, Category" CellSpacing="-1" >
<Columns>
<telerik:GridTemplateColumn HeaderText="Review" >
<ItemTemplate>
<asp:CheckBox ID="CheckBox" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridDateTimeColumn DataField="TimeStamp" HeaderText="Date and Time" DataFormatString="{0:M/d/yyyy h:mm tt}" UniqueName="Time"/>
</Columns>
</MasterTableView>
<ClientSettings AllowKeyboardNavigation="True">
<ClientEvents OnRowDataBound="RowDataBound" ></ClientEvents>
<DataBinding SelectMethod="GetDataAndCount" Location="~/service/Service.svc" SortParameterType="Linq" FilterParameterType="Linq" >
</DataBinding>
</ClientSettings>
Here is the script to handle data bind on check box:
function RowDataBound(sender, args) {
var radTextBox1 = args.get_item().findElement("CheckBox");
radTextBox1.checked = args.get_dataItem()["IsReviewed"];
}
In normal situation, everything is fine. However, when I change the page size, the client side didn't create the check box for the increased new rows. The script is failed due to can't find the radTextBox1. I did some trace, the data is succeeded binding, other columns are fine, only this GridTemplateColumn has issue to create.
How can I reslove this issue?