How to turn wrapping off for datagrid columns

S

Scott

I having a problem where I need to turn off the wrapping feature for
all columns in my datagrid. Example code would be:

<asp:DataGrid id="ResultGrid" runat="server"
AutoGenerateColumns="true">
<ItemStyle Wrap="false"></ItemStyle>
<Columns>
</Columns>
</asp:DataGrid>

I understand the above code does not turn the wrapping feature off on
the <td> level, but only the <tr> level which is not what I want. I
also understand that this is a Microsoft bug and in order to fix it, I
have to add the asp:BoundColumn along with the ItemStyle
(wrap="false") for each column. While this is ok if you know what the
columns are going to be, but in my case I'm dynamically building
columns based on what table in the database the user has chosen. So I
don't know what the columns will be or how many.

Has anybody come across this and if you have, can you give me some
hints or examples which would allow me to turn wrapping off for all
columns.

Thanks.
 

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

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top