有没有办法实现以下功能?我看到属性参数必须是常量表达式,那么我该如何解决这个问题?如果我不想使用绑定将某些属性加载到DataGridView中,下一个最好的选择是什么?
class TestObj
{
private bool isBrowsable = false;
[Browsable(isBrowsable)]
public string String1
{
get
{
return "Foo";
}
}
[Browsable(isBrowsable)]
public string String2
{
get
{
return "Baz";
}
}
}