Shrink DataBand row height dynamically
Hi, Here is my scenario.
I've a DataBand in my report binded to List of object A in my DataSource.
There are two text objects inside the DataBand (TextA and TextB).
Now according to a boolean property (IsValid) in object A, I want to hide one of the text box and adjust the height of the each DataBand row.
For example
if(IsValid == true), display both text objects, so the row looks like this
Text A
Text B
if(IsValid == false), row should like this
Text B
So far I've set the
But this only results in report looking like this
(Valid row)
Text A
Text B
(Invalid row)
[Blank white space here ]
Text B
(InValid row)
[Blank white space here ]
Text B
Whereas I want it to look like this
(Valid row)
Text A
Text B
(Invalid row)
Text B
(Invalid row)
Text B
Hope the question is clear .. Thanks
I've a DataBand in my report binded to List of object A in my DataSource.
There are two text objects inside the DataBand (TextA and TextB).
Now according to a boolean property (IsValid) in object A, I want to hide one of the text box and adjust the height of the each DataBand row.
For example
if(IsValid == true), display both text objects, so the row looks like this
Text A
Text B
if(IsValid == false), row should like this
Text B
So far I've set the
CanShrink
property of DataBand to true and wrote a script on code page
private void Data1_BeforeLayout(object sender, EventArgs e)
    {
     Â
      if(((Boolean)Report.GetColumnValue("Root.ObjectA.IsValid")) == false)
      {
        TextA.Visible = false;
        TextB.Visible = true;
      }
      else
      {
        TextA.Visible = true;
        TextB.Visible = true;       Â
      }                                   Â
    }
and hooked it to DataBand's BeforeLayout EventBut this only results in report looking like this
(Valid row)
Text A
Text B
(Invalid row)
[Blank white space here ]
Text B
(InValid row)
[Blank white space here ]
Text B
Whereas I want it to look like this
(Valid row)
Text A
Text B
(Invalid row)
Text B
(Invalid row)
Text B
Hope the question is clear .. Thanks