|
-
Mar 28th, 2003, 02:51 PM
#1
Thread Starter
Addicted Member
Gurus ! Dynamic controls & retrieving values...
HI all, I've come across a problem and I have no clue on how to resolve this :
I ha ev a datagrid that must display dynamic fields & value :
[Custom field 1] (label) : [Custom Field 1 Value] (textbox)
[Custom field 2] (label) : [Custom Field 2 Value] (textbox)
...
It works, as I am adding these fields in a datagrid within its cells.
Now, when the page has been sent and another event (after new postback) wants to retrieve values in those fields, these controls cannot be find and do not exists anymore... (Viewstate don't recognize them as part of page..)
So, what can I do to allow user to edit custom-made fields ???
Thanks in advance,
-
Mar 29th, 2003, 05:14 PM
#2
PowerPoster
You might be able to achieve what you want by creating your own custom column control. You have to create a class and inherit from the DataGridColumn class in the System.Web.UI.WebControls namespace.
I got this link from a book I have:
http://aspnet.4guysfromrolla.com/articles/100202-1.aspx
-
Mar 30th, 2003, 12:12 PM
#3
Thread Starter
Addicted Member
You think that this way the viewstate will keep controls added at runtime ?
-
Mar 30th, 2003, 12:32 PM
#4
PowerPoster
I am not sure, just trying to give you some ideas. I have looked around a bit, and that seemed to be the best lead I had. Good luck, and if you figure it out, please post how you did it so others will know.
-
Mar 31st, 2003, 11:50 AM
#5
Thread Starter
Addicted Member
Ok thanks,
I didn't had time to create my own class so I went with Datagrid Editcolumn instead of doing mass update, I do each item with Edit/Udate.
Thanks for everything!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|