This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product. Otherwise - post away!
I'm trying to use a DataGrid to replace a few listboxes. The listboxes are currently displayed in tab panels. To stretch the list boxes I use this:
If I try to set the height and width in the same way for a DataGrid I get an error saying the Width cannot be negative.
Looking at the sample app I can see the DataGrid is resizing but I'm blowed if I can figure out how this is done.
Any clues would be gratefully accepted!
Doh, dont worry, figured it out. I use Height and Width not ActualHeight and ActualWidth.
I don't think you should be adding the DataGrid or PropertyGrid to a TabPanel. Are you meaning to add them to a TabControl instead? By putting a control into a TabItem of a TabControl, it will stretch to fill the available space by default (No need to set the width and height using bindings).
If this does not solve your problem, please send some more information about the layout you are trying to achieve. Some xaml code or/and screen shots will help.