Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Deepak #1
Handling events in a datagrid
Hi,
I am having a datagrid with 3 radiobuttons in one template column and a
textbox in another template column. How can I disable or enable the textbox
in the second template column depending on the value of the radio buttons?
I am also giving my datagrid for ur reference.
<asp:DataGrid id="MyDataGrid" runat="server" OnSortCommand="MyDataGrid_Sort"
AllowPaging="True"
PageSize="10"
BorderColor="black"
BorderWidth="1"
GridLines="Both"
autodraw = "False"
AllowSorting="true"
AutoGenerateColumns="false"
Width=100%
<columns>
<asp:templatecolumn headertext = "<font style='text-decoration:none'
color='#ffffff' Title='Click here to SORT' Title='Click here to SORT'>
Approve/Reject</font>" >
<ItemTemplate >
<font = "LHBoxFont">
<asp:radiobutton id= "rbtnApprove" GroupName ="a" runat="server" /> Pay
Claims
<br>
<asp:radiobutton id= "rbtnReject" GroupName ="a" runat="server" /> Reject
Claims
<br>
<asp:radiobutton id= "rbtnIgnore" checked="true" GroupName ="a"
runat="server" /> Ignore Claims
</font>
<itemStyle width = 15% Cssclass = lblHeader align=center>
</itemStyle>
</ItemTemplate>
</asp:templatecolumn>
<asp:templatecolumn headertext = "<font style='text-decoration:none'
color='#ffffff' Title='Click here to SORT' Title='Click here to SORT'> Paid
Date/Comments</font>" >
<ItemTemplate>
<asp:textbox id= "txtPayClaims" runat="server"/>
</ItemTemplate>
<itemStyle width = 25% Cssclass = lblHeader >
</itemStyle>
</asp:templatecolumn>
</columns>
</asp:DataGrid>
In the above scenario, I want to enable the textbox,"txtPayClaims", if the
value in the radiobutton, "rbtnApprove" is selected and must disable the
textbox if the value in the radiobutton, "rbtnReject" is selected .
Is there any way I can do this??
Thanks,
Deepak
Deepak Guest
-
Handling Events Of DataGrid Template Item Controls - UNANSWERED
If I place a checkbox control into a template column of a DataGrid, how do I gain access to the CheckChanged event handler procedure that... -
Events Handling Order
Hi all, I'm a total newbie, so this might be stupid... Anyway, I've created an expanding tree of categories control, based on DataList. It works... -
(vb.net) Handling user-control events
I created a web-project containg an .aspx file and a self- made User-Control (.acsx file) - all in vb.net. My aspx file contains a Submit button... -
Handling events in container controls?
Hi, I have a sub in a user control that looks like this: Public Sub BatchDetail_ItemCommand(ByVal Sender As Object, ByVal e As... -
Handling Events in Nested Controls
Hi, I have nested User Controls like below. User_Control_1 User_Control_11 User_Control_12(contains method DisplayMessage) ... -
Saravana #2
Re: Handling events in a datagrid
You can attach OnCheckedChanged eventhandler to radio button and set its
autopostback property to true. Then in that eventhandler you can access the
textbox, so you disable or enable it depending upon the requirement. In the
event handler you can write code like this to access the text box
Dim oTextbox As TextBox
Dim oRadio As RadioButton
oRadio = CType(sender, RadioButton)
oTextbox = oTextbox.Parent.FindControl("txtPayClaims")
oTextbox.enabled = "Changed"
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Deepak" <deepakvi@anz.com> wrote in message
news:#W9sz9uPDHA.2768@tk2msftngp13.phx.gbl...textbox> Hi,
> I am having a datagrid with 3 radiobuttons in one template column and a
> textbox in another template column. How can I disable or enable theOnSortCommand="MyDataGrid_Sort"> in the second template column depending on the value of the radio buttons?
> I am also giving my datagrid for ur reference.
>
> <asp:DataGrid id="MyDataGrid" runat="server"Paid> AllowPaging="True"
> PageSize="10"
> BorderColor="black"
> BorderWidth="1"
> GridLines="Both"
> autodraw = "False"
> AllowSorting="true"
> AutoGenerateColumns="false"
> Width=100%
>
> <columns>
>
> <asp:templatecolumn headertext = "<font style='text-decoration:none'
> color='#ffffff' Title='Click here to SORT' Title='Click here to SORT'>
> Approve/Reject</font>" >
> <ItemTemplate >
> <font = "LHBoxFont">
> <asp:radiobutton id= "rbtnApprove" GroupName ="a" runat="server" /> Pay
> Claims
>
> <br>
> <asp:radiobutton id= "rbtnReject" GroupName ="a" runat="server" /> Reject
> Claims
> <br>
> <asp:radiobutton id= "rbtnIgnore" checked="true" GroupName ="a"
> runat="server" /> Ignore Claims
>
> </font>
> <itemStyle width = 15% Cssclass = lblHeader align=center>
> </itemStyle>
> </ItemTemplate>
>
>
> </asp:templatecolumn>
>
>
> <asp:templatecolumn headertext = "<font style='text-decoration:none'
> color='#ffffff' Title='Click here to SORT' Title='Click here to SORT'>> Date/Comments</font>" >
> <ItemTemplate>
> <asp:textbox id= "txtPayClaims" runat="server"/>
> </ItemTemplate>
> <itemStyle width = 25% Cssclass = lblHeader >
> </itemStyle>
> </asp:templatecolumn>
>
> </columns>
>
> </asp:DataGrid>
>
>
> In the above scenario, I want to enable the textbox,"txtPayClaims", if the
> value in the radiobutton, "rbtnApprove" is selected and must disable the
> textbox if the value in the radiobutton, "rbtnReject" is selected .
>
> Is there any way I can do this??
>
> Thanks,
> Deepak
>
>
>
>
Saravana Guest



Reply With Quote

