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;
{
public class grid: UltraGrid
}
~grid()
Hi John,
Clearing the Preset after it's applied will work. But you can't actually turn off the loading of the preset in code. The reason for this is that the preset is not applied by the grid code, it's the grid designer that does it when you put the grid onto the form.It's basically a setting on the machine, not the grid.
I suppose if you are deriving your own grid, you could create your own grid designer and assign it to your control, thus removing the grid designer from your control.
I found a solution that is working for me. After searching the forums I found how to clear the presets of my control.
In my constructor of my inherited class I call the following method:
Infragistics.Win.PresetSerializer.ClearPresets(this);
This clears the presets and allows me to set my own defaults.
That's just what I was looking for!
DisplayLayout.Override.CellClickAction = CellClickAction.EditAndSelectText
in the custom control (that inherits UltraGrid), when I drag this custom control to a form, it copies this row to the form InitializeComponents method. If I decide to change it in the custom control afterwards, it won't effect the grid I dragged before.
Meanwhile, I created a method that do this row, and in every form constructor I called this method so I can change this in one place, but I have to remember to write it down in every form.
Hi Mike,
Is there a way to turn this off using code. I'd to be able to turn this off in the contructor of my class.
The grid designer loads a Preset file into the grid by deafult when you create a new grid on a form. So it could be the designer. I beleive you can go into the Presets tab of the grid designer and turn this off.