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
360
Inheriting ultrawingrid - properties being overwritten Need help ASAP...
posted

I have a class which inherits a ultrawingrid I set some default properties in the constructor but when the grid is drawn on the form the grid does not keep the properties. Any ideas on whats happening.  It appears when the control is first drawn its correct but a few seconds later it changes.

 I included a scaled down verion of my class which demostrates mky issue.

 

John

 

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Infragistics.Win.UltraWinGrid;

namespace grid

{

public class grid: UltraGrid

{

grid():
base()

{

base.DisplayLayout.GroupByBox.Hidden = true;base.DisplayLayout.Appearance.BackColor = System.Drawing.SystemColors.Control;

}

~grid()

{

}

}

}

Parents
No Data
Reply
  • 17259
    Offline posted

    Check if in the form constructor these values are changed. This constructor happens after the grid class constructor.

    In my project, all the changes I set to the grid class, are being copied to the form constructor, so if I change something in the class grid, it won't effect on the controls I have been already dragged.

    If the property I change belongs to the grid itself (like RightToLeft) and it can be overriden, I overrided it and wrote my new value in an attribute of DefaultValue, and changed the value in the constructor.

    For other properties like those in the appearance or those that can't be overriden, I don't have a nice solution. Currently I have some functions that set some properties in the grid class. In the form I call the appropriate functions to set the properties. That's works fine but you can't see the changes in the designer, only by runtime.

    If someone has a solution for that I'll be glad to know.

Children