Hi all, everybody knows where i can find samples to how create combobox
inside e datagrid,
e how to populate it??
Scott Mitchell [MVP] - 26 Feb 2004 18:42 GMT
> Hi all, everybody knows where i can find samples to how create combobox
> inside e datagrid, how to populate it??
I discuss this in my book, ASP.NET Data Web Controls Kick Start.
Also, you might want to look into Andy Smith's free RowSelectorColumn:
http://metabuilders.com/Tools/RowSelectorColumn.aspx

Signature
<shameless plug>
For more information on the DataGrid, DataList, and Repeater controls,
consider picking up a copy of my latest book:
ASP.NET Data Web Controls
http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
</shameless plug>
Happy Programming!
Scott Mitchell
mitchell@4guysfromrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com
* When you think ASP, think 4GuysFromRolla.com!
Barnabas (Barney) Yohannes - 26 Feb 2004 22:41 GMT
In your html section, type the following
<asp:TemplateColumn SortExpression="VName" HeaderText="Vendor"><ItemTemplate><%# Container.DataItem("VName") %></ItemTemplate><FooterTemplate><asp:DropDownList id=VendorA runat="server" DataSource="<%# GetVendors() %>" DataValueField="VName" DataTextField="VName" ></asp:DropDownList></FooterTemplate><EditItemTemplate><asp:DropDownList id=VendorE runat="server" DataSource="<%# GetVendors() %>" DataValueField="VName" DataTextField="VName" SelectedIndex='<%# GetSelectedIndex(Container.DataItem("VName")) %>'/></asp:DropDownList></EditItemTemplate
In your VB Section, type the follwing
Function GetVendors() As DataSe
Dim da As SqlDataAdapte
Dim strSQL As Strin
Dim strCnn As Strin
strSQL = "SELECT Distinct VName FROM Vendors" 'Constants.SqlStrin
strCnn = Constants.ConnectionStrin
da = New SqlDataAdapter(strSQL, strCnn
' ddlDataSet = New DataSe
da.Fill(ddlDataSet, "VTable"
'Session("DataView") = ds.Tables("VTable").DefaultVie
Return ddlDataSe
' Return Session("DataView") 'Return the DataSe
End Functio
I am sure you will figure out what you need to do. Also, on this page, there is a good sample
http://authors.aspalliance.com/das/dgcombo.asp
Good luck!