access textbox values that are unbound in datagrid

Discussion in 'ASP .Net Datagrid Control' started by .NetNewbie, Jul 25, 2005.

  1. .NetNewbie

    .NetNewbie Guest

    I am a .NET newbie and have a simple question.

    I have a simple web form wherein the user can enter qty (which is a
    textbox field) for items he wants to purchase. All the columns in the
    datagrid on that form are bound except for the qty column which is of
    type templatecolumn and contains a textbox.

    I have a buy button at the bottom of the form. When the user click on
    that button, I want to find out

    1) which items the user wants to buy
    2) and how much qty he specified

    How do I do this? Any help would be greatly appreciated.
     
    .NetNewbie, Jul 25, 2005
    #1
    1. Advertising

  2. .NetNewbie

    Elton Wang Guest

    Hi there,

    You can loop thru items (rows) of the datagrid to process.

    Which items:
    Either have a check box to let user select or find out filled qty text
    boxes.

    How much qty:

    TextBox txtQty = (TextBox)datagridItem.FindControl("qty_textbox_id");
    string strQty = txtQty.Text;
    int intQty = Convert.ToInt32(strQty);

    HTH

    Elton


    ".NetNewbie" <> wrote in message
    news:...
    > I am a .NET newbie and have a simple question.
    >
    > I have a simple web form wherein the user can enter qty (which is a
    > textbox field) for items he wants to purchase. All the columns in the
    > datagrid on that form are bound except for the qty column which is of
    > type templatecolumn and contains a textbox.
    >
    > I have a buy button at the bottom of the form. When the user click on
    > that button, I want to find out
    >
    > 1) which items the user wants to buy
    > 2) and how much qty he specified
    >
    > How do I do this? Any help would be greatly appreciated.
    >
     
    Elton Wang, Jul 25, 2005
    #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. =?Utf-8?B?QmFsYQ==?=

    unbound datagrid

    =?Utf-8?B?QmFsYQ==?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,521
    =?Utf-8?B?QmFsYQ==?=
    Dec 28, 2004
  2. Replies:
    0
    Views:
    409
  3. Chip Pearson

    Unbound Access Data Source

    Chip Pearson, Jul 3, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    427
    Alvin Bruney [MVP]
    Jul 5, 2007
  4. David C

    Getting unbound ListView data values

    David C, Nov 10, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    1,233
    David C
    Nov 10, 2009
  5. Eddie B.

    Hide UNBOUND datagrid cols?

    Eddie B., Oct 21, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    171
    Alvin Bruney
    Oct 21, 2003
Loading...

Share This Page