Dear All,
I can't get it to work ...
I reviewed all the forums post regards the NeedDataSource event handlers all the concepts ....
Here is my Issue:
I create a contentpage that exactly matches the tab loadondemad example :
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx
But the grids on the loaded user-controls doesn't do any sorting or paging although I implement the OnNeedDatasource event which never fires at all (which cause the sorting or paging miss-behavior).
This is my .ascx grid definition code snippet:
The user-control scenario starts when it loaded and then filled with data using the DisplayValues method that receive a business object (summaryCredit[]) and bind it to the radgrid which I change later to use a datatable when I thought it was the problem.
anyway here is the method:
and the NeedDataSource method:
I put a breakpoint in this method but it never fire !!
What could be my problem ?
Regards
Waleed
I can't get it to work ...
I reviewed all the forums post regards the NeedDataSource event handlers all the concepts ....
Here is my Issue:
I create a contentpage that exactly matches the tab loadondemad example :
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx
But the grids on the loaded user-controls doesn't do any sorting or paging although I implement the OnNeedDatasource event which never fires at all (which cause the sorting or paging miss-behavior).
This is my .ascx grid definition code snippet:
<telerik:RadGrid |
ID="SummaryCreditGrid" |
runat="server" |
AllowSorting="true" |
AllowPaging="true" |
PageSize="5" |
OnNeedDataSource="SummaryCreditGrid_NeedDataSource"> |
<MasterTableView Width="100%"/> |
</telerik:RadGrid> |
anyway here is the method:
public void DisplayValues(SummaryCredit[] summaryCredit) |
{ |
DataTable tdt = new DataTable(); |
tdt.Columns.Add("DATA_FROM", typeof(string)); |
tdt.Columns.Add("CATALOGUE_CODE", typeof(string)); |
tdt.Columns.Add("CREDITFACILITY", typeof(string)); |
foreach (var credit in summaryCredit) |
{ |
tdt.Rows.Add(credit.DataFrom, credit.CatalogueCode, credit.Creditfacility); |
} |
SummaryCreditGrid.DataSource = tdt; |
SummaryCreditGrid.DataBind(); |
Session["SummaryCreditGrid"] = tdt; |
} |
and the NeedDataSource method:
protected void SummaryCreditGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
{ |
DataTable dt = new DataTable(); |
dt = Session["SummaryCreditGrid"] as DataTable; |
if (dt != null) |
{ |
SummaryCreditGrid.DataSource = null; |
SummaryCreditGrid.DataSource = dt; |
} |
} |
What could be my problem ?
Regards
Waleed