Client side event for datagrid control

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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 |...
    4. 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 |...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139