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.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I was evaluating your PropertyGrid and face one problem according to my requirement. The problem is when I navigate with in properties via keyboard I want to make property editable each time, however, this is possible through Mouse Click. Is there any setting to do or I have to write code for the same. Please make aware to me as soon as possible. Thanks... Raghuraj
|
|
|
Hello Raghuraj, I am not sure what your issue is -- properties are always editable whether the user reaches the editor via the mouse or via the keyboard. Note that to support keyboard navigation within an editor you will need to set the KeyboardNavigation.TabNavigation attached property on the DataTemplate root element to Local as per Could you say more specifically what is the behaviour you are looking for? Thanks! |
|
|
Hello, You are right that, properties are always editable but until and unless user press the arrow key (left or right). However, I want that, As I press any character, or numeric, or special key in selected property it should become editable. Hope, I expain my problem to the point. Thanks. |
|
|
Ah, I think I see what you mean. This appears to be a slight bug whereby a container element is getting keyboard focus instead of the editor. I have fixed it and the fix will be in nightly builds numbered 20080913 and above, available from http://www.mindscape.co.nz/products/wpfpropertygrid/nightlybuilds.aspx after about 1800 GMT. Let me know if this addresses your problem. |
|
|
Hello Ivan, I have gone through the Nightly Build, however it not satisfying my requirements. I want the property grid working as similar to the Visual Studio Property page. That is, user should be able to edit property value by pressing F2 key, user can cancel the entry by ESC key, navigation through Tab key with in property name and its value. It also has a BUG of navigation, i.e., By navigating to the properties via up down arrow key or by mouse click, the property which is being edit, do not have the selection.I have also attached the JPG file of bug sample. Hope you got the problem. Please update me for the same. -- Regards Raghuraj
|
|
|
The Windows Forms property grid does not require the user to press F2 to edit, so I am not sure what your concern is here. However if you require special handling of F2 then you can do this by creating a custom editor and handling a suitable event such as KeyDown or PreviewKeyDown. Unfortunately we do not have built-in support for using ESC to abort an edit. Again this could probably be achieved using a custom editor (if you are using WPF 3.5 SP1 you could also check out BindingGroup). We don't currently have support for tabbing between the property name and the value editor. I have logged this as a feature request. Note that you *can* use the right arrow key to navigate from the property name to the value editor. I have been unable to reproduce the selection bug you report -- when I click into a property editor, or cursor up and down, the selection highlight on the left remains in sync with the focus on the right. Could you provide us with a small project and step-by-step instructions on how to reproduce the problem? Thanks! |
|
|
I think this bug may still be in place, I cannot edit simple text boxes unless I hit the right or left key. I am evaluating and keyboard navigation is very important in our implementation. I want to be able to tab through the editable controls on the grid which I can't currently do (it is tabbing out of the Property Grid to the next control on my form) and when I've tabbed to an editable control I want to be able to begin typing immediately if it's a textbox or have the drop down appear immediately if its a combo box etc. Using the "GridStyles" sample I can't do these things now. Maybe I'm doing something wrong. Please feel free to contact me if you need any clarification!
Thanks, Sean |
|
|
Hi Sean, At the moment I think you will need to retemplate the grid to do this. Here is a simple example that works for me and will hopefully get you started if you need something richer. In the Resources section: <!-- subproperty expander omitted for brevity --> <Border Padding="1.5" BorderThickness="0" Margin="-6,0,0,-1"> <TextBlock Text="{Binding Node.HumanName, Mode=OneTime}" /> </Border> </DataTemplate> <Style x:Key="TabFriendly" TargetType="{x:Type ms:TreeListViewItem}"> <Setter Property="KeyboardNavigation.TabNavigation" Value="Continue" /> </Style> <Style x:Key="TabbyGrid" TargetType="{x:Type ms:PropertyGrid}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ms:PropertyGrid}"> <Border Background="Transparent"> <!-- Toolbar and grouping omitted for brevity --> <ms:TreeListView Name="PART_Grid" ItemsSource="{TemplateBinding BindingView}" BorderThickness="0" KeyboardNavigation.TabNavigation="Contained" ItemContainerStyle="{StaticResource TabFriendly}"> <ms:TreeListView.Columns> <GridViewColumnCollection> <GridViewColumn CellTemplate="{StaticResource PropertyNameCellTemplate}" /> <GridViewColumn CellTemplateSelector="{Binding EditorSelector, RelativeSource={RelativeSource AncestorType={x:Type ms:PropertyGrid}}}" /> </GridViewColumnCollection> </ms:TreeListView.Columns> </ms:TreeListView> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> Then in the main window: <ms:PropertyGrid Style="{StaticResource TabbyGrid}" /> With this template, I find that pressing the tab key moves me in order through the editors, then out to other controls once it hits the bottom of the grid. Please let me know if it doesn't work for you. (I have noticed that when coming *into* the grid it takes a couple of tabs to reach the first editor. If this is an important issue for you then let us know and we will investigate further.) As noted, I have left some stuff out in order to avoid cluttering the example. If you need grouping or subproperties then you may need to experiment a bit to keep the tab navigation behaving itself (grouping would be my main worry here). Do let us know if you need any advice or assistance with this (you can get starter templates from Source / Styles, or we can help you with the default templates). |
|
|
Thanks for your help, I was able to use your suggestions to markup "Blue.xaml" and get the navigation to work the way I need it. I was getting a second "Tab Stop" around my textbox until I figured out what was grabbing tab focus, in Blue.xaml there is a content control under the ms:TreeListView that I had to set the IsTabStop="False" on and it is working. I'm not sure if there is a way to do attachments on this forum but I'd be glad to share my Blue.xaml that also does tabbing with everyone.
Sean |
|
|
Hello Sean, You can attach files to forum messages via the Options tab (yeah, it took me a while to find it too *grin*). We really appreciate your generosity in sharing your work! |
|
|
Thanks Sean, you saved me hours of work! |
|
|
Another thanks to Shawn. Although, it would be nice if the keyboard focus didn't get lost momentarily before finally settling on the first editor. I suspect if I look hard enough I can probably find something else to mark with IsTabStop=false Are these changes likely to get incorporated into the released themes? I was actually surprised they weren't considering the bulk of this post occurred quite a while ago. Also, I thought I would mention another little thing. In case someone wishes to set the initial focus of a window to the property grid by doing FocusManager.FocusedElement={Binding ElementName=PropertyGrid} that won't work. However, there is a trick that can be found here: http://www.julmar.com/blog/mark/PermaLink,guid,03722678-882a-4bb4-928f-4fe0d35f051e.aspx I hope it's ok to put a link to someone's blog here. |
|