If a column is sized with InitialAuto, which will also happen if they double click on the column separator to auto size the column, how do you determine the actual size of the column?
The column's ActualWidth property is 0.0 (zero) in this case, and the Width and WidthResolved properties only tell you that it's sized to InitialAuto. I need the real width in pixels that the column is actually sized to.
Thanks,
Mike
Hi Mike,
I have been trying to find out some other approach in order to delay an operation execution but my tries was without success.
This scenario seems not related to any Infragistics product so I can suggest you ask for a suggestion in the MSDN community, as the operation execution is related to .Net scenarios.
If you need any further assistance on this matter, feel free to ask.
That sounds right.
I was hoping that using Dispatcher.BeginInvoke after changing to each tab item would do it, but apparently it doesn't. Is there something else you can suggest?
Hello Mike,
The issue that you are having does not depend on the XamGrid. In order to get the ‘ActualWidth’ the control must be initialized and its columns to be drown. It seems that the time for looping through your all tab items is not necessary the group columns to be initialized.
That doesn't look like it works (reliably?). When I added that code most of the time I get the 0 column widths, but sometimes I do get the right widths. Do a refresh on the browser and the press the button immediately.
I actually have code (in my big application) that iterates over all the tab, doing DispatcherBeginInvoke every time I change the tab, and for each tab I expand the groups (again, using Dispatcher.BeginInvoke) to ensure things are loaded, and it still doesn't work. I've even tried doing many Dispatcher.BeginInvoke's.
There's something else going on here, but I can't figure out what it is.
Any ideas?
Thank you for the provided sample application and your explanation. Your issue occurs because the XamGrid in the second tab item is not initialized when you are trying to get the value for the columns.
I can suggest you to handle the ‘Loaded’ event of the TabControl and to switch through the tabs like e.g. :
private void tabControl_Loaded(object sender, RoutedEventArgs e)
{
tabControl.SelectedItem = tabControl.Items[1];
Dispatcher.BeginInvoke(new Action(() => tabControl.SelectedItem = tabControl.Items[0]));
tabControl.SelectedItem = tabControl.Items[0];
}
This way you can get the desired results.