Hello. I have a page that restores data from a previously saved "draft". In the page I have several datagrids with textboxes and labels. In one datagrid I have a dropdownlist in the follow form:
<asp:TemplateColumn HeaderText="Official Reference">
<ItemTemplate>
<asp:dropdownlist id="ddlReferenceFQ" runat="server" >
<asp:ListItem value="YY" selected>Select.....</asp:ListItem>
<asp:ListItem value="NOM">NOM</asp:ListItem>
<asp:ListItem value="CODEX Alimentarius">CODEX Alimentarius</asp:ListItem>
<asp:ListItem value="BAM">BAM</asp:ListItem>
<asp:ListItem value="AOAC">AOAC</asp:ListItem>
</asp:dropdownlist>
</ItemTemplate>
</asp:TemplateColumn>
The data is binded very simple:
Dim ddlSelect As DropDownList
SQLProyecto = "SELECT * FROM libdds.IN_FISQU WHERE num_Proy = " & numProject
conCuestionaripen()
commCuestionario.Connection = conCuestionario
commCuestionario.CommandText = SQLProyecto
dataReaderCuestionario = commCuestionario.ExecuteReader()
dgFisicoquimicos.DataSource = dataReaderCuestionario
dgFisicoquimicos.DataBind()
dataReaderCuestionario.Close()
conCuestionario.Close()
All the data is loaded and displayed in their textboxes as should be, BUT how can I select the data value for the dropdownlist? If I have "NOM" in the database, I need to select "NOM" in the dropdownlist when the page is loaded, with all the list... any ideas? =(
Thank you in advance
<asp:TemplateColumn HeaderText="Official Reference">
<ItemTemplate>
<asp:dropdownlist id="ddlReferenceFQ" runat="server" >
<asp:ListItem value="YY" selected>Select.....</asp:ListItem>
<asp:ListItem value="NOM">NOM</asp:ListItem>
<asp:ListItem value="CODEX Alimentarius">CODEX Alimentarius</asp:ListItem>
<asp:ListItem value="BAM">BAM</asp:ListItem>
<asp:ListItem value="AOAC">AOAC</asp:ListItem>
</asp:dropdownlist>
</ItemTemplate>
</asp:TemplateColumn>
The data is binded very simple:
Dim ddlSelect As DropDownList
SQLProyecto = "SELECT * FROM libdds.IN_FISQU WHERE num_Proy = " & numProject
conCuestionaripen()
commCuestionario.Connection = conCuestionario
commCuestionario.CommandText = SQLProyecto
dataReaderCuestionario = commCuestionario.ExecuteReader()
dgFisicoquimicos.DataSource = dataReaderCuestionario
dgFisicoquimicos.DataBind()
dataReaderCuestionario.Close()
conCuestionario.Close()
All the data is loaded and displayed in their textboxes as should be, BUT how can I select the data value for the dropdownlist? If I have "NOM" in the database, I need to select "NOM" in the dropdownlist when the page is loaded, with all the list... any ideas? =(
Thank you in advance