Ask a Question related to ASP.NET General, Design and Development.
-
Nathan Baulch #1
Re: Correct DataTable index from sorted DataView...
> How do I get the correct DataTable index from a sorted DataView and a
My solution is to insert the primary key field as an invisible column into> DataGrid.SelectedIndex?
>
> I have a sortable DataGrid on a form with a ButtonColumn.
> The DataGrid is bound to a DataView, which in turn is linked to a
> DataTable. The DataView is persisted between round trips via a
> session variable.
>
> When the ButtonColumn it is clicked, I wish to retrieve a value from
> the corresponding row in the DataTable.
> This works fine so long as the DataGrid has not been sorted.
> When it is sorted, the value retrieved is from the incorrect row.
the DataGrid. When my button column is clicked, I use the code
"e.Item.Cells[0].Text" to retrieve the selected primary key. I can then use
that to lookup the whole row in the DataTable to get all associated
information.
It would be cleaner if DataView objects could translate indexes based on
sorts and filters, but this will have to do.
Nathan
Nathan Baulch Guest
-
DataGrid not binding in correct order from DataTable
Hello, I am having a spot of trouble with binding a DataTable to a DataGrid. My problem originates after I have created the DataTable and DataGrid.... -
Problem Hiding Columns when Populating a Datagrid with a DataView of A DataTable From Dataset returned via an Asynchronous Web-Service
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within... -
Needed: Index to a selected DataView row
Hi, I've got a DataGrid bound to a DataView that is sorted. ("Aha!", I hear you saying.) When I go to EditMode I get the right DataRow, but I... -
Recreate dataview/datatable/dataset from Datagrid
I've loaded a text file to a dataset and then bound it to a Datagrid. There isn't much data, but there are two related tables in the file. Instead... -
How to get row index for datatable
Hi Use Table.Rows.Find() Method. HTH Prasad "Sean" <ssmith@yahoo.com> wrote in message news:e8ClRrCXDHA.3268@tk2msftngp13.phx.gbl......



Reply With Quote

