Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Getting the value in a cell in a DataGridView

Reply
Thread Tools

Getting the value in a cell in a DataGridView

 
 
Greg Smith
Guest
Posts: n/a
 
      07-05-2006
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
 
 
 
 
Winista
Guest
Posts: n/a
 
      07-05-2006
See this article.. it should give you some ideas..

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


"Greg Smith" <(E-Mail Removed)> wrote in message
news:uSnOs%(E-Mail Removed)...
> 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
 
 
 
 
Ozgur Seyrek
Guest
Posts: n/a
 
      07-27-2006
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" <(E-Mail Removed)> wrote in message
> news:uSnOs%(E-Mail Removed)...
> > 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
 
Winista
Guest
Posts: n/a
 
      07-27-2006
There is nothing like MessageBox.Show in ASP.Net world.

"Ozgur Seyrek" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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" <(E-Mail Removed)> wrote in message
>> news:uSnOs%(E-Mail Removed)...
>> > 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set readonly property on cell level in a datagridview Patrik ASP .Net Building Controls 3 02-16-2007 01:30 AM
How to set cell background based on cell value when datagrid is displayed RJ ASP .Net Datagrid Control 1 02-17-2005 09:37 PM
Getting the value of another cell in Grid in ItemTemplate msnews.microsoft.com ASP .Net 1 08-11-2004 12:42 AM
Getting the value of a databound cell in a datagrid in a loop OrlandoRocks ASP .Net 1 01-04-2004 10:08 AM
moving to cell Y if cell X has value Z. Clarke Rice Computer Support 0 06-30-2003 09:35 AM



Advertisments