Updating a datagrid value directly?

  • Thread starter Thread starter Angel
  • Start date Start date
A

Angel

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

Angel
 
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.
 
Can you provide an example of using the default indexer in the datagrid?

Thanks again.


Nicholas Paldino said:
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]
- (e-mail address removed)

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

Angel
 
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]
- (e-mail address removed)

Angel said:
Can you provide an example of using the default indexer in the datagrid?

Thanks again.


message news:#[email protected]...
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]
- (e-mail address removed)

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

Angel
 
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.
 
Back
Top