|
-
May 20th, 2003, 01:02 PM
#1
Thread Starter
PowerPoster
Do NOT understand the FORMAT member
ok I have data correctly loading into a datalist but I want to set the maximum length that can be displayed to 20 chars. How can I do that. I am calling the DataBind method in the code behind. I tried the 3rd param but it did nothing.
Thanks
Code:
<%# DataBinder.Eval(Container.DataItem, "AnnouncementTitle", "{0:5}") %>
-
May 20th, 2003, 01:52 PM
#2
Lively Member
you can use a left(data,20) in your select statement.
Code:
strSQL="select left(title,20) from movies order by title"
"Find all you need in your mind if you take the time" -DT
-
May 20th, 2003, 02:12 PM
#3
Thread Starter
PowerPoster
yep! Sometimes we don't see the forest for the trees
-
May 20th, 2003, 02:19 PM
#4
PowerPoster
For more complex conversions, you can also create a function that will change the data....
This will call the FormatTheData function:
<%# FormatTheData(DataBinder.Eval(Container.DataItem, "AnnouncementTitle")) %>
The function:
Public Function FormatTheData(title As string) As string
'Do all your conversions to the title variable here, then
' return the converted title as a string.
End Function
-
May 20th, 2003, 02:20 PM
#5
Thread Starter
PowerPoster
Originally posted by hellswraith
For more complex conversions, you can also create a function that will change the data....
This will call the FormatTheData function:
<%# FormatTheData(DataBinder.Eval(Container.DataItem, "AnnouncementTitle")) %>
The function:
Public Function FormatTheData(title As string) As string
'Do all your conversions to the title variable here, then
' return the converted title as a string.
End Function
Yes but for me that is the most undesirable...thanks though
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
|