how to set width of datalist item

T

TomislaW

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'.
 
C

Chad Devine

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.
 
T

TomislaW

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

Have you tried using databinding syntax?

<%# SomeProperty %>
 
T

TomislaW

Chad Devine said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top