Expand row in an UltraGrid based on column value condition.

Posted by PeterWokke on 20-Mar-2017 02:58

Dear All,

I want to expand child rows of the parent based on a column value in it.

Infragistics posted me this example but I do not know how to convert this in ABL code.

foreach (UltraGridRow row in this.ultraGrid1.Rows)

            {
                if ((bool)row.Cells["Boolean 1"].Value == false)
                    row.Expanded = true;
                else
                    row.Expanded = false;
            }

Regards, Peter

Posted by Mike Fechner on 20-Mar-2017 03:13

With https://github.com/consultingwerk/ListsAndEnumSamples/blob/master/Consultingwerk/foreach.i

Boolean 1 would be the name of the grid cell that determines if you'd like to expand the row or now.

ultraGrid1 is the Grid reference.

You may need a few USING statements.

 

{Consultingwerk/foreach.i UltraGridRow oRow in ultraGrid1:Rows}

  IF UNBOX (oRow:Cells["Boolean 1"]:Value) = FALSE THEN 
     oRow:Expanded = TRUE . 
  ELSE 
     oRow:Expenaded = FALSE . 

END.

All Replies

Posted by Mike Fechner on 20-Mar-2017 03:13

With https://github.com/consultingwerk/ListsAndEnumSamples/blob/master/Consultingwerk/foreach.i

Boolean 1 would be the name of the grid cell that determines if you'd like to expand the row or now.

ultraGrid1 is the Grid reference.

You may need a few USING statements.

 

{Consultingwerk/foreach.i UltraGridRow oRow in ultraGrid1:Rows}

  IF UNBOX (oRow:Cells["Boolean 1"]:Value) = FALSE THEN 
     oRow:Expanded = TRUE . 
  ELSE 
     oRow:Expenaded = FALSE . 

END.
Posted by PeterWokke on 20-Mar-2017 05:51

Hello Mike,

Thank you kindly for replay on my question.

I have implemented the foreach.i and it works nice.

Regards,

Peter

This thread is closed