Hello,
I have managed to achieve a simple client-side databinding after looking at the corresponding demo example. My datafield 'Name' show up as it shall below.
<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" runat="server">
<MasterTableView TableLayout="Fixed">
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" />
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnCommand="function(){}" />
</ClientSettings>
</telerik:RadGrid>
But if I would like to use an ItemTemplate, as I use to do with normal ASP DataControls, to have more control on how my radGrid shall look like, how do I do then? And can I use code-behind functions together with eval when my radGrid is client-side databounded. When I try like below I receive the following error: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Name'.
<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" runat="server">
<MasterTableView TableLayout="Fixed">
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<div>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name")%>'
ForeColor='<%# CheckColor(Eval("Id"))%>'>
</asp:Label>
</div>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnCommand="function(){}" />
</ClientSettings>
</telerik:RadGrid>
I have a working example, which is more like the Ajax timer demo example, which I now want to transforn to one with client-side databinding. In my OnItemDataBound event there I call a javascript function (with registerStartupScript) with one DataListItem (decided from database) as parameter. Any ideas how one can do the same thing now.
I have managed to achieve a simple client-side databinding after looking at the corresponding demo example. My datafield 'Name' show up as it shall below.
<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" runat="server">
<MasterTableView TableLayout="Fixed">
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" />
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnCommand="function(){}" />
</ClientSettings>
</telerik:RadGrid>
But if I would like to use an ItemTemplate, as I use to do with normal ASP DataControls, to have more control on how my radGrid shall look like, how do I do then? And can I use code-behind functions together with eval when my radGrid is client-side databounded. When I try like below I receive the following error: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Name'.
<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" runat="server">
<MasterTableView TableLayout="Fixed">
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<div>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name")%>'
ForeColor='<%# CheckColor(Eval("Id"))%>'>
</asp:Label>
</div>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnCommand="function(){}" />
</ClientSettings>
</telerik:RadGrid>
I have a working example, which is more like the Ajax timer demo example, which I now want to transforn to one with client-side databinding. In my OnItemDataBound event there I call a javascript function (with registerStartupScript) with one DataListItem (decided from database) as parameter. Any ideas how one can do the same thing now.