TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Wrap Long Text Inside the Gridview Column
Mukesh Kumar
Oct 05
2015
Code
22
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<
html
>
<
head
runat
=
"server"
>
<
style
type
=
"text/css"
>
.WrapText {
width: 100%;
word-break: break-all;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
class
=
"WrapText"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
asp:GridView
ID
=
"MyGrid"
runat
=
"server"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"First_Name"
ForeColor
=
"#333333"
GridLines
=
"Both"
Width
=
"50%"
>
<
AlternatingRowStyle
BackColor
=
"White"
/>
<
Columns
>
<
asp:BoundField
HeaderText
=
"FirstName"
DataField
=
"First_Name"
>
<
ItemStyle
Width
=
"35"
/>
<
HeaderStyle
Width
=
"100px"
/>
</
asp:BoundField
>
<
asp:BoundField
HeaderText
=
"LastName"
DataField
=
"Last_Name"
>
<
ItemStyle
Width
=
"50"
/>
<
HeaderStyle
Width
=
"100px"
/>
</
asp:BoundField
>
</
Columns
>
</
asp:GridView
>
</
div
>
</
form
>
</
body
>
</
html
>
asp.net
Gridview
Wrap Long Text