Datagrid Formatting

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top