Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: DataGridControl AutoCreateColumns Auto-Size Columns

$
0
0
Re. Ok.

Re. 2: Actually, I did some more testing, and as expected, there were subsequent calls to the ItemsSourceChangeCompleted Event Handler where the DataGridControl's Items Collection was not empty. However, even then, GetFittedWidth returns -1. My production app assigns an empty Collection to the ObservableCollection<MyItemViewModel> Property in the View Model when it's Instantiated which is done so before it's first assigned to the DataGridControl's DataContext (which btw, unexpectedly to me, did not Raise ItemsSourceChangeCompleted). Then, when the Window's Show Method is called, strangely, now the DataGridControl's ItemsSourceChangeCompleted Event Handler is finally called (during which Items is empty and GetFittedWidth returns -1) and (subsequently as expected) the Loaded Event Handler is called (during which Items is still empty but GetFittedWidth now return values > 0). However, after Window's Show Method is called, I then assign a non-empty Collection to the Property Bound to ItemsSource which leads to the ItemsSourceChangeCompleted Event Handler being called (during which now Items is not empty but GetFittedWidth still returns -1). So, the 2 Event Handlers are working / not working in the opposite ways in my production app vs. my test app. Sigh.

Re. 3: Ok.

Viewing all articles
Browse latest Browse all 4964

Trending Articles