Click here to Skip to main content
15,881,715 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can you change the height of a Form's Title Bar? Pin
Nnamdi Onyeyiri23-Sep-02 6:50
Nnamdi Onyeyiri23-Sep-02 6:50 
GeneralRe: Can you change the height of a Form's Title Bar? Pin
Rodney S. Foley23-Sep-02 11:56
Rodney S. Foley23-Sep-02 11:56 
GeneralRe: Can you change the height of a Form's Title Bar? Pin
leppie23-Sep-02 14:00
leppie23-Sep-02 14:00 
GeneralMaching the row in a datagrid to a row in a DataTable Pin
stephen woolhead22-Sep-02 14:02
stephen woolhead22-Sep-02 14:02 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley22-Sep-02 14:43
Paul Riley22-Sep-02 14:43 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
stephen woolhead22-Sep-02 14:48
stephen woolhead22-Sep-02 14:48 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley22-Sep-02 14:59
Paul Riley22-Sep-02 14:59 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
stephen woolhead23-Sep-02 0:34
stephen woolhead23-Sep-02 0:34 
OK, say I had code that looked like this..

DataSet ds = GetMyDataSet () ;<br />
<br />
DataTable dt = ds.Tables["Results"] ;<br />
DataView dv = new DataView (dt) ;<br />
dv.AllowNew = false ;<br />
<br />
dataGrid1.DataSource = dv ;


And somewhere else I want to delete the current row in response to a button click from the tool bar.

I could do..

DataView dv = (DataView )dataGrid1.DataSource ;<br />
DataTable dt = dv.Table ;<br />
dt.Rows[dg.CurrentCell.RowNumber].Delete ;


But if the grid has been sorted by using the column headers this will no longer work as the grid row number no longer matches the row number in the dataTable.

What I would like to do is find a way to go from a row in the datagrid to the row in the datasource.

The delete is just an example, it is the row mapping that is realy of intreast to me.

Thanks

Stephen.
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley23-Sep-02 1:27
Paul Riley23-Sep-02 1:27 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
stephen woolhead23-Sep-02 2:46
stephen woolhead23-Sep-02 2:46 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley23-Sep-02 3:07
Paul Riley23-Sep-02 3:07 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
stephen woolhead23-Sep-02 5:31
stephen woolhead23-Sep-02 5:31 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley23-Sep-02 5:42
Paul Riley23-Sep-02 5:42 
Generalhelp Pin
imran_rafique22-Sep-02 13:53
imran_rafique22-Sep-02 13:53 
GeneralRe: help Pin
Stephane Rodriguez.22-Sep-02 20:15
Stephane Rodriguez.22-Sep-02 20:15 
GeneralDesktop Hierarchy Pin
Wjousts22-Sep-02 13:41
Wjousts22-Sep-02 13:41 
GeneralRe: Desktop Hierarchy Pin
Paul Riley22-Sep-02 15:07
Paul Riley22-Sep-02 15:07 
Questionhelp? Pin
imran_rafique22-Sep-02 13:35
imran_rafique22-Sep-02 13:35 
GeneralDragging files onto a windows form Pin
zimbar22-Sep-02 5:01
zimbar22-Sep-02 5:01 
GeneralRe: Dragging files onto a windows form Pin
Stephane Rodriguez.22-Sep-02 5:20
Stephane Rodriguez.22-Sep-02 5:20 
GeneralCustom Control Pin
Donald Blachly21-Sep-02 18:55
Donald Blachly21-Sep-02 18:55 
GeneralRe: Custom Control Pin
Stephane Rodriguez.21-Sep-02 21:24
Stephane Rodriguez.21-Sep-02 21:24 
GeneralRe: Custom Control Pin
James T. Johnson21-Sep-02 21:42
James T. Johnson21-Sep-02 21:42 
GeneralRe: Custom Control Pin
Stephane Rodriguez.21-Sep-02 22:59
Stephane Rodriguez.21-Sep-02 22:59 
GeneralRe: Custom Control Pin
James T. Johnson21-Sep-02 23:13
James T. Johnson21-Sep-02 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.