This is a migrated thread and some comments may be shown as answers.

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

14 Answers 752 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nazneen
Top achievements
Rank 1
Nazneen asked on 28 Jan 2016, 06:40 AM

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.

 

14 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 28 Jan 2016, 09:31 AM
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
0
Nazneen
Top achievements
Rank 1
answered on 29 Jan 2016, 12:58 PM

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.

0
Nasko
Telerik team
answered on 01 Feb 2016, 08:10 AM
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
0
Nazneen
Top achievements
Rank 1
answered on 02 Feb 2016, 04:15 AM

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 ??

0
Nasko
Telerik team
answered on 02 Feb 2016, 07:06 AM
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
0
Nazneen
Top achievements
Rank 1
answered on 02 Feb 2016, 07:18 AM

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>

   -

   -

   -

0
Nasko
Telerik team
answered on 02 Feb 2016, 09:48 AM
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
0
Nazneen
Top achievements
Rank 1
answered on 02 Feb 2016, 01:22 PM

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

0
Nasko
Telerik team
answered on 03 Feb 2016, 11:35 AM
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
0
Nazneen
Top achievements
Rank 1
answered on 09 Feb 2016, 10:30 AM

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.

 

 

0
Nasko
Telerik team
answered on 09 Feb 2016, 12:56 PM
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
0
Nazneen
Top achievements
Rank 1
answered on 24 Feb 2016, 08:35 PM

Hi Nasko,

 

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

0
Nazneen
Top achievements
Rank 1
answered on 24 Feb 2016, 08:47 PM

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

0
Nasko
Telerik team
answered on 25 Feb 2016, 09:36 AM
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
Tags
Docking
Asked by
Nazneen
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Nazneen
Top achievements
Rank 1
Share this question
or