Selectively hiding detail row if field is blank

6 posts, 0 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    Dec 2008

    Posted 19 Feb 2010 Link to this post

    I'm using the Q3 2009 version.

    I want to selectively hide the detail row in the report when the data source row contains a blank value.

    I have tried using the ItemDataBinding event for the detail item, but I am unable to get access to the row in the data table that is being bound to the detail item.

    When I look at the ItemtDataBinding event in the debugger I can see the field I need but its contained the ReportItemBase object.

    In the debugger, I can see that the sender is an object {Telerik.Reporting.Processing.DetailSection}.

    Which inherits from Telerik.Reporting.Processing.ReportSection {Telerik.Reporting.Processing.DetailSection}.

    Which inherits from Telerik.Reporting.Processing.ReportSectionBase {Telerik.Reporting.Processing.DetailSection}

    Which inherits from Telerik.Reporting.Processing.ReportItemBase {Telerik.Reporting.Processing.DetailSection}.

    The ReportItemBase contains the Telerik.Reporting.Processing.IDataObject {Telerik.Reporting.Processing.Data.DataMember} which contains a RawData member which contains the row being bound to the detail item.

    I can see that the RawData is a strongly typed row of the data table in my data set.

    I thought once I get access to the data row I could check the field for a blank value and hide the detail item by setting the Visible property to false if the field contains a blank.

    So, how do I get access to the RawData member of the ReportItemBase object in the ItemDataBinding event?

    Thanks for any help on this.

    Mark



          
  2. Steve
    Admin
    Steve avatar
    10940 posts

    Posted 22 Feb 2010 Link to this post

    Hi Mark,

    You can see the answer to your question in the Access items from report, calling application and Table help article.
    Another possible solution is to handle this through the Conditional Formatting dialog - the Layout pane contains Visible checkbox which when unchecked would hide the item/section if the condition is met.

    All the best,
    Steve
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 16 Feb 2015 in reply to Steve Link to this post

    Hi, the feature - conditional formating works well, I can display/hide a row in my Table.
    However, the made invisible by conditional formating row does not collapse. The row has defined row-high. So, the place for the hidden row remains as a blank in my Table. Do you know a trick, how to make the invisible rows collapsed?
    In the table, I have not regular rows with same data kind, but each rows shows different data, so I can't filter out the unwished rows at the DataSource level.
    Jola
  4. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 17 Feb 2015 Link to this post

    Hello Jola,

    When trying to hide rows in the Table item based on a field value it is recommended to use Filtering instead of Conditional Formatting. The filtered rows will be hidden and there won't be any blank rows in your table. For more information on how to implement the solution, please refer to the Filtering help article and the How to: Add filtering to Table item and Crosstab item help article.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 19 Feb 2015 in reply to Nasko Link to this post

    Hi Nesco,
    you always try to work-around my problems, perhaps that I ask for not-possible things in telerik...:-)
    If I could filter out the row, this post were not here...
    I have not a regular table, but a kind of table-skeleton, where I put several data. And one row is conditional, (if value of one cell of this row is blank and zero, it should disappear). The conditional formatting works - with feature - visible=false, but the row does not collapse...
    If in the row-style - the row height were present, I could collapse it by myself:-)
    Jola
  6. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 23 Feb 2015 Link to this post

    Hello Jola,

    The Conditional Formatting styles are being applied to the TextBox items in the table cells. It is important to make a distinction between the TextBox items in a single row and the table row itself.
    When you select the table row and hide the TextBox items via conditional formatting, the row itself will still be visible even after the items in it are hidden. Since the row height is not available for modification via conditional formatting styles, it is not suitable to use conditional formatting for hiding table rows.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top