Datagrid TableStyle Not working

G

Guest

Hi,

This is driving me crazy. Once the TableStyle is added (last line) the datagrid comes up blank. If I comment it out, the data grid shows the column names from the dataset. I must be doing something out of sequence

Thanks in advance for help provided

To

-------
Dim dsComputerFileDetails As New DataSet(

Dim dtFileDetails As New DataTable(
dtFileDetails.TableName = "dtFileDetails
dtFileDetails.Columns.Add("Name", Type.GetType("System.String")
dsComputerFileDetails.Tables.Add(dtFileDetails

Dim dgComputer As New DataGrid(
dgComputer.DataSource = dsComputerFileDetail
dgComputer.DataMember = "dtFileDetails
Controls.Add(dgComputer

Dim tsFileDetails As New DataGridTableStyle(
tsFileDetails.MappingName = "dtFileDetails

Dim dgtbc As New DataGridTextBoxColumn(
dgtbc.HeaderText = "Name
tsFileDetails.GridColumnStyles.Add(dgtbc

dgComputer.TableStyles.Add(tsFileDetails)
 
J

Jan Tielens

I think your forgot to set the MappingName of the column:
dgtbc.MappingName = "Name"

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


tomp said:
Hi,

This is driving me crazy. Once the TableStyle is added (last line) the
datagrid comes up blank. If I comment it out, the data grid shows the
column names from the dataset. I must be doing something out of sequence.
 

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

Similar Threads


Top