Underscore not displyed in Tab Name which are dynamically launching on Mouse Double click

15 posts, 0 answers
  1. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 28 Jan Link to this post

    Hi,

    As "_" is used as access key i am not able to see underscore in tab name.

    In my application at few places i have used <TextBlock> instead of <telerik> and that worked at where  i have to display Label in GUI window.

    Now in application i have places where tabs are launching whenever mouse double click event is triggered.

    I have test.xaml.cs in which event handler is written for mouse double click and test.xaml file from which input is given to this event handler.Also in event handler  after mapping properties like Name , header , Tag etc. of RadPane ; it is serialized to RadDocking like :

    testContent.SetValue(RadDocking.SerializationTagProperty,  tabname.TabInputVal);
    testContent.Content = new Home(tabname.TabInputVal);
    MainWindow.MainWindowGlobal.MainWindow.radPaneGroupMenu.AddItem(testContent, DockPosition.Center);

     

    I don't wnna use logic of using double underscore in code. Please let me know what are the other ways which i can use to display underscore in Tab Name!!

    Thank you in advance.

     

  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 28 Jan Link to this post

    Hi Nazneen,

    Indeed the observed by you appearance is an expected one and it is caused by the Framework itself. The first underscore is always consider  as an access key for referencing with the Alt.

    So, what we could suggest you for your scenario is to create a DataTemplate with a TextBlock (by design does not have a concept for an access key as you noticed)  placed inside it and set that DataTemplate to the HeaderTemplate property of RadPane:
    <DataTemplate x:Key="PaneHeader">
        <TextBlock Text="{Binding}" Foreground="Red"/>
    </DataTemplate>

    Hope this helps.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 29 Jan in reply to Nasko Link to this post

    Hi Nasko,

    I think I can't write <DataTemplate> anywhere in xaml file; as my tabs are launching dynamically. Whatever you have written as a solution for me, i tried in xaml.cs as below:

     

                          var newTextBlock = new FrameworkElementFactory(typeof(TextBlock));
                          newTextBlock.Text =tabname.TabInputVal;
                        
                          DataTemplate newdatatemplate = new DataTemplate() { VisualTree = newTextBlock };
                          testContent.Header = newTextBlock.Text;.

                        .----

                        .---

                        .---

                         testContent.SetValue(RadDocking.SerializationTagProperty,  tabname.TabInputVal);
                         testContent.Content = new Home(tabname.TabInputValId);
                         MainWindow.MainWindowGlobal.MainWindow.radPaneGroupMenu.AddItem(testContent, DockPosition.Center);

     

    But still i am not able to see underscore in tab name! Please let me know if there is any other approach.

    Thanks.

  5. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 01 Feb Link to this post

    Hi Nazneen,

    You could easily place the needed DataTemplate inside the Resources of the xaml file and set that DataTemplate to the desired RadPane - please, check the attached video that demonstrates how this approach works on our side.

    Attached you could find also a sample that demonstrates that (the sample uses the VisualStudio2013 theme as it has an AccessText inside the Header of the Pane by design) - if the approach does not work for you, could you please try to modify it in order to reproduce your exact scenario and we will think of another approach that should be suitable for you?

    We hope this will help you.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 01 Feb in reply to Nasko Link to this post

    Hi Nasko,

     Thanks for respons. I easily understood in video what you have done to put DataTemplate inside the Resources of the xaml file.I

     

    I added similar solution in my application, but it didn't work. What else we can do ??

  7. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 02 Feb Link to this post

    Hi Nazneen,

    Could you please try to modify the attached project in order to reproduce your exact scenario and send it back to us? Thus we could be able to reproduce the observed by you behavior on our side and think of another possible solution for you?

    Also, please provide us information if you are using a theme to style your application. Which exact theme are you using? The only other approach we are currently thinking of is to modify the default Style of the Panes but for that purpose we need to know the exact theme you are currently using.

    We are looking forward to hearing from you.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 02 Feb in reply to Nazneen Link to this post

    Hi,

    I found this

    http://feedback.telerik.com/Project/143/Feedback/Details/65556-underscore-showing-access-key-of-contentpresenter-is-not-shown-if-the-presenter-i

     Here they have mentioned :this framework issue is logged in Microsoft's official feedback portal (in 2014)

    Please let me know if you have any idea about this.

     

    In my application , i have used Documenthost in MainWindow.xaml . This is the area where my tabs are getting launched through radpane group.

      -

      -

      -

    <Grid Grid.Row="1"
                      Grid.Column="0"
                      Grid.ColumnSpan="2">
                        <telerik:RadDocking x:Name="radDockingUserControls"
                                       PreviewClose="radDockingUserControls_PreviewClose"
                                       CloseButtonPosition="InPane">
                               <telerik:RadDocking.DocumentHost>
                                <telerik:RadSplitContainer InitialPosition="DockedLeft">
                                    <telerik:RadPaneGroup x:Name="radPaneGroupMenu"></telerik:RadPaneGroup>
                                </telerik:RadSplitContainer>
                            </telerik:RadDocking.DocumentHost>
                        </telerik:RadDocking>
                    </Grid>
                </Grid>
            </Grid>

       -

       -

       -

  9. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 02 Feb Link to this post

    Hi Nazneen,

    The issue you found in our Feedback portal is not related to the underscore in the Tab names. It is for the content of the Panes placed inside the DocumentHost - please, check the attached video that demonstrates how the names of the Tabs are displayed on our side when are placed inside DocumentHost.

    Without a sample project that demonstrates your exact scenario we could not tell for sure what might the reason for the appearance of the tabs you are currently observing so, please try to modify the sample in my previous response in order to demonstrate your exact scenario and send it back to us - thus we could be able to provide you with a prompt solution.

    We are looking forward to hearing from you.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  10. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 02 Feb in reply to Nasko Link to this post

    Hi,

    Thanks.

    I am currently using Windows 8 theme in my application.

    Also i have noticed , if i remove Windows 8 theme from my application, it displays underscore every where correctly.

    Now i removed it and applied VisualStudio2013 Theme, by placing

    <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Style/MyAppResource.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>       
                </ResourceDictionary.MergedDictionaries>

    and using required dll(correct me if i am wrong).

     Yeah soon I will send you one sample application with visualstudio2013 theme :) so that we can figure it out issue easily.

     

    Thanks,

    Nazneen

  11. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 03 Feb Link to this post

    Hello Nazneen,

    Some of our themes like the Windows8 or the VisualStudio2013 have inside the Styles of RadDocking implemented logic for the access keys. Because of that as mentioned in my previous response the only other approach that we could suggest you is to modify the default style of the Panes and remove that logic.

    Please, check the attached sample that demonstrates how that modifications of the Style works on our side - the project uses Implicit Styles. It will be really great if you send us a sample project with your scenario in order to propose you the most appropriate approach. So, as soon as you are able to create one, please send it to us.

    Meanwhile, if you have any additional questions or concerns regarding Telerik controls, please do not hesitate to contact us.

    We hope this will help you.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  12. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 09 Feb in reply to Nasko Link to this post

    Hi Nasko :)

    Thanks

    The suggested solution of using DataTemplate inside the Resources of the xaml file and to pass that DataTemplate to the desired RadPane worked correctly for me! Now in my application Tabs Header are getting launched with specified underscore.

    I have doubt regarding Telerik Label Control. I am using Windows 8 theme, at few places i have used <TextBlock> instead of Telerik Label and static texts are getting displayed with underscore. Like this:

    -----------------------------------------------------------------------------------

     <UserControl.Resources>

    -

    -

    -

    <telerik:Label Name="labelName"
                         HorizontalAlignment="Left"
                         Grid.Column="1"
                         Grid.Row="0" />

    -

    -

    -

     </UserControl.Resources>

    --------------------------------------------------------------------

     <UserControl.Resources>

    -

    -

    -

    -
            <TextBlock Name="labelName"
                       HorizontalAlignment="Left"
                       Grid.Column="1"    Grid.Row="0"  />
    -

    -

    -

        </UserControl.Resources>            

     

    ---------------------------------------------------------------------

    Please let me know if you know any other way instead of using 'TextBlock'. I looked  for using  'RecognizeAccessKey =False' Property, but it only works with 'Content' .

     

    Thanks in Advance.

     

     

  13. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 09 Feb Link to this post

    Hi Nazneen,

    I am glad to hear the proposed approaches worked for you. As for the question concerning the TextBlock and the Label. As stated in one of my previous responses by design the TextBlock does not have a concept for an access key and because of that everything is displayed as expected. On the other side the Label has such concept and in order to change it you need to modify the default Template of the control. By setting the RecognizesAccessKey property of the ContentPresenter placed inside its Template to false the underscore should be visualized as expected.

    Please, check the attached sample that demonstrates that.

    We hope this will help you.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  14. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 24 Feb in reply to Nasko Link to this post

    Hi Nasko,

     

    Thanks a lot. I am able to fix this issue in my application 

  15. Nazneen
    Nazneen avatar
    8 posts
    Member since:
    Jan 2016

    Posted 24 Feb in reply to Nazneen Link to this post

    I have one more doubt in case of Content as:

    1)If I have following line , and here TempArrayName is getting displayed without "_".

    using this simple line , how I can allow underscore in Content control.(written in TempDetails.xaml.cs)

    TempTitle.Content = Properties.Resources.GridTempText + TempArrayName;

     

    2)Another case is related to RadChart like this, here TempArrayName should allow to display "_" (written in  TempArrayDetails.xaml.cs)

    RadChart radChart = new RadChart();
    radChart.DefaultView.ChartTitle.Content = TempArrayName;

    Please let me know how I can resolve this.

    Thanks

  16. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 25 Feb Link to this post

    Hi Nazneen,

    Both your scenarios depend on the content inside which the text gets presented. For this scenario of yours we suggest you the content for both your "TempTitle" and RadChartView to be presented inside ContentPresenters (or use controls that use ContentPresenters in their Templates for visualizing data) and using the RecognizesAccessKey (explained in my previous response) to control the underscore visualization - if you set to the presenter the RecognizesAccessKey to be False the underscore will be visualized on the other hand if you set it to True it won't be. RecognizesAccessKey is a dependency property so, you could bind it to a property in your code behind and control it from there without any concerns - based on your logic you could set to true or false.

    If you send us a sample project that demonstrates your exact scenario we will try to modify it in order to demonstrate the described above approach.

    I hope this will help you.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready