Hi All,
I have a datagrid that has one column built from a querystring. The datagrid also has a ddl in it. I want to use data in the datagrid to insert entries into a look up table that will be used to clean data that is being uploaded from Excel files. I saw some code in C# that used the headertext and a for loop to get the data I'm just not sure how to go about it in
VB.
Here's the code to get the first column into the datagrid:
Code:
Dim CompsNot As Array
CompsNot = Split(_Comps, ", ")
Dim i As Integer
Dim Values As New ArrayList
For i = 0 To UBound(CompsNot)
Values.Add(Replace(CompsNot(i), ",", ""))
Next
grdCompsNot.DataSource = Values
grdCompsNot.DataBind()
Here is the front page code where I'm also adding the ddl and calling a function to populate the ddl.
Code:
<asp:DataGrid ID="grdCompsNot" AutoGenerateColumns="False" Runat="server" class="datagrid" >
<Columns>
<asp:templatecolumn headertext="Bad Name">
<itemtemplate>
<%# Container.DataItem %>
</itemtemplate>
</asp:templatecolumn>
<asp:TemplateColumn HeaderText="Good Name">
<ItemTemplate>
<asp:DropDownList ID="ddlCompID" Runat="server" DataTextField = "GoodName" DataValueField = "CompID" DataSource='<%# getCompID() %>' />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
Any help would be greatly appreciated.
Thanks.
Richard