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;
            //}
        }
Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Tony, 

    I can't think of any reason why you shouldn't be able to delete rows when grouping. Adding rows might be a little tricky, since you have to make sure you populate whatever field is used for the grouping, but that's not really a big deal.

    How are you allowing the adding of new rows? Are you setting AllowAddNew? What setting are you using? Does the TemplateAddRow show up if you use one of the TemplateAddRow settings? 

Children