Tabbing within a WPF Property Grid editor
Tagged as WPF Property GridHere’s a quick tip if you’re creating editors for the WPF Property Grid that contain more than one control. If you want to support tab key navigation between the controls, add the KeyboardNavigation.TabNavigation attached property to the container of the controls, and set it to Local. For example:
<DataTemplate x:Key="PhoneNumberEditor"> <StackPanel Orientation="Horizontal" KeyboardNavigation.TabNavigation="Local"> <TextBlock>+</TextBlock> <ms:TextBox Text="{Binding Path=CountryCode, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0" MinWidth="10" /> <TextBlock> (</TextBlock> <ms:TextBox Text="{Binding Path=RegionCode, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0" MinWidth="10" /> <TextBlock>) </TextBlock> <ms:TextBox Text="{Binding Path=Number, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0" MinWidth="10" /> </StackPanel> </DataTemplate>
Notice the additional attribute on the StackPanel element.
Leave a Reply
Categories
Beta (4)
BrainDump (1)
Community Code (4)
Events (16)
F# (14)
General (53)
Lab Samples (2)
LightSpeed (268)
MegaPack (8)
News (71)
NHibernate Designer (26)
Nightly news (52)
Phone Elements (24)
Products (87)
Projects (5)
Screencast (6)
SharePoint (3)
Silverlight (14)
Silverlight Elements (66)
SimpleDB Management Tools (20)
Visual Studio (9)
VS File Explorer (7)
Web Workbench (39)
WPF (44)
WPF Diagrams (57)
WPF Elements (110)
WPF Property Grid (32)
BrainDump (1)
Community Code (4)
Events (16)
F# (14)
General (53)
Lab Samples (2)
LightSpeed (268)
MegaPack (8)
News (71)
NHibernate Designer (26)
Nightly news (52)
Phone Elements (24)
Products (87)
Projects (5)
Screencast (6)
SharePoint (3)
Silverlight (14)
Silverlight Elements (66)
SimpleDB Management Tools (20)
Visual Studio (9)
VS File Explorer (7)
Web Workbench (39)
WPF (44)
WPF Diagrams (57)
WPF Elements (110)
WPF Property Grid (32)



Posted by Ivan Towlson on 2 July 2008 


