
Tomaž Lovrec
Top achievements
Rank 1
Tomaž Lovrec
asked on 25 Jan 2010, 10:34 AM
Hello,
currently I have ~300 rows and over 21 columns of data.(Both of those will rise over time) And I'm also implementing paging. It takes a long time to switch between pages, because RadGrid is accessing the Database each time I switch a page, is it possible to load all the data into the RadGrid, for all pages, so when I would change pages it would just show those from cache or somewhere and reduce the time taking between those page changes?
Thanks in advance and regards,
Thomas
currently I have ~300 rows and over 21 columns of data.(Both of those will rise over time) And I'm also implementing paging. It takes a long time to switch between pages, because RadGrid is accessing the Database each time I switch a page, is it possible to load all the data into the RadGrid, for all pages, so when I would change pages it would just show those from cache or somewhere and reduce the time taking between those page changes?
Thanks in advance and regards,
Thomas
3 Answers, 1 is accepted
0
Hello Tomaž,
Attached to this message is a simple runnable application which handles the desired functionality. Please give it a try and let me know if it works as expected.
I hope this helps.
All the best,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Attached to this message is a simple runnable application which handles the desired functionality. Please give it a try and let me know if it works as expected.
I hope this helps.
All the best,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Tomaž Lovrec
Top achievements
Rank 1
answered on 25 Jan 2010, 11:39 AM
Hello Pavlina!
Thanks for your reply, I haven't checked the code yet, got pulled away from my work and I'm continuing with something else, but judging by the title of the attached file, the data from the DB gets saved to the session and after changing the page, it will still re-render the RadGrid. Correct me if I'm wrong.
I know I haven't described the issue as I should but I'm looking for a more show and hide solution to certain items. It could be that I'm also trying to solve the problem from the wrong side.
So, to begin at the beginning, where my problems start. :)
This is a dinamic RadGrid, only 3 columns(includin ID column) are static, all the others are programatically added inside Page_Init, like so:
The ITemplate is a simple CheckBox.
And everytime I switch pages, a few more empty columns are created, don't know from where, but not from this code, because I've tried debugging and going through step by step. I hope you understand what I mean, I can also supply a screenshot of the page if need so.
So, here is my main problem, beside that long waiting periods between pages.
Hope we can find a solution. :)
Thanks again and kidn regards,
Thomas
Thanks for your reply, I haven't checked the code yet, got pulled away from my work and I'm continuing with something else, but judging by the title of the attached file, the data from the DB gets saved to the session and after changing the page, it will still re-render the RadGrid. Correct me if I'm wrong.
I know I haven't described the issue as I should but I'm looking for a more show and hide solution to certain items. It could be that I'm also trying to solve the problem from the wrong side.
So, to begin at the beginning, where my problems start. :)
This is a dinamic RadGrid, only 3 columns(includin ID column) are static, all the others are programatically added inside Page_Init, like so:
protected void Page_Init(object sender, EventArgs e) |
{ |
bool? boolean = true; |
var seminarji = from s in db.Appointments |
join d in db.AppointmentTypes on s.id_app_type equals d.id |
where s.start.Year == leto && s.id_app_type == 1 || |
s.start.Year == leto && s.id_app_type == 2 || |
s.start.Year == leto && s.id_app_type == 3 || |
s.start.Year == leto && s.id_app_type == 4 |
select new |
{ |
s.id, |
seminar = s.start.Day.ToString() + '.' + s.start.Month.ToString() + '.' + s.start.Year.ToString() + ' ' + |
d.name.ToString() + ' ' + d.type.ToString() |
}; |
foreach (var seminar in seminarji) |
{ |
GridTemplateColumn column = new GridTemplateColumn(); |
column.UniqueName = seminar.id.ToString(); |
column.DataField = seminar.id.ToString(); |
column.HeaderText = seminar.seminar.ToString(); |
column.SortExpression = seminar.id.ToString(); |
column.DataType = boolean.GetType(); |
column.AllowFiltering = false; |
column.ItemTemplate = new myTemplate(seminar.id.ToString()); |
RadGrid1.MasterTableView.Columns.Add(column); |
} |
} |
The ITemplate is a simple CheckBox.
And everytime I switch pages, a few more empty columns are created, don't know from where, but not from this code, because I've tried debugging and going through step by step. I hope you understand what I mean, I can also supply a screenshot of the page if need so.
So, here is my main problem, beside that long waiting periods between pages.
Hope we can find a solution. :)
Thanks again and kidn regards,
Thomas
0
Hi Tomaž,
Please, note that RadGrid does not support mixing declarative grid columns with grid columns added dynamically at runtime. You should either create all the columns in the grid programmatically, or else define them all in the ASPX file.
For more information you can review this help article:
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
Sincerely yours,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Please, note that RadGrid does not support mixing declarative grid columns with grid columns added dynamically at runtime. You should either create all the columns in the grid programmatically, or else define them all in the ASPX file.
For more information you can review this help article:
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
Sincerely yours,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.