2nd try: Get data directly from DataGrid

  • Thread starter Thread starter _A
  • Start date Start date
A

_A

I'd like to retrieve items directly from a DataGrid rather than from the
source (data table). The goal is to retrieve a field in the Datagrid's
current sort order.

Is there an easy way to do this?
 
Are you binding a table view to the datagrid (in order to sort)? If so, then
use the table view and iterate through it.
 
I'd like to retrieve items directly from a DataGrid rather than from the
source (data table). The goal is to retrieve a field in the Datagrid's
current sort order.

Is there an easy way to do this?
With a webform datagrid: Yes
With a windowform datagrid: No

However when you use with the last the dataview and the currencymanager
there is not any problem to get that, you are not the only one who is making
programs using the windowforms datagrid you know.

I hope this gives some idea's

Cor
 
If I understand you correctly then Sure. You can just reference the grid
directly ie dataGrid1[0,2] would give you the value of the 0th row, second
column. If you are trying to determine what's the sort column currently,
you can bind to a DataView and access its .Sort property (conversely, you
can set this too without making the users click on the header by specifying
the sort field.

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
Back
Top