Frustrating issue in ListBox styling

Jan 11, 2016 at 3:01 AM
Edited Jan 11, 2016 at 3:02 AM
Hey guys,

I watched the training video on restyling the listbox to behave like a grid and checked out the
ColumnListbox.xaml example in the Testbench application. I made a copy of that view and was testing how to add a column with a combobox.

I got that working no problem, but the iisue I am having is as soon as I select an item from the combobox, the grid contents scroll left a few pixels every time I do a selection. If the scroll bar is visible, I can slide everything back into position...

if I hard code the column widths, it doesn't happen. But that's not a viable solution since the columns won't resize correctly when form size changes and I'd like to use "*" so it takes up available space...

Any ideas on how to prevent this scrolling, which seems to be caused by the columns growing in size??

Jan 11, 2016 at 2:49 PM
I was able to fix this....

For the combobox, I added:

and in the codebehind
 private void OnRequestBringIntoView(object sender,RequestBringIntoViewEventArgs e)
            e.Handled = true;
And this prevented the unwanted scrolling... pretty weird solution, but it works.