473,324 Members | 2,567 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,324 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 1527
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.