I am trying to implement a DataGridView by clicking on the row header or selecting the whole column to enter an entire row Allows to choose Column header
I have tried to override the OnColumnHeaderMouseClick function and manually selected columns. It works only when I set the selection selection to the column header before the event is created.
How to get this behavior, any help would be greatly appreciated!
Here is my code related Detagrid view:
public class WDSSDataGridView: Detagreed scene (override protected void OnRowHeaderMouseClick (DataGridViewCellMouseEventArgs e) {this.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; Base.OnRowHeaderMouseClick (E);} Safe Override Zero OnColumnHeaderMouseClick (DataGridViewCellMouseEventArgs e) {this.SelectionMode = DataGridViewSelectionMode.ColumnHeaderSelect; base.OnColumnHeaderMouseClick (E);}} < div class = "post-text" itemprop = "text">
I think you have to do it manually:
protected override void OnRow HeaderMouseClick (DataGridViewCellMouseEventArgs e) {this.ClearSelection (); for (int i = 0; i & lt; this.Column.Count; ++ i) {this.Rows [e.RowIndex]. Miles [i] .Selected = True;} Base.OnRowHeaderMouseClick (e);} Safe Override Zero OnColumnHeaderMouseClick (DataGridViewCellMouseEventArgs e) {this.ClearSelection (); for (int i = 0; I & lt; This.Rows.Count; ++ i) {this.Rows [i] .sec [e.ColumnIndex]. Selected = true; } Base.OnColumnHeaderMouseClick (e); } Make sure SelectionMode = CellSelect
No comments:
Post a Comment