Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
buran #1
datagrid - dropdownlist - checkbox problem
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:DropDownList 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:DropDownList>
</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
buran Guest
-
datagrid - checkbox cellrenderer - problem
sorry for my english, why when i check first checbox , when i scroll datagrid i see more than one checked item :) i include a this code: ... -
Checkbox in DataGrid Problem
may i please to share a source code to this problem i have a problem to realize this -
problem accessing checkbox in datagrid
hi I have a problem in datagrid Actually I am having a two datagrids and some other controls in a usercontrol. I have added this user control to... -
CheckBox inside DataGrid problem
I have a DataGrid (ID=DataGrid1) and a PlaceHolder on an aspx page. In the Init phase of the page, I dynamically add a template column containing a... -
checkbox column in a datagrid problem
I have a checkbox column in a datagrid so a user can select (by checking) mulitple items then hit a submit button to add them. The problem is that... -
Jos #2
Re: datagrid - dropdownlist - checkbox problem
"buran" <buran@buran.com> wrote in message
news:O9kTAKGJEHA.600@TK2MSFTNGP09.phx.gbl...control> 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 dropdownlistunchecks> (ID: ddlPS) and another with a checkbox control (ID: cbPS). My goal is to
> enable or disable the dropdownlist control when the user checks orrunat="server"> the checkbox. I am trying the following code:
>
> <asp:TemplateColumn HeaderText="Payment Status">
> <ItemTemplate>
> <asp:DropDownList ID="ddlPS" AutoPostBack="True"Invoice</asp:ListItem>> OnSelectedIndexChanged="GetSelectedIndex">
> <asp:ListItem Selected="true">Awaitinginvoice)</asp:ListItem>> <asp:ListItem>Invoice Received</asp:ListItem>
> <asp:ListItem>No Invoice (make payment)</asp:ListItem>
> <asp:ListItem>Prepayment made (awatingSomething like:> </asp:DropDownList>
> </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
Dim item As DataGridItem = CType(cb.Parent,DataGridItem)
Dim row As Integer = item.ItemIndex
--
Jos
Jos Guest
-
buran #3
Re: datagrid - dropdownlist - checkbox problem
Thanks Jos,
That was exactly what I've been looking for (The only change is: cb.Parent
to cb.Parent.Parent)
Dim item As DataGridItem = CType(cb.Parent.Parent, DataGridItem)
Dim row As Integer = item.ItemIndex
Burak Kadirbeyoglu
"Jos" <josnospambranders@fastmail.fm> wrote in message
news:O8cq1mGJEHA.3500@TK2MSFTNGP10.phx.gbl...This> "buran" <buran@buran.com> wrote in message
> news:O9kTAKGJEHA.600@TK2MSFTNGP09.phx.gbl...> > Dear ASP.NET Programmers,
> >
> > I have the following problem. I have a datagrid (ID: grdAllActions).to> control> > datagrid has two template columns: one column with the dropdownlist> > (ID: ddlPS) and another with a checkbox control (ID: cbPS). My goal is> unchecks> > enable or disable the dropdownlist control when the user checks or> runat="server"> > the checkbox. I am trying the following code:
> >
> > <asp:TemplateColumn HeaderText="Payment Status">
> > <ItemTemplate>
> > <asp:DropDownList ID="ddlPS" AutoPostBack="True"> Invoice</asp:ListItem>> > 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>> > </asp:DropDownList>
> > </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
> Something like:
>
> Dim item As DataGridItem = CType(cb.Parent,DataGridItem)
> Dim row As Integer = item.ItemIndex
>
> --
>
> Jos
>
>
buran Guest



Reply With Quote

