Hi,
I'm using FocusedRowChanged to trap when a record is selected in a grid.
When this happens I want to focus a specific column/cell and show it's editor, which I'm doing with :
MatchGrid.DefView.FocusedColumn = MatchGrid.DefView.Columns["Allocate"];
MatchGrid.DefView.ShowEditor();
This works fine when the moving up and down the grid using the up/down keys. However when you just click on a different row with the mouse it doesn't work.
Should I be handling a different event to achieve what I need ?
Cheers,
Phil.
Hello,
As I understand, you want to change the column to the desired one and launch an editor irrespective of whether the user has selected another column. Correct me if I'm wrong.
To achieve your goal, handle the GridView.ShowingEditor event and check if it's not the column that you need and cancel the editor display in this case:
void gridView1_ShowingEditor(object sender, CancelEventArgs e) { if (gridView1.FocusedColumn != gridView1.Columns["Name"]) e.Cancel = true; }
I'm looking forward to your response.
Hi,
No, in my grid all the other columns are readonly, there are no other active editor fields. My issue is that I am catching FocusedRowChanged, the idea being that when a new record is selected (by any method) that the "Allocate" column be focused, and it's associated editor be shown.
I don't just want to cancel other editors (as there are none), I want to ALWAYS force focus to the Allocate column and show its editor.
Hope that clarifies.
Cheers,
Phil.