Hi,
I am trying out the lastest release of RadGrid Q2 2008 client side dataBind feature. When I tried to bind the data received from the Webservices the RadGrid doesn't bind. First it clears the current Grid data and it stays empty and when i tried to load for the 2nd time the data get loaded (i can see the data loaded) and then immediatly get cleared. Also one observation is that when i tried to add some alert before i bind the data then the Grid bind correctly. The sample code is given below. Can someone help me explain how to resolve this?
//Javascript
function ClientLoadGrid(){
GridService.Search(LoadGrid);
}
function LoadGrid(result){
var ctrlID = "<%= RadGrid1.ClientID %>";
//alert(ctrlID + ' ' + result)
var masterTable = $find(ctrlID).get_masterTableView();
masterTable.set_dataSource(result);
masterTable.dataBind();
}
//HTML
<telerik:RadGrid ID="RadGrid1" runat="server" PageSize="20" EnableViewState="true" Skin="Sunset" AllowPaging="true" AllowSorting="True" GridLines="Horizontal" Width="100%" >
<MasterTableView AllowMultiColumnSorting="True" AutoGenerateColumns="False" HierarchyLoadMode="Client" ClientDataKeyNames="EmployeeID" DataKeyNames="EmployeeID" EnableViewState="False" >
<Columns>
<telerik:GridBoundColumn DataField="EmployeeID" HeaderText="Employee ID" UniqueName="EmployeeID">
<ItemStyle Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title" />
</Columns>
</MasterTableView>
<PagerStyle AlwaysVisible="true" />
<FilterMenu EnableTheming="True" Skin="Sunset">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>
Thanks in advance
Sundar
| UpdateCommand="UPDATE [LabUser] SET [Username]=@Username,[Enabled]=@Enabled,[RemoteAccess]=@RemoteAccess WHERE [UserID] = @UserID" |
| Dim gct As New GridTemplateColumn |
| With gct |
| .HeaderText = "Schema" |
| .DataField = "Name" |
| .ItemTemplate = LoadTemplate("~/DynamicData/FieldTemplates/Text_List.ascx") |
| End With |
| GridView1.MasterTableView.Columns.Add(gct) |
