HighTechTalks DotNet Forums  

Getting the value in a cell in a DataGridView

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Getting the value in a cell in a DataGridView in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Greg Smith
 
Posts: n/a

Default Getting the value in a cell in a DataGridView - 07-05-2006 , 02:19 PM






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.



Reply With Quote
  #2  
Old   
Winista
 
Posts: n/a

Default Re: Getting the value in a cell in a DataGridView - 07-05-2006 , 03:41 PM






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

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


"Greg Smith" <gjs (AT) umn (DOT) edu> wrote

Quote:
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.




Reply With Quote
  #3  
Old   
Ozgur Seyrek
 
Posts: n/a

Default Re: Getting the value in a cell in a DataGridView - 07-27-2006 , 12:03 PM



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:
Quote:
See this article.. it should give you some ideas..

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


"Greg Smith" <gjs (AT) umn (DOT) edu> wrote in message
news:uSnOs%23FoGHA.4800 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
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.



Reply With Quote
  #4  
Old   
Winista
 
Posts: n/a

Default Re: Getting the value in a cell in a DataGridView - 07-27-2006 , 04:45 PM



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

"Ozgur Seyrek" <wavewizard (AT) gmail (DOT) com> wrote

Quote:
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...ideaccess.aspx


"Greg Smith" <gjs (AT) umn (DOT) edu> wrote in message
news:uSnOs%23FoGHA.4800 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
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.





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.