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
215
Ultra Grid Group by
posted

Hi

I have an ultragrid which I allow group by on.  I also allow updating, deleting and inserting which gives me a null reference error.  I'm not sure why and I've considered disabling the buttons on the group by event which I was able to do (example a).  But when the group by is turned off how is there a better way to trap that? 

Is it common practive to NOT allow Insert/Update/Delete when grouping?  If so, Is there a better way to disable it?

Example A)

private void UltraGridList_AfterSortChange(object sender, BandEventArgs e)
        {
            //isGroupBySet = false;
            //for (int i = 0; i < e.Band.SortedColumns.Count; i++)
            //{
            //    UltraGridColumn sortColumn = e.Band.SortedColumns[i];
            //    if (sortColumn.IsGroupByColumn)
            //    {
            //        isGroupBySet = true;
            //    }
            //}
            //if (isGroupBySet == true)
            //{
            //    btnInsert.Enabled = false;
            //    btnDelete.Enabled = false;
            //    this.UltraGridList.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;
            //}
            //else
            //{
            //    btnInsert.Enabled = true;
            //    btnDelete.Enabled = true;
            //    UltraGridList.Enabled = true;
            //    this.UltraGridList.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True;
            //}
        }