How do I add a Textbox to my DataGrid?

Discussion in 'ASP .Net Datagrid Control' started by B Holt, Oct 30, 2003.

  1. B Holt

    B Holt Guest

    Here's the problem: I am using WebMatrix and although I have a lot of IDE
    experience, I am a newbie at Web-based apps.

    How Do I get a TextBox into (each row of) my DataGrid to allow the user to
    edit the value of one column?

    I have seen a lot of "sample code", but all of it contains syntax that I
    simply do not understand.

    Can anyone PLEASE just explain in simple terms the steps I need to take? I
    have all the column. I just want one of them to be editable. I AM using a
    DataGrid control, and not an MxDataGrid (which I believe is correct.)

    Please help!!!!
    B Holt, Oct 30, 2003
    #1
    1. Advertising

  2. B Holt

    Josh Behl Guest

    There are a couple of ways to approach this.

    First, you can right click your datagrid, choose property builder, in the
    window that opens, click on the 'columns' link on the left hand side. This
    will open another window which will allow you to allow the addition of all
    columns, specific columns, edit/select/cancel buttons, etc..... At the top
    of this window there are two listboxes. On the left hand listbox, scroll
    down or collapse the first node. expand the next node which is called
    'buttons' I think (I'm trying to remember this off the top of my head).
    Once expanded, select the edit, select option and pass that to the right
    hand lsit box. Click OK.

    There is some other code which you need to save your changes, get the cancel
    button to work, etc. You can find that information at the following link:
    http://msdn.microsoft.com/library/d...ughusingdatagridwebcontroltoreadwritedata.asp
    This example is probably one of the easiest ones to follow for a 'newbie'.
    Another site which I have refernced before as a good one stop shop to find
    articles about datagrids is www.datagridgirl.com. Another is
    www.4guysfromrolla.com. If you are new to web appls it may be a bit tricky
    to latch on to at first.

    Good Luck

    "B Holt" <> wrote in message
    news:...
    > Here's the problem: I am using WebMatrix and although I have a lot of IDE
    > experience, I am a newbie at Web-based apps.
    >
    > How Do I get a TextBox into (each row of) my DataGrid to allow the user to
    > edit the value of one column?
    >
    > I have seen a lot of "sample code", but all of it contains syntax that I
    > simply do not understand.
    >
    > Can anyone PLEASE just explain in simple terms the steps I need to take?

    I
    > have all the column. I just want one of them to be editable. I AM using

    a
    > DataGrid control, and not an MxDataGrid (which I believe is correct.)
    >
    > Please help!!!!
    >
    >
    Josh Behl, Oct 30, 2003
    #2
    1. Advertising

  3. B Holt

    B Holt Guest

    Now I have my TextBoxes in the DataGrid. How do I read them and update the
    information in the database? My Update Query is returning the correct
    number of "RowsAffected", but the data is not changing. Do I need to UnBind
    the DataGrid before Updating? Any ideas?


    Thanks for the help!



    "Josh Behl" <> wrote in message
    news:...
    > There are a couple of ways to approach this.
    >
    > First, you can right click your datagrid, choose property builder, in the
    > window that opens, click on the 'columns' link on the left hand side.

    This
    > will open another window which will allow you to allow the addition of all
    > columns, specific columns, edit/select/cancel buttons, etc..... At the

    top
    > of this window there are two listboxes. On the left hand listbox, scroll
    > down or collapse the first node. expand the next node which is called
    > 'buttons' I think (I'm trying to remember this off the top of my head).
    > Once expanded, select the edit, select option and pass that to the right
    > hand lsit box. Click OK.
    >
    > There is some other code which you need to save your changes, get the

    cancel
    > button to work, etc. You can find that information at the following link:
    >

    http://msdn.microsoft.com/library/d...ughusingdatagridwebcontroltoreadwritedata.asp
    > This example is probably one of the easiest ones to follow for a 'newbie'.
    > Another site which I have refernced before as a good one stop shop to find
    > articles about datagrids is www.datagridgirl.com. Another is
    > www.4guysfromrolla.com. If you are new to web appls it may be a bit

    tricky
    > to latch on to at first.
    >
    > Good Luck
    >
    > "B Holt" <> wrote in message
    > news:...
    > > Here's the problem: I am using WebMatrix and although I have a lot of

    IDE
    > > experience, I am a newbie at Web-based apps.
    > >
    > > How Do I get a TextBox into (each row of) my DataGrid to allow the user

    to
    > > edit the value of one column?
    > >
    > > I have seen a lot of "sample code", but all of it contains syntax that I
    > > simply do not understand.
    > >
    > > Can anyone PLEASE just explain in simple terms the steps I need to take?

    > I
    > > have all the column. I just want one of them to be editable. I AM

    using
    > a
    > > DataGrid control, and not an MxDataGrid (which I believe is correct.)
    > >
    > > Please help!!!!
    > >
    > >

    >
    >
    B Holt, Oct 31, 2003
    #3
    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:
    494
    S. Justin Gengo
    Jul 16, 2003
  2. Grey
    Replies:
    1
    Views:
    3,589
    Ashish M Bhonkiya
    Apr 25, 2004
  3. matthew schouppe
    Replies:
    3
    Views:
    2,345
    Scott Allen
    Apr 30, 2004
  4. matthew schouppe

    DataGrid ItemStyle is a textbox and doesn't update the datagrid datasource

    matthew schouppe, Apr 29, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    193
    Scott Allen
    Apr 30, 2004
  5. Santosh
    Replies:
    0
    Views:
    104
    Santosh
    May 15, 2006
Loading...

Share This Page