Dropdownlist for databoundcolumn

M

Mike

Hi

How can i code a dropdownlist for a databound column in a datagrid? the
datagrid has to be editable
btw i looked on datagridgirl.com but nothing that suited ..

ch Mike
 
E

Eliyahu Goldin

Mike,

You can't put a ddl inside a boundcolumn. You should use a template column
instead and put the ddl into ItemTemplate. Then you databind the ddl inside
the template.

Eliyahu
 
M

Mike

Eli,

I tried that but how do you bind the dropdownlist to the column? there is
no DataField property on a dropdownlist. Also how do you populate the
listbox (in a editable datagrid)?

ch Mike
 
E

Eliyahu Goldin

Mike,

ddl has a bunch of properties for databinding:
DataSource, DataMember, DataTextField, DataTextFormatString, DataValueField
..

Everything gets populated on DataBind() call.

Eliyahu
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top