This is a migrated thread and some comments may be shown as answers.

prevent gridview column from selecting

0 Answers 8 Views
ListView
This is a migrated thread and some comments may be shown as answers.
mostafa
Top achievements
Rank 1
mostafa asked on 13 Nov 2018, 05:30 PM

hi i tasked to create a multi-button gridview column and how its go:

 

public class GridExtraItemsCell : GridCommandCellElement
{
    public override bool IsEditable => false;
    public override bool IsCurrent => false;
    public override bool IsSelected => false;
    private ExtraElementContents btns;
    add a child and handle Click Events and Delegate
}

 

hi i tasked to create a multi-button gridview column and how its go:
public class GridExtraItemsCell : GridCommandCellElement{public override bool IsEditable => false;public override bool IsCurrent => false;public override bool IsSelected => false;private ExtraElementContents btns;
add a child and handle Click Events and Delegate
}
public class GridExtraItemsColumn : GridViewCommandColumn{public event EventHandler ButtonClick;public void Button_Click(object sender, EventArgs e){this.OnButtonClick(sender, e);}protected virtual void OnButtonClick(object sender, EventArgs e){if (this.ButtonClick != null){this.ButtonClick(sender, e);}}public GridExtraItemsColumn(string fieldName) : base(fieldName){}public override Type GetCellType(GridViewRowInfo row){if (row is GridViewDataRowInfo){return typeof(GridExtraItemsCell);}return base.GetCellType(row);}}

 

and its Work Perfectly but here's a thing when i click on the cell in run time in first click cell is selected and with the nest click Event fire My goal is run My-button_Click on a first click

 

No answers yet. Maybe you can help?

Tags
ListView
Asked by
mostafa
Top achievements
Rank 1
Share this question
or