-
Custom Drop Down List
Hi all,
Background:
I have a web page which has a datagrid in it. a couple of the columns in this datagrid have a dropdown list. The number of rows present in the grid is dynamic, and changes at runtime quite frequently, but is usually from 5 to 30 or so rows.
Due to client requirements, the rows need to be editable at all times, ie my client is un-willing to accept that the user has to click a button next to a row to bring it to "edit mode" then modify that line, save it, and repeat the process for each row.
One of the dropdown lists has around a hundred and fifty rows in it. an other has around 30 rows. The contents of the drop down lists will not be needing to change during the lifecycle of the form.
I'd like to reduce the html bulk created by repeating the drop-down list multiple times, as each and every dropdown list on the page will present exactly the same options to the client, I'd like the page to download the data once, then render each drop down list at run-time on the client. I was wondering if anyone else had already done this?
Thanks in advance for your help.
-
On page load get all the data to go into the dropdownlists into a global dataset. Set all the dropdownlists to use this dataset as a datasource.
HTH
DJ
-
Thanks for your response, although I already do this, but what I want to do is reduce the amount of HTML sent to down to the client. I normally have 30-50 rows in my datagrid, each row with 3 comboboxes. Each combo box has between 50 and 300 items in it. My page size can be up to 1.3 mb because of this!! Making only one row editable at a time is not an option due to the spec.
-
Well first, if you turn off ViewState your page will be smaller, but the drawback would be on posts back, it will be slower.
It sounds to me like since your page isn't going to change, then you should look at implementing some of the caching features ASP.NET offers:
http://authors.aspalliance.com/aspxt...gfeatures.aspx
-
1 Attachment(s)
We already have a method of storing viewstate in SQL server as opposed to sending it down to the client. This improved speed a little bit. Unfortunately, the page changes all the time, so caching is not a solution.
What I'm thinking of is sending the combox lists down to the client in one javascript array for each combo, and then populating them in each row of the datagrid at the client. I think I'll get some view state errors with this though, as the listitems will have changed when the page submits.
Another thing I'm wondering is whether I could mimic the look of a drop down list with a label and an image, and when the user clicks on it, a fake dropdown list portion (in a div tag) would appear in exactly the right place. Not sure if these Ideas would be feasable?
http://www.vbforums.com/attachment.p...postid=1800512