<asp:TemplateField HeaderText = "DATAITEM:"> <itemtemplate> <asp:Label ID="LblDataItem" runat="server" Text= '<%# eval("dataitem") %>' /> </itemtemplate> <edititemtemplate> <asp:DropDownList ID="DDLDataItemnew" runat="server" AutoPostBack ="true" OnSelectedIndexChanged = "DDLDataItemnew_selectedindexchanged" > <asp:ListItem>Choose One <asp:ListItem>DETAIL <asp:ListItem>SUMMARY <asp:ListItem>CUSTOM </edititemtemplate> <asp:TemplateField HeaderText = "PERM CODE:" Visible="false" > <edititemtemplate> <asp:DropDownList ID="DDLPermCode" runat="server" /> </edititemtemplate>
Protected Sub DDLDataItemnew_selectedindexchanged(ByVal sender As Object, ByVal e As EventArgs) Dim tmp_dataitem As DropDownList = DirectCast(DTLVwAddeduser.FindControl("DDLDataItemnew"), DropDownList) Dim dataitem As String = Trim(tmp_dataitem.Text) If dataitem = "DETAIL" Then If DTLVwAddeduser.CurrentMode = DetailsViewMode.Edit Then //get the index of the DATAITEM headertext Dim i As Integer = GetIndex("DATAITEM:",DTLVwAddeduser) DTLVwAddeduser.Fields(i).Visible = True End If End If End Sub
Dim dataitem As String = Trim(tmp_dataitem.SelectedItem.Value)
Dim dataitem As String = Trim(tmp_dataitem.Text)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)