473,408 Members | 1,982 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,408 software developers and data experts.

Updating a datagrid value directly?

Is it possible to update a datagrid directly without having to use the
underlying datatable? I use framework 1.0.

Angel

Nov 16 '05 #1
6 1945
You can update custom business objects. The objects will have to implement
some data binding interfaces.

http://msdn.microsoft.com/library/de...et02252003.asp

"Angel" <none> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...
Is it possible to update a datagrid directly without having to use the
underlying datatable? I use framework 1.0.

Angel

Nov 16 '05 #2
Angel,

Yes, it is. If you have a reference to the grid control, the default
indexer will allow you to get/set the values in the grid.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Angel" <none> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...
Is it possible to update a datagrid directly without having to use the
underlying datatable? I use framework 1.0.

Angel

Nov 16 '05 #3
Can you provide an example of using the default indexer in the datagrid?

Thanks again.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:#S*************@TK2MSFTNGP10.phx.gbl...
Angel,

Yes, it is. If you have a reference to the grid control, the default
indexer will allow you to get/set the values in the grid.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Angel" <none> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...
Is it possible to update a datagrid directly without having to use the
underlying datatable? I use framework 1.0.

Angel


Nov 16 '05 #4
Angel,

It's simple, if you have a datagrid reference, you can do this:

// Set the value in the first column of the first row to "hello", assuming
it takes a string value.
// mobjDataGrid is the reference to System.Windows.Forms.DataGrid
mobjDataGrid[0, 0] = "hello";
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Angel" <none> wrote in message
news:Os**************@TK2MSFTNGP12.phx.gbl...
Can you provide an example of using the default indexer in the datagrid?

Thanks again.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:#S*************@TK2MSFTNGP10.phx.gbl...
Angel,

Yes, it is. If you have a reference to the grid control, the default indexer will allow you to get/set the values in the grid.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Angel" <none> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...
Is it possible to update a datagrid directly without having to use the
underlying datatable? I use framework 1.0.

Angel



Nov 16 '05 #5
Hi Angel,

Does Nicholas' reply make sense to you? Do you still have concern on this
issue?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #6
Yes. It worked perfectly.

Thanks,
Angel
""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:XL**************@cpmsftngxa10.phx.gbl...
Hi Angel,

Does Nicholas' reply make sense to you? Do you still have concern on this
issue?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #7

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

Similar topics

9
by: Pam Ammond | last post by:
After clicking btnDeleteSize_Click in frmSize, I move to frmSizeDelete, allow deleting a Size using a datagrid, and then return to frmSize and want to update the datagrid in frmSize to reflect the...
24
by: Mike L | last post by:
This is for a Win form, in C# 2005. I want to load a datagrid, make some columns width 0, and then clean out the record I added. I get the error message, ""Index was out of range. Must be...
6
by: mkobus | last post by:
Im relatively new, so please be patient with me... I need to update a parent .aspx screen from a popup and close the popup. Normally I would use...
3
by: Jon Agiato | last post by:
Hi, I am trying to use a data grid in a web application in which I have three tiers. The DataGrid is not set up to a data source, or a data adapter, so everytime I make a change I send the cell...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
5
by: Hennie | last post by:
When trying to update a record in an editable datagrid I ran into a few problems. My update procedure is just not working. Can someone please have a look at my code and see what am I doing wrong....
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
0
by: Chet | last post by:
I have a Datagrid that is bound to a Datatable at runtime. I allow the user to select a number of rows using the mouse and then click a button that says "check selected rows", which then cycles...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.