I'm using AJAX call to dynamically add rows to my RadGrid on the Client-Side. The data is initially loaded on the Server Side.
If there were X rows when the grid was initialized, adding the (X+1)th row, the GridButtonColumns are not rendered.
What the grid looks like before the Add
What the grid looks like Afterward
After the AJAX call adds the record to the appropriate SQL Table, I use a WebMethod in the page's Code Behind to retrieve all the data that should be in the grid.
I then bind that result to the grid (AGPermissions is the ID of the RadGrid):
While tracing through the code, the correct data is stored within "result".
Here's the RadGrid definition:
If I do a refresh of the page, the Server Side methods load and display the grid properly. Any help on why this is happening would be appreciated.
I'm using the Q3 2008 version.
Thanks.
If there were X rows when the grid was initialized, adding the (X+1)th row, the GridButtonColumns are not rendered.
What the grid looks like before the Add
What the grid looks like Afterward
After the AJAX call adds the record to the appropriate SQL Table, I use a WebMethod in the page's Code Behind to retrieve all the data that should be in the grid.
I then bind that result to the grid (AGPermissions is the ID of the RadGrid):
function updateGrid(result) |
{ |
var masterTableView = GetMasterTableView("<%=AGPermissions.ClientID %>"); |
if (result) |
{ |
masterTableView.set_dataSource(result); |
masterTableView.dataBind(); |
ToggleDivVisibility('ShowGridClient',true); |
var grid = $find("<%= AGPermissions.ClientID %>"); |
grid.repaint(); |
While tracing through the code, the correct data is stored within "result".
Here's the RadGrid definition:
<telerik:RadGrid ID="AGPermissions" EnableViewState="false" runat="server" |
AllowPaging="false" AllowSorting="false" AllowFilteringByColumn="false" GridLines="None" |
EnableEmbeddedSkins="false" Skin="IMCGridStyle" ImagesPath="Grid" |
OnNeedDataSource="AGPermissions_NeedDataSource"> |
<ItemStyle Wrap="false" /> |
<MasterTableView |
AllowMultiColumnSorting="true" |
TableLayout="Auto" |
EnableNoRecordsTemplate="false" |
ClientDataKeyNames="AssetGroupID,AssetGroupPermissionType" |
AutoGenerateColumns="false" |
ShowHeadersWhenNoRecords="false"> |
<Columns> |
<telerik:GridBoundColumn DataField="AssetGroupID" Display="false" HeaderText="Asset Group ID" /> |
<telerik:GridBoundColumn DataField="AssetGroupName" HeaderText="Asset Group" /> |
<telerik:GridBoundColumn DataField="AssetGroupPermissionType" Display="false" HeaderText="Asset Group Permission Type" /> |
<telerik:GridBoundColumn DataField="AssetGroupPermissionTypeText" HeaderText="Permission Type" /> |
<telerik:GridButtonColumn UniqueName="1MakeGroupMaster" Visible="true" ButtonType="ImageButton" ImageUrl="Grid/btnMakeGM.jpg" CommandName="1MakeGroupMaster" Text="Make Group Master"></telerik:GridButtonColumn> |
<telerik:GridButtonColumn UniqueName="2MakeGroupReader" ButtonType="ImageButton" ImageUrl="Grid/btnMakeGR.jpg" CommandName="2MakeGroupReader" Text="Make Group Reader"></telerik:GridButtonColumn> |
<telerik:GridButtonColumn ConfirmText="Remove access to this Asset Group?" ButtonType="ImageButton" ImageUrl="Grid/btnRemove.jpg" CommandName="RemoveAccess" Text="Remove Access"></telerik:GridButtonColumn> |
</Columns> |
<NoRecordsTemplate> |
<div>There are no records to display.</div> |
</NoRecordsTemplate> |
</MasterTableView> |
<ClientSettings> |
<ClientEvents |
OnCommand="RadGridCommand" |
OnDataBound="TestThis"/> |
</ClientSettings> |
<PagerStyle AlwaysVisible="true" /> |
</telerik:RadGrid> |
If I do a refresh of the page, the Server Side methods load and display the grid properly. Any help on why this is happening would be appreciated.
I'm using the Q3 2008 version.
Thanks.