Hi, I am using the following technique to hide a column in a datagrid. It works great, however, I am not able to get the item value anymore by calling
DataGrid1.Item(DataGrid1.CurrentRowIndex(), 0)
Is there a way to hide a column using this method and still get the value from the datagrid?
I do not want to use a Datagrid Table Style
VB Code:
Dim cn As New SqlConnection("Data Source=MyServer;User Id=MyUser;Password=MyPassword;Initial Catalog=Northwind") cn.Open() Dim da As New SqlDataAdapter("Select * From Products", cn) Dim ds As New DataSet() da.FillSchema(ds, SchemaType.Source, "Products") da.Fill(ds, "Products") ' Next line hides column. ds.Tables("Products").Columns("QuantityPerUnit").ColumnMapping = MappingType.Hidden DataGrid1.SetDataBinding(ds, "Products")
Thanks in advance
Diego




Reply With Quote