Problem with DataGrid, CheckBox and DropDownList

Discussion in 'ASP .Net Web Controls' started by shiv, Jun 17, 2004.

  1. shiv

    shiv Guest

    Hi all:

    I need some help/clarification with the DataGrid control. Here is what I am trying to achieve:

    I am populating a DataGrid after a user has made a selection in a dropdownlist. After the selection, the users clicks on the submit button and that populates the grid. A few of the columns are databound and I am adding 2 more columns [TemplateColumns to be precise], each with a checkbox, dropdownlist and a textbox. Now I want to have the functionality that users should click on a checkbox on any row and that would enable the dropdownlist. This needs to happen immediately and I guess I would need to have the autopostback property of the checkbox to be true. After the user has done all the updates i.e. checking the boxes, I want to update those rows to a table in my database (I wont be updating the same table, rather writing all the row / checkbox.checked info to a new table. The trouble I am having right now is that I cant seem to know / get the values of the checkboxes. I have read quite a few posts and I have some pieces of code, but to no success. Some posts say that this can be handled in the ItemCommand event whilst some say OnCheckedChanged. Which one is it, and how would you do it - the sample snippet doesnt have to elaborate or complete, but enough to guide me through. What I have been acheive so far is to populate the grid with the data and thats it. Also, its ok if i cant get the dropdown to enable, but at least if i can access the values of the checkbox would be helpful. If you need me to post my code, let me know and i will post it.

    PS: I am doing this using C# code-behind.

    thanks,
    shiv.
     
    shiv, Jun 17, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. buran
    Replies:
    2
    Views:
    2,266
    buran
    Apr 17, 2004
  2. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    863
    David Wier
    Oct 6, 2006
  3. Jason Huang
    Replies:
    0
    Views:
    583
    Jason Huang
    Jun 29, 2007
  4. buran

    datagrid - dropdownlist - checkbox problem

    buran, Apr 17, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    174
    buran
    Apr 17, 2004
  5. Joey Pang
    Replies:
    4
    Views:
    561
    Joey Pang
    Jun 13, 2005
Loading...

Share This Page