Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gridview formatting issue

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
One column in my gridview contains about a paragraph of text in each row. For this particular column, I need to set a fixed width and allow word wrap. I tried this syntax:

Code:
If IsPostBack Then
            With GridView1
                .DataSource = myDataView
                .DataBind()
            End With
            If GridView1.Columns.Count > 3 Then
                GridView1.Columns(4).ItemStyle.Width = 50
                GridView1.Columns(4).ItemStyle.Wrap = True
            End If
end if

I don't think that the itemstyle lines ever executed. I put a breakpoint on GridView1.Columns(4).ItemStyle.Width = 50, but the breakpoint never triggered. I have no idea why that happened. The gridview absolutely has five columns...i can see them.

So I really have two questions...why didn't those lines execute, and if they had executed would that have fixed the problem??



 
Where is this code located (i.e., in what event handler)? PageLoad? RowDataBound?




I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top