dt.Columns.Add("S.No");
dt.Columns.Add("FirstName");
dt.Columns.Add("LastName");
dt.Columns.Add("Occupation");
dt.Columns.Add("Place");
// Create a Data Set
DataSet ds = new DataSet();
ds.Tables.Add(dt);
dt.Rows.Add(new string[] { "1", "Alex", "Zen", "Doctor", "Italy" });
dt.Rows.Add(new string[] { "2", "Bob", "Harry", "Staff", "London" });
dt.Rows.Add(new string[] { "3", "Alice", "Peter", "Developer", "US" });
dt.Rows.Add(new string[] { "4", "Adlensha", "Fdo", "Staff", "Italy" });
dt.Rows.Add(new string[] { "5", "Brick", "John", "Nurse", "North America" });
dt.Rows.Add(new string[] { "6", "Collen", "Geo", "Developer", "India" });
this.multiColumnComboBox1.DataSource = dt;
this.multiColumnComboBox1.DisplayMember = "Place";
this.multiColumnComboBox1.SelectedIndexChanged += new EventHandler(multiColumnComboBox1_SelectedIndexChanged);
this.multiColumnComboBox1.ListBox.Grid.Model.Cols.Hidden["S.No"] = true;
this.multiColumnComboBox1.ListBox.Grid.Model.Cols.Hidden["LastName"] = true; |
List<String> SimpleFrameFilter = new List<String>();
SimpleFrameFilter.Add("FaixaInicial");
SimpleFrameFilter.Add("FaixaFinal");
this.changeBrowsableAttribute(typeof(TabelaFaixaFatSimples), SimpleFrameFilter);
this.multiColumnComboBox1.DataSource = collection;
private void changeBrowsableAttribute(Type wallTypeToMakeSheathingVisible, List<String> columns)
{
foreach (var col in columns)
{
PropertyDescriptor descriptor = TypeDescriptor.GetProperties(wallTypeToMakeSheathingVisible)[col];
BrowsableAttribute attrib = (BrowsableAttribute)descriptor.Attributes[typeof(BrowsableAttribute)];
FieldInfo isBrow = attrib.GetType().GetField("browsable", BindingFlags.NonPublic | BindingFlags.Instance);
isBrow.SetValue(attrib, true);
}
}
public class TabelaFaixaFatSimples
{
[Browsable(false)]
public virtual decimal FaixaInicial { get; set; }
[Browsable(false)]
public virtual decimal FaixaFinal { get; set; }
[Browsable(false)]
public virtual decimal Aliquota { get; set; }
[Browsable(false)]
public virtual decimal IRPJ { get; set; }
[Browsable(false)]
public virtual decimal CSLL { get; set; }
[Browsable(false)]
public virtual decimal COFINS { get; set; }
[Browsable(false)]
public virtual decimal PIS_PASEP { get; set; }
[Browsable(false)]
public virtual decimal CPP { get; set; }
[Browsable(false)]
public virtual decimal ICMS { get; set; }
[Browsable(false)]
public virtual decimal IPI { get; set; }
[Browsable(false)]
public virtual decimal ISS { get; set; }
[Browsable(false)]
public virtual decimal PercReducaoBC { get; set; }
} |