我在C#中的類,它看起來就像這樣:數據網格與自定義的類C#WPF
class Program
{
string name;
float number;
string type;
Value[] parameters=new Value[40];
}
class Value
{
float parameter;
string parameter name;
}
另外,我有一個DataGrid
是應該是這樣的:
第3列是Number
,Name
,Type
。 其他是40個參數的名稱Value[index].parameterName).
在應該代表一個Program
對象,並顯示3個屬性值number
,name
和type
的DataGrid
每一行,接着Value[index].parameter
的值。
Values
大小是動態分配的,我寧願主要使用c#代碼而不使用xaml。 此外,我需要更改單元格中的值(數字除外)。
有沒有我能夠實現的事件?
謝謝!
是否要在分隔的列中顯示每個參數? –
我認爲'Value [index] .parameter'你的意思是'parameters [index] .parameter'? –
我想要在不同的列中的每個參數。 是的,對不起,我的意思是參數[index] .parameter –