Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / March 2006

Tip: Looking for answers? Try searching our database.

Adding Dynamic Controls to a DataGrid for use with the built in DataGrid Edit/Update functionality

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
davidjgonzalez@gmail.com - 24 Mar 2006 23:11 GMT
(VS 2003, .NET 1.1)
I am trying to add dynamic controls to the cells of an Edit Row in a
DataGrid and am having a terrible time.
I cannot for the life of me get the values from the dynamic controls
after the page posts back on the DataGrid UpdateRow event.

When I create a dynamic control (these are almost always
dropdownlists), for example a States dropdownlist, i give the new
DropDownList object an ID: "DYNAMIC_CONTROL_States". I notice when i
view source on the Edit DataGrid webpage the DropDownList's ID in the
HTML is something like "DataGridName__ctl2_ct3_DYNAMIC_CONTROL_States".

In this case do i have to re-generate the States dropdownlist OnInit
with the ID "DYNAMIC_CONTROL_States" or
"DataGridName__ctl2_ct3_DYNAMIC_CONTROL_States".

Where do i regenrate them? in OnInit()? What does it take to regenerate
them?

DropDownList myStates = new DropDownList().
myStates.ID = DYNAMIC_CONTROL_States;

do i have to add the DropDownList items as well?
is there anything else I have to do to bind the postback value that is
floating around in the ViewState to this control?

Can I see the value without re-generating the control? (ViewState[]
doesnt have anything in it)

If anyone has _ANY_ insight into adding dynamic controls to DataGrids i
would very much like to hear it. as it stands this is killin me.

Also - has anyone ever seen this working before or suceeded in getting
dynamic controls IN A DATAGRID to postback values? I've read around 50
different articles and have seen anyone say they've suceeded with a
datagrid (they have managed to do it w/ standalone controls).

Thanks
davidjgonzalez@gmail.com - 25 Mar 2006 07:55 GMT
One last thing - my DataGrid has AutoGenerateColumns = true (so the
DataGrid can display any DataSource)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.