disabling a textbox

Discussion in 'ASP .Net Datagrid Control' started by Pkenty, Mar 5, 2004.

  1. Pkenty

    Pkenty Guest

    How do you disable a TextBox in a datagrid in the Code
    behind?
    im using e.item.cells[1].Enabled = false..
    But this doesnt stop the user actually typing anything in
    textbox..just shows as grey?
    any idea?
     
    Pkenty, Mar 5, 2004
    #1
    1. Advertising

  2. Hi,

    ((TextBox)e.Item.Cells[2].Controls[0]).Enabled=false; or
    ((TextBox)e.Item.Cells[2].Controls[1]).Enabled=false;

    depends on the index of your textbox control on your datagrid cell.

    Hope this helps.

    Regards,

    Marshal Antony

    ..NET Developer

    http://www.dotnetmarshal.com







    "Pkenty" <> wrote in message
    news:7b8c01c402d4$fab71000$...
    > How do you disable a TextBox in a datagrid in the Code
    > behind?
    > im using e.item.cells[1].Enabled = false..
    > But this doesnt stop the user actually typing anything in
    > textbox..just shows as grey?
    > any idea?
     
    Marshal Antony, Mar 6, 2004
    #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. S. Justin Gengo
    Replies:
    0
    Views:
    537
    S. Justin Gengo
    Jul 16, 2003
  2. Hazzard
    Replies:
    2
    Views:
    551
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  3. Natty Gur
    Replies:
    0
    Views:
    462
    Natty Gur
    Jul 22, 2003
  4. Andy Fish
    Replies:
    2
    Views:
    779
    Andy Fish
    Nov 5, 2004
  5. Anita C

    Disabling a combobox when a particular textbox has focus

    Anita C, Feb 2, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    89
    Anita C
    Feb 2, 2004
Loading...

Share This Page