prevent gridview column from selecting

1 posts, 0 answers
  1. mostafa
    mostafa avatar
    7 posts
    Member since:
    Mar 2014

    Posted 13 Nov 2018 Link to this post

    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

     
Back to Top