Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 9th, 2007, 06:15 AM
Registered User
 
Join Date: Mar 2007
Location: , , India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
  #2 (permalink)  
Old March 9th, 2007, 06:35 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

gridTable.Rows[SelectedRow].Cells[0].Value;

--

Joe (Microsoft MVP - XML)
  #3 (permalink)  
Old March 10th, 2007, 04:33 AM
Registered User
 
Join Date: Mar 2007
Location: , , India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Finally I got the solution myself

int selectedRow = this.gridTable.CurrentRow.Index;

gridTable.Rows(SelectedRow).Cells(0).Value;

  #4 (permalink)  
Old March 10th, 2007, 05:37 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paging Data grid view Prakash001 Visual Basic 2005 Basics 0 February 6th, 2008 04:07 AM
Data Grid View Paging in VB.Net Prakash001 Visual Studio 2005 0 January 30th, 2008 07:44 AM
show data record in grid view - sqlserver2005 vinodonline2000 ASP.NET 2.0 Basics 5 August 10th, 2007 05:24 AM
How to display data into Grid View? Somesh ASP.NET 2.0 Professional 5 May 25th, 2007 07:07 AM



All times are GMT -4. The time now is 04:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.