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
335
WinGrid AllowUpdate false, but allow the column with drop down to be updated
posted

hi all,

I have a simple one band Win Grid. One of columns contains a simple drop down. When I set the

DisplayLayout.Override.AllowUpdate to False,  the drop down won't work.  Is there anyway just leave this single column to be updatable?  I need the other columns to be non-updatable..

thanks in advance

  • 37774
    Suggested Answer
    posted

    One option would be to set the CellActivation of your individual columns to ActivateOnly or NoEdit, but the editable one to AllowEdit, i.e.

    private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    {
        foreach (UltraGridColumn column in e.Layout.Bands[0].Columns)
        {
            if (column.Key == "EditColumn")
                column.CellActivation = Activation.AllowEdit;
            else
                column.CellActivation = Activation.NoEdit;
        }
    }

    You could also handle the BeforeEnterEditMode event and check to see if the ActiveCell of the grid is in the editable column, otherwise cancel the event.

    -Matt