Welcome Guest Search | Active Topics | Sign In | Register

ASPX code behind - Eo.web.Listbox Options
gollnick
Posted: Tuesday, September 19, 2017 6:54:48 PM
Rank: Member
Groups: Member

Joined: 11/13/2014
Posts: 15

I am using the Eo.web.Listbox in a VS 2013 web project. There are several occasions where I need to change the background color of a row.
How and can I do this??

thanks

gollnick
Code: Visual Basic.NET
eo_support
Posted: Wednesday, September 20, 2017 3:22:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

You would change the BackgroundColor in one of the item style property. For example, if you want to change background color for all items, you would modify ItemStyle. If you want to change background color for selected item, you would modify SelectedItemStyle.

Thanks!
gollnick
Posted: Wednesday, September 20, 2017 6:12:39 PM
Rank: Member
Groups: Member

Joined: 11/13/2014
Posts: 15
Would really like to see an actual example of this in either c# or vb .net. My intellasense does not recognize or compile. Just show me the several lines that are neeeded if this is indeed the solution.
Thanks
gollnick
eo_support
Posted: Thursday, September 21, 2017 10:58:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

You can take a look of any of our sample .aspx file in the EOWebDemo sample application. For example, you can open our sample solution, then go to CS -> Web -> EOWebDemo_CS -> Demos -> ListBox -> Designs -> Office 2003 -> Demo.aspx and you will see something like this:

Code: HTML/ASPX
<eo:ListBox runat="server" ID="ListBox1" ControlSkinID="None" Height="100px" 
    Width="200px">

    ......other properties.....

    <ItemStyle CssText="padding: 1px; background-color:white; color: black;" />

    ......other properties.....

</eo:ListBox>


Here the code set the ListBox's ItemStyle property to include "background-color:white" CSS attribute. You change that to "background-color:red" you will get red background.

Two things are standard here and not particularly related to the ListBox control:

1. The ASP.NET syntax to set a property (here it sets ItemStyle property of the ListBox control);
2. The CSS syntax to set background (here it sets background-color to red);

One thing that does have to do with the ListBox control here is what property controls what. For example, the ListBox control has ItemStyle property that you can use to set style for all items. You can get a list of all style properties supported by the ListBox control here:

https://www.essentialobjects.com/doc/web/listbox/style.aspx

Hope this is clear enough for you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.