Quintiq file version 2.0
#parent: #root
Method UpdateColumns (ColumnTitles columnTitle_i, String imgAttrName_i, String title) id:Method_SCK_DialogSanityCheckBase_UpdateColumns
{
  #keys: '[118950.5.1123117405]'
  Body:
  [*
    // Update image attribute
    column := columnTitle_i.DataSetLevel().Columns();
    c := null( DataSetColumn );
    imgAttr := imgAttrName_i;
    
    c := select( column, Columns.astype( DataSetImageColumn ), col, col.DataMember() = imgAttr );
    if( isnull( c ) )
    {
      c := select( column, Columns.astype( DataSetConfigurableColumn ), col, col.Text() = "VALUE( object." + imgAttr + "() )" );
    }
    
    if( isnull( c ) )
    {
      newc := DataSetConfigurableColumn::Create( column );
      newc.Name( title );
      newc.SetText( "VALUE( object." + imgAttr + "() )" );
      column.StoreColumn( &newc ).astype( DataSetConfigurableColumn );
    }
    
    columnTitle_i.AutoSizeColumns();
  *]
}
