problems checkbox in datagrids

Discussion in 'ASP .Net Web Controls' started by Samuel Chowdhuri, Oct 18, 2003.

  1. this peace of code is giving me trouble

    DIM i as DataGridItem

    for each i in myDataGrid
    checkbox chkbox = Ctype(i.findcontrol("deletethis"),checkbox)

    if(chkbox.checked) then
    ......
    .....

    Compiler Error: Value of type 'System.Web.UI.Control' cannot be converted to
    'System.Windows.Forms.CheckBox'.

    How can I overcome this, i need to be able to see if the checkbox is checked
    or not.


    Thanx
    Samuel Chowdhuri, Oct 18, 2003
    #1
    1. Advertising

  2. The error message says that you are trying to cast the control to a
    WinForm's CheckBox, instead of an ASP.NET's one!!
    Did you included the System.Windows.Forms.dll assembly to your ASP.NET
    project??

    On Sat, 18 Oct 2003 23:12:56 +1000, "Samuel Chowdhuri"
    <> wrote:

    >this peace of code is giving me trouble
    >
    >DIM i as DataGridItem
    >
    >for each i in myDataGrid
    > checkbox chkbox = Ctype(i.findcontrol("deletethis"),checkbox)
    >
    > if(chkbox.checked) then
    >.....
    >....
    >
    >Compiler Error: Value of type 'System.Web.UI.Control' cannot be converted to
    >'System.Windows.Forms.CheckBox'.
    >
    >How can I overcome this, i need to be able to see if the checkbox is checked
    >or not.
    >
    >
    >Thanx
    >
    >
    >
    Juan Wajnerman, Oct 18, 2003
    #2
    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. DJ Dev
    Replies:
    1
    Views:
    422
    Corey O'Mara
    Feb 10, 2004
  2. tshad
    Replies:
    0
    Views:
    506
    tshad
    Apr 15, 2005
  3. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,379
    ThunderMusic
    Jan 25, 2006
  4. =?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:
    802
    David Wier
    Oct 6, 2006
  5. DJ Dev

    Runtime Datagrids and checkbox selections

    DJ Dev, Feb 8, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    258
    Corey O'Mara
    Feb 10, 2004
Loading...

Share This Page