Getting the value in a cell in a DataGridView

Discussion in 'ASP .Net Datagrid Control' started by Greg Smith, Jul 5, 2006.

  1. Greg Smith

    Greg Smith Guest

    I would like to capture the value in a specific cell in the current row on
    a double-click event on a DataGridView.

    I can't seem to figure out the syntax.

    Any help is greatly appreciated.
     
    Greg Smith, Jul 5, 2006
    #1
    1. Advertising

  2. Greg Smith

    Winista Guest

    See this article.. it should give you some ideas..

    http://www.netomatix.com/development/gridviewclientsideaccess.aspx


    "Greg Smith" <> wrote in message
    news:uSnOs%...
    > I would like to capture the value in a specific cell in the current row on
    > a double-click event on a DataGridView.
    >
    > I can't seem to figure out the syntax.
    >
    > Any help is greatly appreciated.
    >
     
    Winista, Jul 5, 2006
    #2
    1. Advertising

  3. Greg Smith

    Ozgur Seyrek Guest

    Well Winista referanced an article that is a java code and it didnt
    give any idea to me
    Here is simple way to do that,
    This is my first programming attempt. if this a stupid way to do this
    please inform me.
    // adresses to selected row's sixth cell
    string ProdID
    =dataGridView1.SelectedRows[0].Cells[5].EditedFormattedValue.ToString();
    // adresses to selected row's first cell
    string ProdCode =
    dataGridView1.SelectedRows[0].Cells[0].EditedFormattedValue.ToString();
    MessageBox.Show("Product ID " + ProdID + " Product Code " + ProdCode)

    Put this code under
    private void dataGridView1_CellMouseDoubleClick(object sender,
    DataGridViewCellMouseEventArgs e)

    and it will work

    Winista yazdi:
    > See this article.. it should give you some ideas..
    >
    > http://www.netomatix.com/development/gridviewclientsideaccess.aspx
    >
    >
    > "Greg Smith" <> wrote in message
    > news:uSnOs%...
    > > I would like to capture the value in a specific cell in the current row on
    > > a double-click event on a DataGridView.
    > >
    > > I can't seem to figure out the syntax.
    > >
    > > Any help is greatly appreciated.
    > >
     
    Ozgur Seyrek, Jul 27, 2006
    #3
  4. Greg Smith

    Winista Guest

    There is nothing like MessageBox.Show in ASP.Net world.

    "Ozgur Seyrek" <> wrote in message
    news:...
    > Well Winista referanced an article that is a java code and it didnt
    > give any idea to me
    > Here is simple way to do that,
    > This is my first programming attempt. if this a stupid way to do this
    > please inform me.
    > // adresses to selected row's sixth cell
    > string ProdID
    > =dataGridView1.SelectedRows[0].Cells[5].EditedFormattedValue.ToString();
    > // adresses to selected row's first cell
    > string ProdCode =
    > dataGridView1.SelectedRows[0].Cells[0].EditedFormattedValue.ToString();
    > MessageBox.Show("Product ID " + ProdID + " Product Code " + ProdCode)
    >
    > Put this code under
    > private void dataGridView1_CellMouseDoubleClick(object sender,
    > DataGridViewCellMouseEventArgs e)
    >
    > and it will work
    >
    > Winista yazdi:
    >> See this article.. it should give you some ideas..
    >>
    >> http://www.netomatix.com/development/gridviewclientsideaccess.aspx
    >>
    >>
    >> "Greg Smith" <> wrote in message
    >> news:uSnOs%...
    >> > I would like to capture the value in a specific cell in the current row
    >> > on
    >> > a double-click event on a DataGridView.
    >> >
    >> > I can't seem to figure out the syntax.
    >> >
    >> > Any help is greatly appreciated.
    >> >

    >
     
    Winista, Jul 27, 2006
    #4
    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. OrlandoRocks
    Replies:
    1
    Views:
    2,768
    Teemu Keiski
    Jan 4, 2004
  2. msnews.microsoft.com
    Replies:
    1
    Views:
    1,443
    Ken Cox [Microsoft MVP]
    Aug 11, 2004
  3. Patrik

    Set readonly property on cell level in a datagridview

    Patrik, Feb 15, 2007, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    517
    Steven Cheng[MSFT]
    Feb 16, 2007
  4. msnews.microsoft.com

    Getting the value of another cell in Grid in ItemTemplate

    msnews.microsoft.com, Aug 9, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    150
    Ken Cox [Microsoft MVP]
    Aug 11, 2004
  5. RJ
    Replies:
    1
    Views:
    244
    Eliyahu Goldin
    Feb 17, 2005
Loading...

Share This Page