adding a databound Dropdownlist to Datagrid???

J

James C

Hi all..

I have a DataGrid in an .aspx page (coded in VB.NET) which displays several databound columns (no editing allowed). Pretty straightforward so far but here's the question..

I need for each row to display an additional column with a dropdownlist which gets its list of data from a seperate table in SQL 2K. How do I add this dropdownlist as a seperate column to the datagrid? Any code would be GREATLY appreciated! The only user interaction is for users is to choose an item from the dropdownlist in each row of the datagrid before submitting (our datagrid usually ends up showing a dozen rows or so)

Any help would be greatly appreciated

Regards
James C
 
C

Colin Basterfield

Hi,

If I understand this correctly, then I assume that the dropdown list is
effectively a lookup list from which you choose a string, I also assume the
table you get the rows from has an id relative to this dropdown list and
that you want to insert the id back into the table once the corresponding
field has been selected and saved.

If this is true I probably have an answer, it is actually straight forward,
so let us know.

Cheers
Colin

James C said:
Hi all...

I have a DataGrid in an .aspx page (coded in VB.NET) which displays
several databound columns (no editing allowed). Pretty straightforward so
far but here's the question...
I need for each row to display an additional column with a dropdownlist
which gets its list of data from a seperate table in SQL 2K. How do I add
this dropdownlist as a seperate column to the datagrid? Any code would be
GREATLY appreciated! The only user interaction is for users is to choose an
item from the dropdownlist in each row of the datagrid before submitting
(our datagrid usually ends up showing a dozen rows or so).
 
C

Colin Basterfield

Hi James,

I have to confess, the bulk of what I was thinking would work for you is
thanks to Jesse Liberty and Dan Hurvitz in Programming ASP.NET, published by
O'Reilly.

I knocked up a little app, with one flaw which the book doesn't seem to
cover but let me know if it is ok to send the files to your hotmail address
below.

Cheers
Colin
 
H

Horus Alkebulan

I had the same question and someone pointed me to a *free* control which
adds drop down lists to datagrids.

The link is in the readme info I've posted below...

===
PAL Advanced DataGrid Columns for ASP.NET
Copyright (c) 2002 by Patrick A. Lorenz, (e-mail address removed)
Licence: Freeware

The Advanced DataGrid Columns Assembly contains several totally new
columns for the ASP.NET DataGrid control. You do not need to use another
control but can use the new columns by just adding the assembly to your
bin directory. Of course it's free to use.

Please see the aspx files for same samples on how use the new columns.

You'll find a detailed description on my website:

www.asp-buch.de/downloads/controls/adgc/

Hope you enjoy the columns.

Patrick, www.p-l.de

===
 
J

James C

Thank you Colin...I'm using the web-based newsreader so I couldn't see the attachment, would you be able to send your sample application directly to (e-mail address removed).

I would appreciate it! and thanks again. I'll also check out the O'Reilly book

Regards
James C
(e-mail address removed)



----- Colin Basterfield wrote: -----

Hi James,

I have to confess, the bulk of what I was thinking would work for you is
thanks to Jesse Liberty and Dan Hurvitz in Programming ASP.NET, published by
O'Reilly.

I knocked up a little app, with one flaw which the book doesn't seem to
cover but let me know if it is ok to send the files to your hotmail address
below.

Cheers
Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top