473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do you access the value of a cell in a Windows form datagrid?

How do you access the value of a cell in a Windows form datagrid?

I know this is how you would do it using an ASP.NET datagrid:
DataGrid1.Items[1].Cells[1].Text

However, "Items" is not available in the Windows Forms datagrid.

Thanks,

Paul

Jul 21 '05 #1
2 1529
You access it by using the indexer like the follwoing code snippet:

DataGrid dg = new DataGrid();
object cellValue = dg[1,1];

I hope this helps.

Jon

"Paul Daly (MCP)" <Pa*********@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...
How do you access the value of a cell in a Windows form datagrid?

I know this is how you would do it using an ASP.NET datagrid:
DataGrid1.Items[1].Cells[1].Text

However, "Items" is not available in the Windows Forms datagrid.

Thanks,

Paul

Jul 21 '05 #2
Thanks! That worked!

- Paul

"CodeMeister" wrote:
You access it by using the indexer like the follwoing code snippet:

DataGrid dg = new DataGrid();
object cellValue = dg[1,1];

I hope this helps.

Jon

"Paul Daly (MCP)" <Pa*********@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...
How do you access the value of a cell in a Windows form datagrid?

I know this is how you would do it using an ASP.NET datagrid:
DataGrid1.Items[1].Cells[1].Text

However, "Items" is not available in the Windows Forms datagrid.

Thanks,

Paul


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shravan | last post by:
Hi, I have a extended datagrid, in which I am setting values at a given cell in the grid using grid = val; The grid has NewRow creation set to false But sometimes setting value at a...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
5
by: Jason | last post by:
I've been trying to figure out a good way to do this but haven't had much luck, any input would be greatly appreciated. Basically, after a datagrid is sorted, how can I get the primary key value...
3
by: Tracey | last post by:
sorry I post this problem again. I have to stop my work to fix the problem. I'm doing a multi form application(Not a MDI one). My startup form say Form1 has a datagrid say datagrid1, when I...
1
by: Tricia Colwell via DotNetMonster.com | last post by:
Here is what i have: I have a datagrid with two columns one is a combo box style and the other is a textbox style. If the combo box is "Between" or "Like" i want that the next cell to be...
2
by: Paul Daly (MCP) | last post by:
How do you access the value of a cell in a Windows form datagrid? I know this is how you would do it using an ASP.NET datagrid: DataGrid1.Items.Cells.Text However, "Items" is not available in...
2
by: benfly08 | last post by:
Hi, everyone. I got a weird problem for my C# program. In my program, I use a DataGrid to display data. I bind the DataGrid to a DataTable. I made all the cells in DataGrid ReadOnly as True. So...
2
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Greetings, I am trying to find out how to do something that on the surface seems like it should be very simple to do. I have a datagrid with a datatable bound to it using the SetDataBinding...
4
by: _MC_ | last post by:
Hi, I'm unable to access values in my Datagrid. Datagrid thinks it hase only 1 Cell. So here it is: The Datagrid is binded in PageLoad, AutoGenerateColumns is false, Columns are added on...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.