それで、私がカスタムクラスを持っているとしましょう:
Class Elements{
int width;
int height;
bool isBol;
}
そして主に私は次のようなものを持っています:
Public class MainWindow{
DataGrid dgv = new DataGrid();
List<Elements> elem = new List<Elements() {
new Element(){width=100, height = 200, isBold = false},
new Element(){ width=20, height=100, isBold = true}
};
dgv.ItemsSource = elem;
dgv.Columns.Add(new DataGridTextColumn() {
Header = "Width", Binding = new Binding("width")}
dgv.Columns.Add(new DataGridTextColumn() {
Header = "Height", Binding = new Binding("height")}
}
つまり、幅と高さの2列の単純なテーブルです。
ブール値isBoldに基づいて、行を太字で表示するにはどうすればよいですか?上記の私の例では、行20x100は表で太字になっているように見えますが、100x200は太字ではありません。
これはできますか?