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

How to Hide Graph if No Data from Data Source?

4 Answers 703 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 08 Apr 2015, 08:20 PM
I have a graph that has a sql data source defined, but I want to be able to hide the graph if there is no data being returned from the data source.  I tried to bind the Visible property, but the Fields list is empty even though I have the data source defined and it is working fine when there is data.  I thought I would be able to do Visible = Count(Fields.PatName) > 0 since PatName is a field being returned by the SQL data source.

4 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 09 Apr 2015, 02:08 PM
Hello Jonathan,

You will need to set the ​NoDataMessage Property first and then set NoDataStyle.VisibleFalse to hide the message and effectively hide the whole graph.

More information on the topic is available in the How to: Set a No Data Message help article.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Jonathan
Top achievements
Rank 1
answered on 09 Apr 2015, 03:17 PM
Thanks, that was exactly what I was looking for.
0
Jonathan
Top achievements
Rank 1
answered on 09 Apr 2015, 04:45 PM
Another question: I still get a bunch of blank pages even though the elements are hidden.  Is there a way that I can set the detail section height to 0 if the table within it has no data and is hidden?
0
Stef
Telerik team
answered on 10 Apr 2015, 12:36 PM
Hello Jonathan,

Please test shrinking the container item or section with the settings from the Collapse the container when hiding child report items KB article. Does not set the any dimension to 0 unit, it is better to use a conditional formatting rule or binding to hide the item/section.

Once hidden, the rest items.sections will be positioned based on the Design Considerations for Report Item Layout.


I hope this helps you.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jonathan
Top achievements
Rank 1
Stef
Telerik team
Share this question
or