Hi,
I have a Radgrid which i bound with a data table. The data is shown properly in the grid. Now when i click on Page values of grid, everything works fine. Now if I sort the column the Grid shows No Records for display. If I sort the Grid First, sorting happens but after Page click, the Grid again shows No Records for display.
So each action works fine individually but not if one action is done after another i.e. Paging-->Sorting or Sorting-->Paging, Grid shows No Record for display.
In Code behind, the Grid Datasource always shows Data.
Need help on urgent basis.
regards,
PN
Code:
I have a Radgrid which i bound with a data table. The data is shown properly in the grid. Now when i click on Page values of grid, everything works fine. Now if I sort the column the Grid shows No Records for display. If I sort the Grid First, sorting happens but after Page click, the Grid again shows No Records for display.
So each action works fine individually but not if one action is done after another i.e. Paging-->Sorting or Sorting-->Paging, Grid shows No Record for display.
In Code behind, the Grid Datasource always shows Data.
Need help on urgent basis.
regards,
PN
Code:
ASPX PAGE: |
--------------- |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="RadGrid1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<telerik:RadGrid ID="RadGrid1" Skin="Office2007" Width="97%" AllowSorting="True" |
PageSize="15" ShowFooter="True" AllowPaging="True" AllowMultiRowSelection="True" runat="server" Gridlines="None" |
OnNeedDataSource="RadGrid1_NeedDataSource"> |
<MasterTableView Width="100%" /> |
<PagerStyle Mode="NextPrevAndNumeric" /> |
</telerik:RadGrid> |
-------------------------------------------------------------------------- |
Code Behind: |
-------------- |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
{ |
DataTable dt=null; |
dt=GetDataTable(); |
if(dt!=null) |
RadGrid1.DataSource = dt; |
} |
private DataTable GetDataTable() |
{ |
DataTable dt = null; |
DataSet dsResults = Utility.SearchCategoryCards("Digital", Session["UserCompanyCode"].ToString()); |
if (dsResults != null && dsResults.Tables.Count > 0 && dsResults.Tables[0].Rows.Count > 0) |
{ |
dt = dsResults.Tables[0]; ; |
return dt; |
} |
else |
{ |
return dt; |
} |
} |