This is a migrated thread and some comments may be shown as answers.

RadGrid and NeedDataSource

1 Answer 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 18 Aug 2011, 04:01 AM
hi

I have a grid with paging enabled and viewstate is set to True and i have set a breakpoint at the NeedDdataSource. What happened is that whenever i click the page number on the grid it goes into breakpoint and it would ran through the code again.

There is some performance issues here if i have many rows of records.

Since i know the dataset has been filled with data, how do i code it so that there is no need to go through that code everytime i do a paging on the grid? thanks and sorry for the inconvenience caused.

Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

Dim ds1 As New DataSet
ds1 = dsDemo("demo","demo")
RadGrid1.DataSource = ds1.Tables(0).DefaultView

End Sub


1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Aug 2011, 05:45 AM
Hello,

We are not able to Skip the NeedDataSource after Pagging.
But to solve the performance You can strore (Only one time) your dataset in VIewstate/Session/Cache and in NeedDataSource get your dataset from VIewstate/Session/Cache and assign to your RadGrid.

May be below link should be helpful.
http://www.codeproject.com/KB/web-cache/caching.aspx
http://www.tutorialsasp.net/tutorials/caching-a-dataset-for-improving-performance-in-aspnet/

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or