473,396 Members | 1,834 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,396 software developers and data experts.

Limit the length of databound text on datalist

Any way to limit the length of databound text on a datalist
itemtemplate?

Dec 1 '06 #1
4 2926
Anyone???

Dec 1 '06 #2
you could consider adding a paging solution
http://www.dotnetjohn.com/articles.aspx?articleid=48

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Derty" <es*******@yahoo.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
Any way to limit the length of databound text on a datalist
itemtemplate?

Dec 1 '06 #3
thanks for the reply John. To attempt to clarify, I need to limit the
length of characters that are displayed via text item on a datalist. In
the article link you supplied there's a reference to the following code
that would, I presume, display the 'company name' contained in a table:
<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>

My question is: how could you limit the number of characters displayed?

The reason for the question is the table field I'm using can be
extremely lengthy in charaters and it doesn't make sense to display
them all on a rendered page.

Thanks.

John Timney (MVP) wrote:
you could consider adding a paging solution
http://www.dotnetjohn.com/articles.aspx?articleid=48

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Derty" <es*******@yahoo.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
Any way to limit the length of databound text on a datalist
itemtemplate?
Dec 1 '06 #4
Hey Derty,

You can limit that from the database level like so:

select substring(Columname,1,10) + '...' from tablename

This will return data in this form, limited to 10 characters

data111111....

On 1 Dec 2006 10:22:37 -0800, "Derty" <es*******@yahoo.comwrote:
>thanks for the reply John. To attempt to clarify, I need to limit the
length of characters that are displayed via text item on a datalist. In
the article link you supplied there's a reference to the following code
that would, I presume, display the 'company name' contained in a table:
<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>

My question is: how could you limit the number of characters displayed?

The reason for the question is the table field I'm using can be
extremely lengthy in charaters and it doesn't make sense to display
them all on a rendered page.

Thanks.

John Timney (MVP) wrote:
>you could consider adding a paging solution
http://www.dotnetjohn.com/articles.aspx?articleid=48

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Derty" <es*******@yahoo.comwrote in message
news:11**********************@79g2000cws.googlegr oups.com...
Any way to limit the length of databound text on a datalist
itemtemplate?
--

Bits.Bytes.
http://bytes.thinkersroom.com
Dec 1 '06 #5

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

Similar topics

5
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by...
1
by: Phil Townsend | last post by:
I want to add a datalist to a Repeater control. The data for the datalist resides in a cached DataSet that contains two related tables. The data in last child table should be rendered in three...
0
by: Steve | last post by:
Hi, I have a problem here with bounding data inside a datalist. Currently I am working on a page which I can have a list of items using a datalist(listA). Inside this datalist(listA) i would...
8
by: bienwell | last post by:
Hi, I have a problem of displaying data bound by a datalist control. In my table, I have a field Start_date which has Short Date data type. I tried to update this field by Current Date. After...
4
by: MasterChief | last post by:
I have an insert template textbox that is bound to a field in SQL. Since it is the insert template it really doesn't have anything in it. How do I set the default text? Like for example if I have a...
7
by: | last post by:
I'm using ASP.NET 2.0, C#, SQL Server 2005, and databound controls like the DataList and the GridView. Right now I'm using SqlDataSource as part of very quick and dirty site; I'm not looking to...
0
by: Derty | last post by:
Any way to limit the length of databound text on a datalist itemtemplate?
2
by: mianiro | last post by:
Does a control such as a gridview or datalist still load with data when it is bound to a dataset but the visibility is = False?? I have a datalist and a gridview with datasources set at design...
7
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
I need to emulate the missing "maxlegth" attribute in "textarea" fields but all my Google searches either lead to obsolete scripts that overwrite the "value" property (thus losing caret position)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.