1

フレックスグリッド(フレックスコンポーネントグリッド)がありますが、セルを非表示にするにはどうすればよいですか。

例:2行目と5列目-条件に基づいて非表示/削除する必要があります。

たとえば

if(C1FlexGrid1.Rows[2][5].ToString().Length <0)
{
  //I want this to be invisible.
  C1FlexGrid1.Rows[2][5].isVisible=false;
}

私が使用した方法でisVisibleをサポートするプロパティはありません。とにかく私はこれを達成することができますか?ありがとう。

4

1 に答える 1

2

最後に私はそれを理解しました:

WinFormsコンポーネントグリッドのownerdrawcellイベントを作成します。

componentGrid.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
componentGrid.OwnerDrawCell += componentGrid_OwnerDrawCell;

方法

void componentGrid_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{
       var value = componentGrid.GetCellCheck(e.Row,e.Col);
       //Your custom condition
       if (value is bool)
       {
          //Will hide the cell
          e.Style.Display = DisplayEnum.None;
       }
       else
       {
           //Will show the cell  
           e.Style.Display = DisplayEnum.Stack;
       }
}
于 2012-08-24T22:28:36.773 に答える