Click here to Skip to main content
15,915,817 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: A WPF 'ah-ha' moment for you. Pin
ColinM12327-Jan-09 11:42
ColinM12327-Jan-09 11:42 
AnswerRe: A WPF 'ah-ha' moment for you. Pin
Jammer29-Jan-09 23:22
Jammer29-Jan-09 23:22 
QuestionText Box Autocomplete Control Pin
boiDev27-Jan-09 3:00
boiDev27-Jan-09 3:00 
AnswerRe: Text Box Autocomplete Control Pin
User 27100927-Jan-09 16:31
User 27100927-Jan-09 16:31 
QuestionTabControl with DataGrid. Columns won't size correctly Pin
aalex67527-Jan-09 0:24
aalex67527-Jan-09 0:24 
AnswerRe: TabControl with DataGrid. Columns won't size correctly Pin
Mark Salsbery27-Jan-09 8:02
Mark Salsbery27-Jan-09 8:02 
GeneralRe: TabControl with DataGrid. Columns won't size correctly Pin
aalex67527-Jan-09 8:07
aalex67527-Jan-09 8:07 
GeneralRe: TabControl with DataGrid. Columns won't size correctly Pin
Mark Salsbery27-Jan-09 11:33
Mark Salsbery27-Jan-09 11:33 
I didn't dig into the DataGrid source code, but this workaround seems to work...

I added a SelectionChanged handler to the tab control:
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    System.Collections.IEnumerable olditemssource = datagrid2.ItemsSource;
    datagrid2.ItemsSource = null;
    datagrid2.ItemsSource = olditemssource;// new MyItemCollection_design();
}

Resetting the ItemsSource on the DataGrid is the only way (I could figure out) to get
the DataGrid to re-layout its columns correctly.

That's not really a good fix though, since if the user changes the column sort order,
it won't be preserved if the tab is navigated away from and back to.

They key point is to NOT set the ItemsSource until the DataGrid's associated tab is
navigated to for the first time. I'll leave that as an exercise for you Poke tongue | ;-P

I'm thinking this should probably be reported as a bug on the toolkit CodePlex site...

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: TabControl with DataGrid. Columns won't size correctly Pin
aalex67527-Jan-09 22:17
aalex67527-Jan-09 22:17 
GeneralRe: TabControl with DataGrid. Columns won't size correctly Pin
Mark Salsbery28-Jan-09 4:48
Mark Salsbery28-Jan-09 4:48 
QuestionChange label font at runtime Pin
Paolo Costa26-Jan-09 4:01
Paolo Costa26-Jan-09 4:01 
AnswerRe: Change label font at runtime Pin
Pete O'Hanlon26-Jan-09 4:08
mvePete O'Hanlon26-Jan-09 4:08 
AnswerRe: Change label font at runtime Pin
BlitzPackage26-Jan-09 5:25
BlitzPackage26-Jan-09 5:25 
GeneralRe: Change label font at runtime Pin
Pete O'Hanlon26-Jan-09 9:12
mvePete O'Hanlon26-Jan-09 9:12 
GeneralRe: Change label font at runtime Pin
BlitzPackage26-Jan-09 14:47
BlitzPackage26-Jan-09 14:47 
GeneralRe: Change label font at runtime Pin
Paolo Costa26-Jan-09 20:58
Paolo Costa26-Jan-09 20:58 
GeneralRe: Change label font at runtime Pin
Pete O'Hanlon26-Jan-09 22:23
mvePete O'Hanlon26-Jan-09 22:23 
GeneralRe: Change label font at runtime Pin
Paolo Costa30-Jan-09 1:10
Paolo Costa30-Jan-09 1:10 
GeneralRe: Change label font at runtime Pin
Pete O'Hanlon31-Jan-09 10:54
mvePete O'Hanlon31-Jan-09 10:54 
QuestionText Hotlinks in WPF Pin
BlitzPackage25-Jan-09 8:26
BlitzPackage25-Jan-09 8:26 
AnswerRe: Text Hotlinks in WPF Pin
Pete O'Hanlon25-Jan-09 8:57
mvePete O'Hanlon25-Jan-09 8:57 
GeneralRe: Text Hotlinks in WPF Pin
BlitzPackage25-Jan-09 13:55
BlitzPackage25-Jan-09 13:55 
GeneralRe: Text Hotlinks in WPF Pin
Pete O'Hanlon25-Jan-09 22:37
mvePete O'Hanlon25-Jan-09 22:37 
GeneralRe: Text Hotlinks in WPF Pin
Jammer25-Jan-09 23:19
Jammer25-Jan-09 23:19 
GeneralRe: Text Hotlinks in WPF Pin
BlitzPackage26-Jan-09 5:22
BlitzPackage26-Jan-09 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.