A
Alex
In the course of writing my application, I have come across several issues that seem to be Microsoft bugs.
Following is a summary and possible workarounds.
Jeffrey Tan, if you are reading this, please verify.
Also, I'd like to know how to request fixes for these issues.
1) Sometimes the designer decides to spontaneously rearrange the tabs in a TabControl.
Status: Verified "known issue" - "Tab control TabPage order is randomized"
Workaround #1, suggested by Herfried K. Wagner
Make sure you have always the first tab selected when recompiling
Workaround #2: Delete and recreate the tabs after the call to InitializeComponent()
// Sample
pages = new TabPage[] { pageOne, pageTwo, pageThree, pageFour, pageFive };
myTabControl.Controls.Clear();
myTabControl.Controls.AddRange(pages);
2) BeginUpdate/EndUpdate does not work correctly when adding a single item to a sorted ListBox
Status: Verified "known issue"
Workaround #1: Check the number of items to update and only perform BeginUpdate/EndUpdate if >1.
if (items.Count > 1)
myList.BeginUpdate();
myList.Items.AddRange(items);
if (items.Count > 1)
myList.EndUpdate();
Workaround #2: Toggle the Sorted property.
// Sample
myList.BeginUpdate();
bool bug_workaround = myList.Sorted;
myList.Sorted = false;
myList.Items.AddRange(items);
myList.Sorted = bug_workaround;
myList.EndUpdate();
3) A DataGrid leaves text on the screen after deleting a row containing a selected (highlighted) cell.
Happens when the columns are set to read-only, mostly visible when deleting the last row.
Status: Verified "known issue"
Workaround: Set the read-only property of the whole DataGrid to true and the read-only properties
of the individual DataGridTextBoxColumn items to false.
Don't know about cases when only some columns need to be read-only.
4) A DataGrid on a TabPage loses the data binding if the is deleted from the TabControl.
Since the only way to hide tab pages is to remove them, it is relevant.
Status: Happens on my machine...
Workaround: un-bind and re-bind the DataGrid when removing & re-adding the tab page.
Those are the bugs that I encountered.
If you know of more, please post.
Following is a summary and possible workarounds.
Jeffrey Tan, if you are reading this, please verify.
Also, I'd like to know how to request fixes for these issues.
1) Sometimes the designer decides to spontaneously rearrange the tabs in a TabControl.
Status: Verified "known issue" - "Tab control TabPage order is randomized"
Workaround #1, suggested by Herfried K. Wagner
Make sure you have always the first tab selected when recompiling
Workaround #2: Delete and recreate the tabs after the call to InitializeComponent()
// Sample
pages = new TabPage[] { pageOne, pageTwo, pageThree, pageFour, pageFive };
myTabControl.Controls.Clear();
myTabControl.Controls.AddRange(pages);
2) BeginUpdate/EndUpdate does not work correctly when adding a single item to a sorted ListBox
Status: Verified "known issue"
Workaround #1: Check the number of items to update and only perform BeginUpdate/EndUpdate if >1.
if (items.Count > 1)
myList.BeginUpdate();
myList.Items.AddRange(items);
if (items.Count > 1)
myList.EndUpdate();
Workaround #2: Toggle the Sorted property.
// Sample
myList.BeginUpdate();
bool bug_workaround = myList.Sorted;
myList.Sorted = false;
myList.Items.AddRange(items);
myList.Sorted = bug_workaround;
myList.EndUpdate();
3) A DataGrid leaves text on the screen after deleting a row containing a selected (highlighted) cell.
Happens when the columns are set to read-only, mostly visible when deleting the last row.
Status: Verified "known issue"
Workaround: Set the read-only property of the whole DataGrid to true and the read-only properties
of the individual DataGridTextBoxColumn items to false.
Don't know about cases when only some columns need to be read-only.
4) A DataGrid on a TabPage loses the data binding if the is deleted from the TabControl.
Since the only way to hide tab pages is to remove them, it is relevant.
Status: Happens on my machine...
Workaround: un-bind and re-bind the DataGrid when removing & re-adding the tab page.
Those are the bugs that I encountered.
If you know of more, please post.