B
buran
Dear ASP.NET Programmers,
I have the following problem. I have a datagrid (ID: grdAllActions). This
datagrid has two template columns: one column with the dropdownlist control
(ID: ddlPS) and another with a checkbox control (ID: cbPS). My goal is to
enable or disable the dropdownlist control when the user checks or unchecks
the checkbox. I am trying the following code:
<asp:TemplateColumn HeaderText="Payment Status">
<ItemTemplate>
<asp
ropDownList ID="ddlPS" AutoPostBack="True" runat="server"
OnSelectedIndexChanged="GetSelectedIndex">
<asp:ListItem Selected="true">Awaiting Invoice</asp:ListItem>
<asp:ListItem>Invoice Received</asp:ListItem>
<asp:ListItem>No Invoice (make payment)</asp:ListItem>
<asp:ListItem>Prepayment made (awating invoice)</asp:ListItem>
</asp
ropDownList>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="cbPS" Runat="server" AutoPostBack="True"
OnCheckedChanged="DisablePS"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
Sub DisablePS(ByVal sender As Object, ByVal e As EventArgs)
Dim cb As CheckBox
cb = CType(sender, CheckBox)
If cb.Checked = True Then
'?????????
End If
End Sub
How can I get the index of the row that contins the checkbox? Thanks in
advance,
Burak Kadirbeyoglu
I have the following problem. I have a datagrid (ID: grdAllActions). This
datagrid has two template columns: one column with the dropdownlist control
(ID: ddlPS) and another with a checkbox control (ID: cbPS). My goal is to
enable or disable the dropdownlist control when the user checks or unchecks
the checkbox. I am trying the following code:
<asp:TemplateColumn HeaderText="Payment Status">
<ItemTemplate>
<asp
OnSelectedIndexChanged="GetSelectedIndex">
<asp:ListItem Selected="true">Awaiting Invoice</asp:ListItem>
<asp:ListItem>Invoice Received</asp:ListItem>
<asp:ListItem>No Invoice (make payment)</asp:ListItem>
<asp:ListItem>Prepayment made (awating invoice)</asp:ListItem>
</asp
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="cbPS" Runat="server" AutoPostBack="True"
OnCheckedChanged="DisablePS"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
Sub DisablePS(ByVal sender As Object, ByVal e As EventArgs)
Dim cb As CheckBox
cb = CType(sender, CheckBox)
If cb.Checked = True Then
'?????????
End If
End Sub
How can I get the index of the row that contins the checkbox? Thanks in
advance,
Burak Kadirbeyoglu