Hi,
in design mode I enlarge the width of certain columns. (it is bound to DataSet or IListSource)
In the InitializeComponent the designer writes:
UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("NAME"
);
ultraGridColumn2.Width = 250;
When the grid is shown it only has the default size of each column. AutofitStyle is set to none.
The strange thing is if I manually add :
ultraGrid1.Displaylayout.Bands[0].Colomns["NAME"].Width = ultraColumn2.Width
after:
((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
The column has the desired size.
Is this a bug? What can I do to stop this behavior? Why is EndInit changing my colum width?
regards
Stefan
This article should help.
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
Hi Mark,
I already posted this to the tech support and I can reproduce the problem in a simple project.
1. Create a Form Porject
2. Create a UserControl (userControl1) with a Panel (dock fill) and insert a Grid with a dataset as datasource. Resize some columns.
3. Create a another UserControl (userControl2) with a ultraPanel (dock fill) and insert a Grid with the same dataset as source. Resize some columns.
4. Add two buttons to the form.
5. Button Click button1 --> instanciate the userControl1 --> add userControl1 to Form --> form1.Controls.Add(userControl1) ---> The Grid has the resized columns.
6. Repeat step 5 with userControl2 --> the columns have their default size :-(
I will post as soon as I get a confirmation of why this is happening.