473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Limiting characters brought back from a datalist.

Hi everyone.

I've got this problem that I really have no idea how to solve.

I have a datalist that brings back x amount of rows, I need to limit
this datalist by 100 characters and then append a "..." to the end.

<asp:DataList id="dlDataList" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Flow">
<ItemTemplate>
<asp:LinkButton Runat="server"
ID="lnkbtn1"><%#DataBinder.Eval(Container.DataItem ,
"vc_desc")%></asp:LinkButton>
</ItemTemplate>
<AlternatingItemTemplate>
, <asp:LinkButton Runat="server"
ID="lnkbtn2"><%#DataBinder.Eval(Container.DataItem ,
"vc_desc")%></asp:LinkButton>
</AlternatingItemTemplate>
</asp:DataList>

You'll see that the list currently gets rendered like
Item1, Item2, Item3, Item4

I need it to be
Item1, Item2, Item3, Ite...

Can anyone point me in the right direction?

Any help would be appreciated.
Mark

Sep 18 '06 #1
1 1531
jb
Roffers wrote:
Hi everyone.

I've got this problem that I really have no idea how to solve.

I have a datalist that brings back x amount of rows, I need to limit
this datalist by 100 characters and then append a "..." to the end.

<asp:DataList id="dlDataList" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Flow">
<ItemTemplate>
<asp:LinkButton Runat="server"
ID="lnkbtn1"><%#DataBinder.Eval(Container.DataItem ,
"vc_desc")%></asp:LinkButton>
</ItemTemplate>
<AlternatingItemTemplate>
, <asp:LinkButton Runat="server"
ID="lnkbtn2"><%#DataBinder.Eval(Container.DataItem ,
"vc_desc")%></asp:LinkButton>
</AlternatingItemTemplate>
</asp:DataList>

You'll see that the list currently gets rendered like
Item1, Item2, Item3, Item4

I need it to be
Item1, Item2, Item3, Ite...

Can anyone point me in the right direction?

Any help would be appreciated.
Mark
Mark

You need to add handler for the itemdatabound event. There are plenty of
examples around.

jai
Sep 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Mosher | last post by:
Hi all, I have an issue with php and/or mysql. I have a php form that writes "items" to a mysql database, including a description of the item. On the mysql server, "magic_quotes_gpc" is ON. I...
5
by: Otto Krüse | last post by:
Hi everyone, I'm building a GUI in which I want, amongst other things, for people to fill in there postal code. The postal codes of my country (Holland) are in this format: 1234 AB So for the...
2
by: nextman | last post by:
A guy called Yuri brought this up a while ago but no one got back to him and now I have the same problem. I have an xml file which contains special characters such as &eacute; etc. The DTD...
35
by: Durgesh Sharma | last post by:
I want to use strrchar(source_string,last_char ) function from string.h header file,to find out the last occurrence of the NON SPACE Alphanumeric Character. Then i will put a NULL CHAR after...
1
by: Steve Lloyd | last post by:
Hi there, I have built a data list that contains dropdownlists that are populated depending on details of the item in the datalist by adding a datasource to the drop downs as part of the...
1
by: Paul | last post by:
Hi just wondering how to limit the string size for a data grid column, can this be done from the properties box, data formatting expression? If so what would be the expression to limit it to 20...
3
by: Peter Silva | last post by:
Hi folks, I have a need in a network data distribution application to send out data to folks who want it using the protocol of their choice. I´d like it to support a variety of protocols and I...
2
by: prakashwadhwani | last post by:
I've used Dbase/Clipper for years & Access for a little while now but Access doesn't seem to have any elegant solution to limiting the size of a text box ... i.e. the max number of characters that...
1
by: =?Utf-8?B?SkI=?= | last post by:
Hello My pgm1 (User Interface Level) passes an empty ArrayList to pgm2 (Business Logic Level). pgm2 then calls pgm3 (Data Access Level) to populate the ArrayList. Question1: When pgm2 gets...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.