DataGrid DataBind

J

Jim Heavey

I have a datagrid which is bound to data Table A. When I
edit a row, I want 2 columns to show a DropDownList with
on of those columns bound to Table B and the other bound
to Table C.

Can I do that?
 
S

SSW

Sure u can.

Make two column as template and Add DropDownList as usual and bind it to database.

Below is tag for Datagrid with two Columns having DropDownList.

<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 127px; POSITION: absolute; TOP: 44px" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:DropDownList id=DropDownList1 runat="server" DataSource="<%# UrDataSource1 %>" DataTextField="UrDataTextField2" DataValueField="UrDataValueField2">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:DropDownList id="DropDownList2" runat="server" DataSource="<%# UrDataSource2 %>" DataTextField="UrDataTextField2" DataValueField="UrDataValueField2"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

Hope this helps

Thanks,

sswalia
MCSD, MCAD, OCA
 

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

No members online now.

Forum statistics

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

Latest Threads

Top