I need to create a Windows Form with two DataGrids. On the right, there is a DataGrid which displays one selected table. Editing is disabled in this table. But selecting a row is possible. I use tow dropdowns to set up my select command for the database. On the left side I have placed a smaller DataGrid for editing items from the main table on the right.
A user should be able to click a row to select it. The content of the row should be displayed in the smaller DataGrid on the left. Like an Key-Value-Editor. The table has a column "Key" and a column "Value". The keys are the column titles of the DataGrid on the right. And the values are the content of the currently selected row.
gridControlEdit.DataBindings.Clear();
BindingSource bindingSource = gridControlTable.DataSource as BindingSource;
gridControlEdit.DataBindings.Add("DataSource", bindingSource, "aktiv", true, DataSourceUpdateMode.Never);
I am not sure why but bindingSource gets null even if my DataSource of the gridControlTable was set.