Creating new rows in a datgrid/datalist

Creating new rows in a datgrid/datalist

Post by JoE » Thu, 11 Apr 2002 09:37:53



I am trying to allow a user to setup a dynamic number of name value pairs.

Both NAME field and VALUE field should be dropdown, and all NAME dropdown's
should containe the same data as well as the VALUE dropdown's. I want the
user to press an 'Add' button and a new row with two dropdown should be
displayed.

How can I do this?
How can I reference the dropdowns?

Thanks

Joe

 
 
 

Creating new rows in a datgrid/datalist

Post by Jim Ross [MVP » Fri, 12 Apr 2002 10:10:49


The usual way to add a new row when an 'add' button is clicked is to
add a record to the underlying datasource and re-bind.

The following articles should give you what you need to know about
working with the dropdowns:
Top Questions About the DataGrid Web Server Control
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_v...

Cutting Edge: Server-side ASP.NET Data Binding, Part 2: Customizing
the DataGrid Control  
 http://msdn.microsoft.com/library/en-us/dnmag01/html/cutting0104.asp


>I am trying to allow a user to setup a dynamic number of name value pairs.

>Both NAME field and VALUE field should be dropdown, and all NAME dropdown's
>should containe the same data as well as the VALUE dropdown's. I want the
>user to press an 'Add' button and a new row with two dropdown should be
>displayed.

>How can I do this?
>How can I reference the dropdowns?

>Thanks

>Joe

Jim Ross
MS MVP [ASP.NET][VC/MFC emeritus]

To send email, change 'lotsofspamthroughhere' to 'msn' but please ask all questions in the newsgroups, not via private mail