Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
Dynamic TemplateColumns lose modified values on postback
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Pop, post: 4260477"] Hello, I have a datagrid which is being bound to a DataView who's dimensions are unknown at design time. Specifically, I don't know how many columns will be returned. The amount of columns returned are based on a user's selection critiera from the page. I want to enable the datagrid to perform multi-row edits at once. In order to do this, I create template columns programatically, adding textbox controls within each. I've seen many examples that behave very similarly, except the grid is static in dimension. (Ie the amount of Template columns can be declared on the .aspx page and not in the code-behind). example link: [URL]http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=038a01c3788f%2439a29a80%24a101280a%40phx.gbl&rnum=17&prev=/groups%3Fq%3Dtemplate%2Bcolumn%2Bcode-behind%26start%3D10%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D038a01c3788f%252439a29a80%2524a101280a%2540phx.gbl%26rnum%3D17[/URL] The problem is that in PageLoad, it seems that in order to detect if the user has modified the values in a textbox, the datagrid must be bound in PageLoad every time. If you bind the data anywhere else (on a buttonClick event handler) the data is rebound to the original unmodified values -- any modifications done to the text in the textboxes are lost. I do not want this behaviour of having to bind the datagrid each time in pageLoad. Reasons: 1) The datasource of the grid is populated based on a users's selection off of the page. On PageLoad, I still don't have access to the user's selection (I only have acces to the dropdown lists/textboxes they alter/choose from after a postback occured, where I evaluate their selection from a buttonClick event handler.) 2) I don't want to bind the data each time the page loads. I only want to bind the data to the grid on a certain button click. Other controls on the page cause postbacks, and I don't want to bind the datagrid based on these events. Does anybody know of a way to do this? Greatly appreciate any help -- I've been stuck on this for days!! :( Cheers! [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
Dynamic TemplateColumns lose modified values on postback
Top