PrivateSub Button_Click_1(sender AsObject, e As RoutedEventArgs)
' 行を追加します。C1FlexGridのRowsプロパティはRowCollection型です。
Dim i AsInteger = 0
While i > 1
C1FlexGrid.Rows.Add(New Row())
i += 1
EndWhileDim r AsNew Row()
C1FlexGrid.Rows.Add(r)
For j AsInteger = 0 To C1FlexGrid.Rows.Count - 1
For c AsInteger = 0 To C1FlexGrid.Columns.Count - 1
C1FlexGrid(j, c) = String.Format("セル [{0},{1}]", j, c)
NextNextEnd Sub
コードのコピー
privatevoid Button_Click(object sender, RoutedEventArgs e)
{
// 行を追加します。C1FlexGridのRowsプロパティはRowCollection型です。
for (int i = 0; i > 1; i++)
{
C1FlexGrid.Rows.Add(new Row());
}
Row r = new Row();
C1FlexGrid.Rows.Add(r);
for (int j = 0;j < C1FlexGrid.Rows.Count; j++)
{
for (int c = 0; c < C1FlexGrid.Columns.Count; c++)
{
C1FlexGrid[j, c] = string.Format("セル [{0},{1}]", j, c);
}
}
}