Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Xavier Pacheco #1
Client side event for datagrid control
This is probably a simple one, but I cannot seem to find an example.
I have a datagrid with each row containing
Checkbox | Textbox | Validation
When the checkbox column is checked for a given row, TextBox is
enabled, initialized with a value and the validation is enabled.
When the checkbox column is unchecked, Textbox is disabled, initialized
to Emtpy and validation is disabled.
Any pointers?
- xavier
Xavier Pacheco Guest
-
Stopping client side event validation
Hi all, I've been trying unsuccessfully to stop client side event validation. I've created a simple page with a text box, a required field... -
Modify datagrid control on client side
Hello to all, I am using Visual Studio 2005 now. Is there an example out there where one can see a Microsoft Datagrid control being modified on... -
client side event for grid
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
client side checkbox event
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
Sending Client Side Event ?
"Genival" <geniobr@hotmail.com> wrote in message news:e1x0bIOdDHA.2804@TK2MSFTNGP11.phx.gbl... You can't quite do this. The only thing your... -
Lamont #2
RE: Client side event for datagrid control
In your datagrids ItemDataBound event you have to do something like this...
szCheckScript &= "document.frmCC.dgContracts__ctl" & _
e.Item.ItemIndex + 2 & "_" & e.Item.Cells(7).Controls(7).ID & _
".disabled=false;"
szUnCheckScript &= "document.frmCC.dgContracts__ctl" & _
e.Item.ItemIndex + 2 & "_" & e.Item.Cells(7).Controls(7).ID & _
".disabled=true;"
tmpChkBox = CType(e.Item.Cells(2).Controls(1), CheckBox)
tmpChkBox.Attributes.Add("onclick", "if (this.checked) {" & _
szCheckScript & _
"} else {" & _
szUnCheckScript & _
"}")
View the source on your page when you run it and look at the names .NET
assigns to the checkbox controls in the datagrid. That will explain all the
ctl code where it is getting the name of the control.
Hope that makes sense.
--
Lamont - OKC Developer
"Xavier Pacheco" wrote:
> This is probably a simple one, but I cannot seem to find an example.
>
> I have a datagrid with each row containing
>
> Checkbox | Textbox | Validation
>
> When the checkbox column is checked for a given row, TextBox is
> enabled, initialized with a value and the validation is enabled.
>
> When the checkbox column is unchecked, Textbox is disabled, initialized
> to Emtpy and validation is disabled.
>
> Any pointers?
> - xavier
>Lamont Guest



Reply With Quote

