|
|
 |
| C# 2005 For discussion of Visual C# 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# 2005 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

March 9th, 2007, 06:15 AM
|
|
Registered User
|
|
Join Date: Mar 2007
Location: , , India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Data Grid View
Hello Every Body,
I used "gridTable.Rows(SelectedRow).Cells(0).Value" this code to get value of column(0) of selected row in vb.net 2005. Here gridTable is DataGridView.
Can Any body suggest me How To write same line / code in C#.net.
cool dude 
|

March 9th, 2007, 06:35 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 Posts
|
|
gridTable.Rows[SelectedRow].Cells[0].Value;
--
Joe ( Microsoft MVP - XML)
|

March 10th, 2007, 04:33 AM
|
|
Registered User
|
|
Join Date: Mar 2007
Location: , , India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Finally I got the solution myself
int selectedRow = this.gridTable.CurrentRow.Index;
gridTable.Rows(SelectedRow).Cells(0).Value;
|

March 10th, 2007, 05:37 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 Posts
|
|
I don't understand that at all. You asked for c# based on VB.NET, therefore I presumed that SelectedRow was initialised correctly otherwise the VB.NET wouldn't work. Presumably you could use:
Code:
this.gridTable.CurrentRow.Cells[0].Value;
--
Joe ( Microsoft MVP - XML)
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |