We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Unable to use Icon Only

Hi.  We LOVE these controls.  Issue I am having is two.
1.  With ShowIcon="True"  I get an object reference not set to an instance of an object error.
2.  If I don't have at least a space Header=" " for SfTabItem, I get a fatal crash.

How can I show ONLY the Icon?  

<navigation:SfTabControl ShowIcon="True" x:Name="TabControl" SelectedIndex="0"
                             DisplayMemberPath="Name"
                             TabScrollButtonVisibility="Collapsed"
                             TabStripPlacement="Left">

                <navigation:SfTabItem x:Name="SkyPlotTab"
                              Header=" "
                              VerticalAlignment="Center" 
                               x:FieldModifier="public">
                    <navigation:SfTabItem.Icon>
                        <Image Source="\Assetsav_icons\SatelliteOn512.fw.png" Width="25" Height="25"></Image>
                    </navigation:SfTabItem.Icon>


8 Replies

MS Marimuthu Sivalingam Syncfusion Team September 18, 2017 12:12 PM UTC

Hi Damon,

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Regards,
Marimuthu S.


DA damon September 18, 2017 01:54 PM UTC

My biggest issue is that I need to only show the ICON. I got past having to have at least one letter in HEADER, but, that now shows 'Untitled'.  
I really need to only show an ICON for the header, No Text.



SM Subashini Mahendran Syncfusion Team September 19, 2017 11:11 AM UTC

Hi Damon,

We have checked your query "Need to show only an ICON for the header, not Text in SfTabControl". In SfTabControl, Default value of Header is "Untitled". So, it will show Untitled as Header if we are not setting Header for SfTabItem. We can achieve your requirement by setting Header value as "Empty" or "Null" for SfTabItem to show only icon. We have also prepared the sample based on your requirement. Please download the sample for the same from the below link.

Sample: SfTabControl_Sample

But we are facing some issue like displaying the Content value as Header when setting Header as "Empty" or "Null" and Content for SfTabItem. Could you please confirm us whether this one is your reported issue. If not please update us the screenshot of your issue or issue reproducible sample with Syncfusion Version. This would help us to proceed further.

Regards,
Subashini M.


DA damon September 19, 2017 04:49 PM UTC

This is interesting.  Using your example I still get the "Object Reference not set to an instance of an object: for the 'Show Icon = 'true' :

When I run your example it works.
When I try to use the null it throws an exception and crashes the program.

So, not sure what is happening.  



DA damon September 19, 2017 05:35 PM UTC

I was able to finally get it to work with the following:

<navigation:SfTabControl x:Name="TabControl" SelectedIndex="0"

                             ShowIcon="True" 

                             TabScrollButtonVisibility="Collapsed"

                             TabStripPlacement="Left">


                <navigation:SfTabItem x:Name="SkyPlotTab"

                              VerticalAlignment="Center" 

                              Header=" " x:FieldModifier="public">

                    <navigation:SfTabItem.Icon>

                        <Image Source="Assets\NavIcons\SatelliteOn512.fw.png" Height="25" Width="25"></Image>

                    </navigation:SfTabItem.Icon>

If I used Header="{x:Null}" it crashed.  while instead, using a space it works.

Also I had to remove Displaymember.




SM Subashini Mahendran Syncfusion Team September 20, 2017 12:21 PM UTC

Hi Damon,

Query 1 : Using your example I still get the "Object Reference not set to an instance of an object error" when I set Show Icon = "True".

As promised earlier we will provide you the patch on incident which created to follow up this issue.

Query 2: I used Header="{x:Null}" it crashed.

We have checked the reported crash with our side but we are unable to reproduce the reported crash from our end. This reported crash may reproduced based on Windows SDK Version used in application. So, could you please share us the following information. It would be more helpful to proceed further.
1. Windows SDK Version.
2. Essential Studio Version.
3. OS Version.

Regards,
Subashini M.


DA damon September 20, 2017 12:46 PM UTC

Windows SDK Version.    --  .NET Framework 4.7.02046

Essential Studio Version.  I am using Visual Studios Enterprise: 15.3.3

OS Version.     Windows 10 Pro: 10.0.15063 Build 15063

SyncFusion COntrols for UWP XAML: 15.3.0.26

Target Version for Application is: Windows 10 Creators Update (10.0; Build 15063)

Being Deployed to Windows 10 IoT Platform. 


SM Subashini Mahendran Syncfusion Team September 22, 2017 11:34 AM UTC

Hi Damon,  

We have checked the reported issue "Application Crashed while setting Header value as "Null" for SfTabItem. We have tried in different machines which contains same SDK, OS Version and Essential Studio Version which you have used, but we were unable to reproduce the reported crash. We have also deployed to Windows IoT platform, but we were unable to reproduce issue. Can you please update us the last updated sample run without crash while setting Null header. If yes please check by change the Target Version of your Application. We suspect that the crash raised based on the Target Version of our Application.  

Please log on to our support website to check for further updates regarding the “Object Reference not set to an instance of an object error" Query on incident which created to follow up this issue.  

Regards,
Subashini M. 


Loader.
Live Chat Icon For mobile
Up arrow icon