G
Guest
Hi,
I am workin on a Smart Device Application Project (VS.NET 2003) and needed
to hide a column in a datagrid. I tried to use MappingType.Hidden, but it
doesnt seem to work. The below code works fine in WinForm but not in Smart
Device application.
DataTable dt = new DataTable("Test");
dt.Columns.Add("Dpt",Type.GetType("System.String"));
dt.Columns.Add("Vendor",Type.GetType("System.String"));
dt.Columns.Add("Start",Type.GetType("System.String"));
dt.Columns.Add("End",Type.GetType("System.String"));
DataRow row = dt.NewRow();
row.ItemArray = new object[]{"21","MAYTAG","04/02/04","04/06/04"};
dt.Rows.Add(row);
DataRow row1 = dt.NewRow();
row1.ItemArray = new object[]{"20","GE","04/02/04","04/06/04"};
dt.Rows.Add(row1);
DataSet ds = new DataSet("dSet");
ds.Tables.Add(dt);
ds.Tables["Test"].Columns["Vendor"].ColumnMapping =
MappingType.Hidden;
dataGrid1.DataSource = ds.Tables["Test"];
The above code hides "Vendor" column perfectly for a winform but not in
SmartDevice (compact framwork).
Please help!
Thanks,
Naresh
I am workin on a Smart Device Application Project (VS.NET 2003) and needed
to hide a column in a datagrid. I tried to use MappingType.Hidden, but it
doesnt seem to work. The below code works fine in WinForm but not in Smart
Device application.
DataTable dt = new DataTable("Test");
dt.Columns.Add("Dpt",Type.GetType("System.String"));
dt.Columns.Add("Vendor",Type.GetType("System.String"));
dt.Columns.Add("Start",Type.GetType("System.String"));
dt.Columns.Add("End",Type.GetType("System.String"));
DataRow row = dt.NewRow();
row.ItemArray = new object[]{"21","MAYTAG","04/02/04","04/06/04"};
dt.Rows.Add(row);
DataRow row1 = dt.NewRow();
row1.ItemArray = new object[]{"20","GE","04/02/04","04/06/04"};
dt.Rows.Add(row1);
DataSet ds = new DataSet("dSet");
ds.Tables.Add(dt);
ds.Tables["Test"].Columns["Vendor"].ColumnMapping =
MappingType.Hidden;
dataGrid1.DataSource = ds.Tables["Test"];
The above code hides "Vendor" column perfectly for a winform but not in
SmartDevice (compact framwork).
Please help!
Thanks,
Naresh