Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I need a bit of help. I have a gridview which contanis 5 template fields 2 checkboxes, 2 textboxes and a dropdownlist.

I assigned value to those controls in RowCommand event of the Gridview. But the problem is grid takes nearly 5 minutes to load and render (record arounds 2000). So I replaced all asp template field controls (Textbox & Checkbox) to html imput types and now grid takes less time to load (tested without dropdownlist).

But when I add dropdownlist, it takes more time to load. Is there any way I could replace this dropdown inside the gridview to make the grid faster.

P.S. I should not use paging.

Thanks for letting me know the possibilities.
Posted

Hello,

If you are not using Paging in Gridview then instead of Gridview why you are not using simple HTML table.
Use HTML Table and set attributes ID and Runat="Server" and fill it dynamically. You can use any server control inside this HTML table runtime.

It may reduce loading time....
 
Share this answer
 
Comments
Member 10768757 23-Apr-14 5:20am    
Hi Bahvikkumar,

Thanks for sharing your views. Could you please some articles / links on how to do as you suggested.

Thanks.
I assume the listbox is flashing and redrawing as you enter each and every string

You are supposed to send a WM_SETREDRAW message to the listbox with a setting of FALSE to stop it redrawing and then when it is loaded another WM_SETREDRAW to TRUE

http://msdn.microsoft.com/en-us/library/windows/desktop/dd145219%28v=vs.85%29.aspx[^]

Try that and see how much of the slow down is from the redraw flashing.

In reality if you have that many strings I would do an owner draw listbox and simply pass in a pointer to all the string data it seems rather silly to make windows restore all the strings and use more memory when you clearly have all the strings already in a memory block or structure.

The redraw would therefore be almost instant as it simply has to draw the visible strings to screen and exit.

There are plenty of articles on owner draw listboxes try searching "Owner Drawn listbox without strings"
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900