Jan 10th, 2006, 02:13 AM
#1
Thread Starter
Addicted Member
width on grid view
I have a grid view that take the data from the DB.
if the row is big
example:
"nd bhdjhhd jh jhfd jh gjhdf gjhgdfs jhdg jhdjhdg fhjhdgf jhsdjfh jdshfg aydufygd uyfg uysg fuy adusygjh j gjh gcdys duf gudshcghsd dcjhdfusdhgdsygusa hdgfuysagdcuy sgcuysgu ycgusychxsajhdgusycg hcghsudyfgsduyf uasygjhsc bjsjhdguhguah dyguhyyg uyf uydgf uydsg fuysgd fuysdg ufyssuyfg uygsuygfds"
(with no ENTERS)
than the width of the gridview changed,
I want that if the text is big to break the line and not to change the width.
example in the picture.
thanks
Attached Images
Jan 10th, 2006, 01:56 PM
#2
Re: width on grid view
I would recommend that you write your own handler for each data loading event of the data grid.
Evaluate the data in that cell and if it is larger than a certain number of characters, change the data and insert the carriage return yourself. Continue for the entire length of the data.
Optionally, if you are OK with scrolling when this occurs, you can use a CSS style to force those cells to scroll. If you want to do that, add the following style to the datagrid datacell:
style="width=XXX px; height=XXX px; overflow:scroll"
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Jan 10th, 2006, 02:51 PM
#3
Thread Starter
Addicted Member
Re: width on grid view
thanks!
I think I will use the scroll
thanks again!
Jan 10th, 2006, 04:43 PM
#4
Re: width on grid view
In the ItemStyle tag of the datagrid, set Wrap="True"
Jan 11th, 2006, 03:12 AM
#5
Thread Starter
Addicted Member
Re: width on grid view
I got the mistake, but I dont know how to fix it.
if the paragraph is with ENTER I want to show the ENTERS
in VB I use the replace function
dim str as string
str = replace(filedName, vbcrlf, "<BR>")
but now I work with c# and I cant to replace the vbcrlf to BR then I use the HTML TAG
<pre>
<%=filedName %>
<pre>
then when I use the PRE if there not ENTER the width of the grid view changed.
how can I
from one side show the ENTERS (if there are)
from other side if there is no enters break lines.
hope to understand me
thanks!
Jan 11th, 2006, 11:51 AM
#6
Re: width on grid view
VB: "string" & vbCrLf & "string"
C#: "string\r\nstring"
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width