Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I Have application which contains the table with messageid and messageDesc,and inside messageDesc column there is message description,when i am trying to bind to gridview to the the messagedesc column then its coming a single line so i need to scroll in horizontal direction ,so i want to show the message description on multiple lines in gridview's message column.

I have tried by itemstyle attribute but its not working, please suggest me solution for the same.also i can't change the database message content.


Thanks in Advanced
Posted
Updated 6-May-12 23:26pm

set the grid column width in pixel.
 
Share this answer
 
Comments
ahp-1984 7-May-12 4:36am    
No ,its not working
try like this
place a div tag in item template and inside the div tag put your message column and give fixed width for div
ex
<asp: xmlns:asp="#unknown">
XML
GridView ID="GridView2" runat="server" AutoGenerateColumns="False"          

      <Columns>
<asp:templatefield headertext="Name" headerstyle-font-size="Medium" headerstyle-width="150px" headerstyle-font-names="Microsoft Sans Serif">
                  
                    <itemtemplate>
                     <div style="width :150px;font-size :medium ;font-family :Microsoft Sans Serif  ">
                        <asp:label id="lblID" runat="server" text="<%# DataBinder.Eval(Container.DataItem,"Name") %>"></asp:label>
                  </div>
                    </itemtemplate>
 </asp:templatefield>
 
Share this answer
 
Comments
ahp-1984 7-May-12 7:29am    
Sorry, But this also not working for me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900