Torna al Thread

<asp:TemplateField HeaderText="Produzione"> <EditItemTemplate> <asp:DropDownList ID="ddl2" AppendDataBoundItems="true" runat="server" OnDataBound=popolaDDl2 Text='<%# Bind("PRODUZIONE") %>' selectedValue='<%# Bind("PRODUZIONE") %>'> <asp:ListItem>SI</asp:ListItem> <asp:ListItem>NO</asp:ListItem> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("PRODUZIONE") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> Protected Sub popolaDdl2(ByVal sender As Object, ByVal e As EventArgs) Dim ddl As DropDownList = DirectCast(sender, DropDownList) If ddl.SelectedValue.ToString.Equals("SI") Then Dim txtCom1 As TextBox = CType(Me.Datagrid2.FindControl("TextBox5"), TextBox) Dim txtCom2 As TextBox = CType(Me.Datagrid2.FindControl("TextBox6"), TextBox) txtCom1.ReadOnly = True txtCom2.ReadOnly = True End If End Sub
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5