Hi there,
I have an issue with the performautoresize method. I have an ultracombo item and on the OnInititializeLayout method I loop through the columns and use the performautoresize method on each one (I only have one currently). Then after OnInitializeLayout later on I add a cell image to the column and use the performatoresize method again. When I run/debug this code the cell image does not initially show when I drop down the control but if I drop it down for a second time it does show, like it is being refreshed, however the column text becomes cut off because now the cell image takes up some room. Now if I comment out the performautoresize call from the OnInitiliazeLayout method and just call it after the cell image is applied the image appears just fine on the first viewing. Why if I use performautoresize on the OnInitializeLayout method do all subsequent calls to performautoresizs not work correctly do some objects get cached on the initial call? Thanks.
Hi,
Thank you for posting in our forums.
I have created a sample in order to reproduce this behavior and everything works as expected for me – the columns are resized properly even after adding the image. What version are you using? Do you use PeroformAutoResize with the AllRowsInBand or just VisibleRows? Are you applying images to the whole column or just some of the cells.
Please provide me with a small sample that reproduces this issue. I have attached mine and you can use it a starting point.
Thank you for your collaboration.
I am looking forward to hearing from you.
Hi Dimitar,
Thanks for your response and sample code, I am using the latest version. Also I am using the method with AllRowsInBand and the boolean True for includeHeader. I have altered the code you sent across to reproduce the issue, this can be seen below are within the attachment:
private void Form1_Load(object sender, EventArgs e) { DataSet ds = new DataSet();
DataTable t1 = ds.Tables.Add("table1"); t1.Columns.Add("Information", typeof(string));
ds.Tables["table1"].Rows.Add(new Object[] { "Start typing to filter out items."}); ultraCombo1.DataSource = ds;
ultraCombo1.DisplayLayout.Bands[0].Columns[0].CellAppearance.Image = Image.FromFile(@"..\..\infra.jpg");
// PerformAutoResize after adding an image - this should expand to fit the image but it does // not show the image until the second time you drop down the control or you hover over the text // and then the text is partially hidden foreach (var column in ultraCombo1.DisplayLayout.Bands[0].Columns) { column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand); } }
private void ultraCombo1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { foreach (var column in e.Layout.Bands[0].Columns) { column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand); } }
Kind Regards,
Mat
Hi Mat,
Thank you for the provided sample.
It seems that this issue happens when you have only one column and only one row. I have logged it for further investigation in our internal issue tracking system with ID of 191957. I have also open a private case for you - CAS-153493-M6D7L8 – so that you will be notified as soon as the issue is fixed.
As a workaround you can add another column or row and then hide it, by setting its Hidden property to true.