datagrid row selection

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, Aug 24, 2005.

  1. Hey all,

    I have a datagrid that has a select column. I've bound an untyped data table
    to the datagrid and was just wondering how I would get to all the values of a
    row when a user selects a row?

    Is there more than one way to do this?

    thanks,
    rodchar
    =?Utf-8?B?cm9kY2hhcg==?=, Aug 24, 2005
    #1
    1. Advertising

  2. Hi,
    I have used the following method with my .Net version 1.1:
    private void DataGrid1_ItemCommand(object sender, DataGridItemEventArgs e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)
    {
    firstColVal = e.Item.Cells[0].Text;
    secondColVal = en.Item.Cells[1].Text;
    .....
    }
    }

    If you have webcontrols such as dropdown list, radio buttons or check boxes
    inside each of the rows and wish to retrieve the values for those, you'd need
    to use the FindControl() function (I think).
    Hope that helps.
    Cheers,
    Calvin
    "rodchar" wrote:

    > Hey all,
    >
    > I have a datagrid that has a select column. I've bound an untyped data table
    > to the datagrid and was just wondering how I would get to all the values of a
    > row when a user selects a row?
    >
    > Is there more than one way to do this?
    >
    > thanks,
    > rodchar
    =?Utf-8?B?Q2FsdmluIEtE?=, Aug 25, 2005
    #2
    1. Advertising

  3. thank you, this helped.

    "Calvin KD" wrote:

    > Hi,
    > I have used the following method with my .Net version 1.1:
    > private void DataGrid1_ItemCommand(object sender, DataGridItemEventArgs e)
    > {
    > if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    > ListItemType.AlternatingItem)
    > {
    > firstColVal = e.Item.Cells[0].Text;
    > secondColVal = en.Item.Cells[1].Text;
    > .....
    > }
    > }
    >
    > If you have webcontrols such as dropdown list, radio buttons or check boxes
    > inside each of the rows and wish to retrieve the values for those, you'd need
    > to use the FindControl() function (I think).
    > Hope that helps.
    > Cheers,
    > Calvin
    > "rodchar" wrote:
    >
    > > Hey all,
    > >
    > > I have a datagrid that has a select column. I've bound an untyped data table
    > > to the datagrid and was just wondering how I would get to all the values of a
    > > row when a user selects a row?
    > >
    > > Is there more than one way to do this?
    > >
    > > thanks,
    > > rodchar
    =?Utf-8?B?cm9kY2hhcg==?=, Aug 25, 2005
    #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. =?Utf-8?B?YmFjazJncmlk?=

    highlight datagrid row on radiobutton selection

    =?Utf-8?B?YmFjazJncmlk?=, Sep 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    463
    =?Utf-8?B?YmFjazJncmlk?=
    Sep 13, 2004
  2. =?Utf-8?B?QmlkYXJrb3Rh?=

    DataGrid Client Side row selection

    =?Utf-8?B?QmlkYXJrb3Rh?=, May 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    532
    =?Utf-8?B?QmlkYXJrb3Rh?=
    May 23, 2005
  3. Simon Niederberger
    Replies:
    2
    Views:
    16,435
    Christian Kaufhold
    Jan 7, 2005
  4. Toby Riley

    Datagrid Row Selection

    Toby Riley, Oct 7, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    105
    Saravana [MVP]
    Oct 8, 2003
  5. D
    Replies:
    0
    Views:
    197
Loading...

Share This Page