DataGrid row value
-
Hello all, i am using Datagrid to dispay row directly from my database but i need to click on one row to open details for this row from another table in the database where i can hang the value for the row with specifc row like in the combobox ValueMember Thanks for help Hoho
-
Hello all, i am using Datagrid to dispay row directly from my database but i need to click on one row to open details for this row from another table in the database where i can hang the value for the row with specifc row like in the combobox ValueMember Thanks for help Hoho
DataRowView currentRowInTheGrid = (DataRowView)this.dataGrid1.BindingManager[this.dataGrid1.DataSource, this.dataGrid1.DataMember].Current;
I hope you understand...because is a rough world out there...
-
DataRowView currentRowInTheGrid = (DataRowView)this.dataGrid1.BindingManager[this.dataGrid1.DataSource, this.dataGrid1.DataMember].Current;
I hope you understand...because is a rough world out there...
-
Thanks so much about your help but i need to know the ID of this current record to select the related details with this ID. thank hoho
Having the dataRowView you can obtain the coresponding dataRow :
DataRowView currentRowInTheGrid = (DataRowView)this.dataGrid1.BindingManager[this.dataGrid1.DataSource, this.dataGrid1.DataMember].Current;
DataRow currentRow = currentRowInTheGrid.Row;object myId = currentRow["myIdColumnName"]; // is the same as object myId = currentRowInTheGrid["myIdColumnName"];
I hope you understand...because is a rough world out there...