views:

2671

answers:

4

hi there,

i wonder how i can prevent a user from resizing GridViewColumns withing a WPF ListView control as google doesn't came up wit a solution.

probably one of the wpf guru's over here ;)

+2  A: 

i found a solution and probably it will help someone else someday ;)

you have to override the GridViewColumnHeader's ControlTemplate (default template is here ) and remove the PART_HeaderGripper from the template in order to prevent resizing of your columns.

there is another solution that comes up with subclassing GridViewColumn described here. for representation purposes i prefer xaml only solutions though

Joachim Kerschbaumer
A: 

thans for this beautiful answer. but 1 thing i want to know. if i want that user can resize the column but upto a certain limit. then what can i do? please help me. thanks..

Varun Jain
normally you´ll find a MaxWidth property there that can be set to your desired value
Joachim Kerschbaumer
A: 

Hi! Someone know how I can resize a Grid column size at runtime? Thanks in advance for your help!

John Ortiz
A: 

I was able to do something similar with the instructions in this post

http://blogs.msdn.com/b/atc_avalon_team/archive/2006/04/11/573037.aspx

I wasn't able to use a full XAML solution, since I was building everything in my code behind due to the dynamics of it. Worked great on the first try.

jmlumpkin