G
Gh0st
Hi, hope some1 can help me trying this about a week.
I read the data for my Datagrid into a dataset, convert a little bit
and store the finalresult in another ds from an Access-DB and bind the
data
ds.Tables.Add("Vendor")
With ds.Tables("Vendor").Columns
..Add("Verkäufer")
..Add("Name")
..Add("Umsatz")
..Add("Kunden")
..Add("øKauf")
..Add("Positionen/Kunde")
..Add("Umsatz/Bereich")
End With
query = "SELECT ....."
da.SelectCommand = New OleDb.OleDbCommand(query, cn)
da.Fill(ds, "Salesperson")
....
conversion and "Salesperson"->"Vendor"
....
DataGrid1.DataSource = ds.Tables("Vendor").DefaultView
DataGrid1.DataBind()
And after the DataBind my datagrid1.colums.count is always 0. this is
because of the AutoGenerateColumn=true, i've read.
But i can't figure out how i should change the width of a column.
DataGrid1.Columns(0).ItemStyle.Width = Unit.Pixel(100)
does NOT work, because VB.NET says my Datagrid has 0 Columns.
But if I look at my asp Page I can see the whole Datagrid.
Hope some1 has an idear and perhaps even some code.
I read the data for my Datagrid into a dataset, convert a little bit
and store the finalresult in another ds from an Access-DB and bind the
data
ds.Tables.Add("Vendor")
With ds.Tables("Vendor").Columns
..Add("Verkäufer")
..Add("Name")
..Add("Umsatz")
..Add("Kunden")
..Add("øKauf")
..Add("Positionen/Kunde")
..Add("Umsatz/Bereich")
End With
query = "SELECT ....."
da.SelectCommand = New OleDb.OleDbCommand(query, cn)
da.Fill(ds, "Salesperson")
....
conversion and "Salesperson"->"Vendor"
....
DataGrid1.DataSource = ds.Tables("Vendor").DefaultView
DataGrid1.DataBind()
And after the DataBind my datagrid1.colums.count is always 0. this is
because of the AutoGenerateColumn=true, i've read.
But i can't figure out how i should change the width of a column.
DataGrid1.Columns(0).ItemStyle.Width = Unit.Pixel(100)
does NOT work, because VB.NET says my Datagrid has 0 Columns.
But if I look at my asp Page I can see the whole Datagrid.
Hope some1 has an idear and perhaps even some code.