ComponentModel 的 Browsable false 不适用于特定模型
ComponentModel's Browsable false doesn't work for specific model
我有 DataGridView 并显示不同的表格。一切正常,但我不得不更新我的 Entity Framework 模型,它重置了我所有的模型 classes。现在 只有一个 class 仍然显示 ID 列,而其他 隐藏它。我看不出这个 class 与其他的有什么不同。
namespace KasaMP.OsnovniPodaci
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
public partial class Artikl
{
[Browsable(false)]
public int IDArtikli { get; set; }
public string Barkod { get; set; }
public Nullable<int> Sifra { get; set; }
public string Naziv { get; set; }
public string JedinicaMjere { get; set; }
public decimal Tarifa { get; set; }
public Nullable<decimal> ProdajnaCijena { get; set; }
[Browsable(false)]
public Nullable<bool> Flag { get; set; }
public Nullable<decimal> Kalo { get; set; }
public Nullable<decimal> NabavnaCijena { get; set; }
public Nullable<decimal> VeleprodajnaCijena { get; set; }
public Nullable<decimal> Zalihe { get; set; }
}
}
其他型号class完美隐藏,怎么回事?
namespace KasaMP.OsnovniPodaci
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
public partial class Porez
{
[Browsable(false)]
public int IDPorez { get; set; }
public decimal Tarifa { get; set; }
public decimal Porez1 { get; set; }
public decimal PorezUsluge { get; set; }
public decimal PorezPotrosnje { get; set; }
}
}
我使用相同的表单和相同的 DatagridView 控件来显示它 - 为什么 Visual Studio 会歧视我的 Artikl class :C
好的,结果可能是一些视觉 Studio/cache 错误,我不确定...
但它现在突然 - 神奇地 - 起作用了...
很遗憾,我写不出更好的答案
我有 DataGridView 并显示不同的表格。一切正常,但我不得不更新我的 Entity Framework 模型,它重置了我所有的模型 classes。现在 只有一个 class 仍然显示 ID 列,而其他 隐藏它。我看不出这个 class 与其他的有什么不同。
namespace KasaMP.OsnovniPodaci
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
public partial class Artikl
{
[Browsable(false)]
public int IDArtikli { get; set; }
public string Barkod { get; set; }
public Nullable<int> Sifra { get; set; }
public string Naziv { get; set; }
public string JedinicaMjere { get; set; }
public decimal Tarifa { get; set; }
public Nullable<decimal> ProdajnaCijena { get; set; }
[Browsable(false)]
public Nullable<bool> Flag { get; set; }
public Nullable<decimal> Kalo { get; set; }
public Nullable<decimal> NabavnaCijena { get; set; }
public Nullable<decimal> VeleprodajnaCijena { get; set; }
public Nullable<decimal> Zalihe { get; set; }
}
}
其他型号class完美隐藏,怎么回事?
namespace KasaMP.OsnovniPodaci
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
public partial class Porez
{
[Browsable(false)]
public int IDPorez { get; set; }
public decimal Tarifa { get; set; }
public decimal Porez1 { get; set; }
public decimal PorezUsluge { get; set; }
public decimal PorezPotrosnje { get; set; }
}
}
我使用相同的表单和相同的 DatagridView 控件来显示它 - 为什么 Visual Studio 会歧视我的 Artikl class :C
好的,结果可能是一些视觉 Studio/cache 错误,我不确定...
但它现在突然 - 神奇地 - 起作用了...
很遗憾,我写不出更好的答案