473,405 Members | 2,141 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,405 software developers and data experts.

how to set width of datalist item

is it possible to set width of ItemTemplate
i tried to set like this:
<ItemStyle Width='<% SomeProperty %>'></ItemStyle>

i get error:

'<% SomeProperty %>' can not be parsed as a unit as there are no numeric
values in it. Examples of valid unit strings are '1px' and '.5in'.
Nov 19 '05 #1
4 4893
Have you tried using databinding syntax?

<%# SomeProperty %>

"TomislaW" <to*********@hotmail.com> wrote in message news:O2****************@TK2MSFTNGP09.phx.gbl...
is it possible to set width of ItemTemplate
i tried to set like this:
<ItemStyle Width='<% SomeProperty %>'></ItemStyle>

i get error:

'<% SomeProperty %>' can not be parsed as a unit as there are no numeric
values in it. Examples of valid unit strings are '1px' and '.5in'.

Nov 19 '05 #2
I think you can also give the itemTemplate a id and then set properties
through the id. Like this:

Sub Do_Something
ITS1.Width = SomeProperty
End Sub

<ItemStyle Id="ITS1" Width='<% SomeProperty %>'></ItemStyle>
This works with other server tags, hope it works in this case as well.

Nov 19 '05 #3
I did
it says:
CS0117: 'System.Web.UI.WebControls.TableItemStyle' does not contain a
definition for 'DataBinding'

"Raterus" <ra*****@hotmail.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Have you tried using databinding syntax?

<%# SomeProperty %>

"TomislaW" <to*********@hotmail.com> wrote in message
news:O2****************@TK2MSFTNGP09.phx.gbl...
is it possible to set width of ItemTemplate
i tried to set like this:
<ItemStyle Width='<% SomeProperty %>'></ItemStyle>

i get error:

'<% SomeProperty %>' can not be parsed as a unit as there are no numeric
values in it. Examples of valid unit strings are '1px' and '.5in'.

Nov 19 '05 #4
"Chad Devine" <su*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I think you can also give the itemTemplate a id and then set properties
through the id. Like this:

Sub Do_Something
ITS1.Width = SomeProperty
End Sub


i have datalist inside repeater so it is very difficult to access control
inside datalist
this is the reason why i using properties inside html, and not code behind

Nov 19 '05 #5

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

Similar topics

4
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
4
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
5
by: Vikas Kumar | last post by:
i had coded like this <ItemTemplate> <table width="100%"> <tr width="100%"> <td width="25%"><%#DataBinder.Eval(Container.DataItem,"FName")%></td> <td width="25%"><input type=text ...
1
by: Jules | last post by:
We have a problem setting, actually resetting, the SelectedItemTemplate of a DataList control. Below is the ObjectDataSource and the DataList in .ASPX: <asp:ObjectDataSource ID="mySource"...
1
by: AJ | last post by:
Hi all, With the following code in mind : <asp:DataList ID="dlOne" DataKeyField="myField1" DataSource="<%# GetDataSource1()" Runat="server"> <ItemTemplate> Output Value Here! <asp:DataList...
3
by: mroffey | last post by:
Hi everyone, I've been having this problem and I've searched high and low, but I can't seem to find the answer to what is probably a very simple solution. In a nutshell, I have a nested...
3
by: rn5a | last post by:
I want to change the background color of a row in a DataList when the mouse is moved over a row. This is how I tried but it doesn't change the background color of a row in the DataList when the...
3
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.