display datagrid row on textBoxes
-
how can i display the datagrid row items in to textboxes when double clicked on that row. i'm using Visual studio.net 2003, and working on CSharp (C#). can anyone help me with code or an application??? thanks, horussssssssssssssssssssss:):sigh::sigh::sigh: hello
-
how can i display the datagrid row items in to textboxes when double clicked on that row. i'm using Visual studio.net 2003, and working on CSharp (C#). can anyone help me with code or an application??? thanks, horussssssssssssssssssssss:):sigh::sigh::sigh: hello
First you need to implement an eventhandler for the mouseup event of the datagrid. The following code can be inserted there:
BindingManagerBase bmb = dataGrid.BindingContext[dataGrid.DataSource,dataGrid.DataMember];
DataGrid.HitTestInfo hti = dataGrid.HitTest(e.X,e.Y);if(e.Button == MouseButtons.Left) {
if(hti.Type == DataGrid.HitTestType.Cell || hti.Type == DataGrid.HitTestType.RowHeader) {
bmb.Position = hti.Row;//Setup dataview for the textboxes dataView1.RowFilter = string.Format("Id = '{0}'",(bmb.Current as DataRowView)\["Id"\]);
}
}You can then bind the textboxes to a dataview that has the same table as the datagrid. WM.
What about weapons of mass-construction? -
how can i display the datagrid row items in to textboxes when double clicked on that row. i'm using Visual studio.net 2003, and working on CSharp (C#). can anyone help me with code or an application??? thanks, horussssssssssssssssssssss:):sigh::sigh::sigh: hello
-
how can i display the datagrid row items in to textboxes when double clicked on that row. i'm using Visual studio.net 2003, and working on CSharp (C#). can anyone help me with code or an application??? thanks, horussssssssssssssssssssss:):sigh::sigh::sigh: hello