I have a DockManager that adds ContentPanes through code. I need to be able to double click the header and edit it.
Any help would be appreciated, the other threads similar to my questions do not include solutions.
Thanks
Hello Sach Na,
After investigating for a way to edit a Tab header in the DockManager by double clicking on it and doing some research, this has been determined to be a product idea. You can suggest new product ideas for future versions by emailing ideas@infragistics.com.
Submitting your idea will send it directly to our product management team so that it can be imported into our new ideas community once live: http://ideas.infragistics.com.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. You can also link back to this thread for additional details.
Thank you in advance to submitting your product idea.
However, if you want to rename a Tab at runtime it is possible by doing something like this:
[Code]
<Style TargetType="igDock:ContentPane"> <Setter Property="TabHeaderTemplate"> <Setter.Value> <DataTemplate> <DockPanel x:Name="pnl"> <Button x:Name="closeBtn" DockPanel.Dock="Right" Visibility="Visible" Margin="3,3,0,3" Command="{x:Static igDock:ContentPaneCommands.Close}" CommandTarget="{Binding Path=Pane,RelativeSource={RelativeSource AncestorType={x:Type igDock:PaneTabItem}}}" Style="{DynamicResource {x:Static igDock:TabGroupPane.DocumentCloseButtonStyleKey}}" /> <TextBlock Text="{Binding}" /> </DockPanel> </DataTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="igDock:PaneTabItem"> <EventSetter Event="MouseDoubleClick" Handler="Pti_MouseDoubleClick"/> </Style>
private void Pti_MouseDoubleClick(object sender, MouseButtonEventArgs e) { PaneTabItem pti = sender as PaneTabItem; ContentPane pane = pti.Pane as ContentPane; pane.TabHeader = "SOMETHING!"; }
[/Code]
Please let me know if I may be of further assistance.
Sincerely,Sahaja KokkalagaddaAssociate Software Developer
Thank you for the reply. This is close to what i am looking for. How can i re template the Tab so when i double click, it turns the TextBlock into a TextBox that i can edit? And when i click enter or click away from the tab the name will change. Basically the user needs to be able to change the tab names to whatever they want.
Thank you!
Editing a Tab header by double clicking on it is a complex thing to implement. It is not a trivial thing to convert TextBlock on Tab to a editable TextBox. Like I mentioned earlier this will be a new feature request.
Please let me know if yo have any questions.