Datagrid Formatting

  • Thread starter Thread starter Mike Fellows
  • Start date Start date
M

Mike Fellows

Help,

Im used to vb.net and have been given a web project to do
i have a datagrid which i populate with data (surprisngly)

one of the columns in my datagrid contains a long string

in vb.net i used to do the following:

Dim ts As New DataGridTableStyle()
ts.MappingName = "Table"

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
ts.GridColumnStyles(0).Width = 110
ts.GridColumnStyles(1).Width = 90
ts.GridColumnStyles(2).Width = 100
ts.GridColumnStyles(3).Width = 90
ts.GridColumnStyles(4).Width = 250

since datagridtablestyles are not usable in asp.net what do i do?

i need this in vb as it runs client side not from the asp

Thanks


Mike Fellows
 
Each column definition in the datagrid has a corresponding 'HeaderStyle', 'ItemStyle', 'FooterStyle' property which allows you to control various aspects of the rendering.

If you have point-and-click developed you way to rendering a datagrid from a datasource, then you have a bit of work ahead of you. This is also true if you have 'AutoGenerateColumns' enabled on the dataGrid

----- Mike Fellows wrote: ----

Help

Im used to vb.net and have been given a web project to d
i have a datagrid which i populate with data (surprisngly

one of the columns in my datagrid contains a long strin

in vb.net i used to do the following

Dim ts As New DataGridTableStyle(
ts.MappingName = "Table

DataGrid1.TableStyles.Clear(
DataGrid1.TableStyles.Add(ts
Me.DataGrid1.DataSource = ds.Tables(0
ts.GridColumnStyles(0).Width = 11
ts.GridColumnStyles(1).Width = 9
ts.GridColumnStyles(2).Width = 10
ts.GridColumnStyles(3).Width = 9
ts.GridColumnStyles(4).Width = 25

since datagridtablestyles are not usable in asp.net what do i do

i need this in vb as it runs client side not from the as

Thank


Mike Fellow
 
Back
Top