[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

make multiline gridview

Posted on 2007-10-20
3
Medium Priority
?
3,872 Views
Last Modified: 2012-06-27
Hello sir
i am facing a  a problem in my grid and trying to explain with some points
1.Data comming from database in gridview
2.in database size of string is declare 35
3.and when data comes in gridview our gridview cell expands and the design of page become very poor

What i want
============
just want to make cells of gridview multiline i.e if long string come then cell do not expand but line become multiline

kindly help

Thanks
0
Comment
Question by:HanuSoftware
  • 2
3 Comments
 
LVL 5

Expert Comment

by:KPMT-Technician
ID: 20115389
On the GridView Edit the Column than your needing to fix the width of the column and make the cell word-wrap.

Example:
<asp:BoundField DataField="title" HeaderText="Title" SortExpression="title" >
    <ItemStyle Width="150px" Wrap="True" />
</asp:BoundField>

Robert Fidler
Springfield, Missouri
0
 

Author Comment

by:HanuSoftware
ID: 20121282

i am trying to implement it but it is not working i am sending my code plese examine it

<asp:GridView ID="title" runat="server" AutoGenerateColumns="false">
        <Columns>
             <asp:BoundField DataField="location" HeaderText="title" SortExpression="title"><ItemStyle         Width="20" Wrap="true"/>
        </asp:BoundField>
        </Columns>
        </asp:GridView>

i redused width to 20 then also it is not working
0
 
LVL 5

Accepted Solution

by:
KPMT-Technician earned 1500 total points
ID: 20122968
This is working for me but I'm using a template column.

///
<Columns>      
   <asp:TemplateField HeaderText="location" SortExpression="location" ItemStyle-Width="20px" ItemStyle-Wrap="true">  // add it here.
      <ItemStyle HorizontalAlign="Right" Width="20px" Wrap"true" />      // and add it here.
      <ItemTemplate>
         <asp:HyperLink ID="HyperLink1" runat="server"
            NavigateUrl='<%# Eval("location", "GetLocation.aspx?location={0}").ToString()") %>'
            Text='<%# Eval("location") %>'
            Target="_blank" />
      </ItemTemplate>
      <EditItemTemplate>
         <asp:TextBox  ID="TextBox1" runat="server" Text='<%# Eval("location") %>' />
      </EditItemTemplate>
   </asp:TemplateField>
</Columns>
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question