Not all of the columns are displayed (only 2 of 3) and style sheet isn't
applied. Here's the VB code:
ScheduleReader = cm.ExecuteReader
If ScheduleReader.HasRows Then
strSchedule = "Schedule"
dgSchedule.AutoGenerateColumns = False
Dim dgcDate As New BoundColumn
With dgcDate
.DataField = "SubjectDate"
.HeaderText = "Due Date"
.ItemStyle.CssClass = "SectionScheduleDate"
End With
dgSchedule.Columns.Add(dgcDate)
Dim dgcSubject As New BoundColumn
With dgcSubject
.DataField = "Subject"
.HeaderText = "Subject"
.ItemStyle.CssClass = "SectionScheduleSubject"
End With
dgSchedule.Columns.Add(dgcSubject)
Dim dgcComment As New BoundColumn
With dgcDate
.DataField = "Comment"
.HeaderText = "Comment"
.ItemStyle.CssClass = "SectionScheduleComment"
End With
With dgSchedule
.Columns.Add(dgcComment)
.DataSource = ScheduleReader
.DataBind()
End With
Else
strSchedule = "Schedule Not Available"
End If
ScheduleReader.Close()
Thanks for your help.
"Ray Costanzo [MVP]" wrote:
Not correctly in what way? Is the text upside down? Describe what's wrong
and show the code that you're using to produce the columns, please.
Ray at home
"R Riness" <rr*****@nospam.att.net> wrote in message
news:DD**********************************@microsof t.com...I have a datagrid that's using a dataread to display rows from SQL Server.
I
have autogenerate columns turned off. When I add columns in code behind
(VB),
I don't get the columns displayed correctly. If I add the columns in the
web
page as part of the html, it works. I have other grids that work correctly
with the VB code, and have tried replacing the grid, building the page
from
scratch, and still get the same result. Any ideas? Thanks in advance.