Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Edit cells and row select on other cells
posted

Hi,

Is the following possible. I have a bindinglist with 2 properties that are editable. What I want the grid to do is when clicked on a cell that is editable go into edit mode for that cell and when clicked on a cell that is not editable do a row select.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi, 

    This should be fairly simple. All you have to do is set the CellClickAction property on each column. So you could do something like this. 

            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                var layout = e.Layout;
                var band = layout.Bands[0];
    
                foreach (var column in band.Columns)
                {
                    bool isColumnEditable = this.IsColumnEditable(column);
                    if (isColumnEditable)
                        column.CellClickAction = CellClickAction.EditAndSelectText;
                    else
                        column.CellClickAction = CellClickAction.RowSelect;
                }
            }

    In this example, the IsColumnEditable method is up to you. You can probably just examine the column.Key and you presumably know which columns allow editing. 

Children
No Data