private void gridView1_CustomColumnGroup(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnSortEventArgs e)
        {
            PartContainer row1 = e.RowObject1 as PartContainer;
            PartContainer row2 = e.RowObject2 as PartContainer;

            if ((row1.ID < 0) && (row2.ID < 0))
            {
                if (e.SortOrder == DevExpress.Data.ColumnSortOrder.Ascending)
                {
                    if (row1.ID < row2.ID)
                    {
                        e.Result = 1;
                    }
                    else
                    {
                        e.Result = -1;
                    }
                }
                if (e.SortOrder == DevExpress.Data.ColumnSortOrder.Descending)
                {
                    if (row1.ID < row2.ID)
                    {
                        e.Result = -1;
                    }
                    else
                    {
                        e.Result = 1;
                    }
                }

                e.Handled = true;
            }
        }
 public BlankItem(DataSourceWrapper wrapper, GridView view, int id)
 {
     ItemObject    = new PartContainer();
     ItemObject.ID = id;
     Wrapper       = wrapper;
     Wrapper.CustomRows.Add(ItemObject);
     View = view;
     view.GridControl.PaintEx += GridControl_PaintEx;
     View.ShowingEditor       += new CancelEventHandler(View_ShowingEditor);
     Text = "[Empty String]";
 }
        public SummaryItem(DataSourceWrapper wrapper, GridView view, int id)
        {
            ItemObject    = new PartContainer();
            ItemObject.ID = id;
            Wrapper       = wrapper;

            calcSummary(Wrapper.NestedList as BindingList <PartContainer>);
            wrapper.NestedList.ListChanged += new ListChangedEventHandler(list_ListChanged);
            Wrapper.CustomRows.Add(ItemObject);
            View = view;
            View.ShowingEditor += new CancelEventHandler(View_ShowingEditor);
        }