Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 5th, 2006, 06:03 AM
Authorized User
Join Date: Nov 2006
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Get Specific Cell Value of Data Grid in C#

I want to fetch selected cell value from datagrid. How is it possible. Let me know about this. This is urgent. Pls
kumar Ashish

Thanks and Regards
Kumar Ashish
Kumar Ashish
Old February 1st, 2007, 08:17 AM
Registered User
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

May be this will help you.

Suppose we have DataGrid grd;

int cur_row = grd.CurrentRowIndex; //getting current selected grid row
if(cur_row == -1)
  return; // if there is no selected row just exit of method

object val = grd[grd.CurrentCell]; //getting value of the current cell

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Data Grid Cell Value Using Javascript dotnetsathya ASP.NET 1.0 and 1.1 Basics 0 October 23rd, 2008 02:00 AM
how data grid of vb.net add cell color Nuwang Forum and Wrox.com Feedback 0 September 10th, 2008 08:36 PM
Copy specific data in specific cells of sheet2 yogeshyl Excel VBA 1 May 14th, 2007 07:40 AM
Export Access Data to a Specific Cell in Excel. VBNoob Access VBA 1 December 14th, 2005 08:25 PM
validation of one cell of a Data Grid to another Ljhopkins ASP.NET 1.0 and 1.1 Basics 1 November 5th, 2005 01:53 AM

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