I have been trying to dynamically modify the CssClass property of a web explorer bar group using code similar to the following. We would like to have a different style for the first few group items; all other groups use the default style. The problem is the code does not seem to have any effect on the output. I checked the HTML output. It still uses the default CssClass defined in the styleSet. Is there any extra code i have to write to modify the style behavior?
<ig:WebExplorerBar ID="WebExplorerBar1" runat="server" Width="250px" > </ig:WebExplorerBar>
protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) this.WebExplorerBar1.Groups[0].CssClass = "otherStyleClass"; }
Hello thehitman,
Thank you for posting on Infragistics forum.
I have created a sample with your code and CSS styles were applied correctly to the “WebExplorerBar” groups from code behind.
You can try to apply styles directly from the .aspx page adding them like that:
<style type="text/css">
.modifiedCSS
{
background-image:none;
background-color:Red;
}
.modifiedCSS_1
background-color:Green;
width:250px;
height:20px;
</style>
Then in code behind file just refer to these styles and apply them:
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
// setting new CssClass for Group and for single Item
WebExplorerBar1.Groups[0].CssClass = "modifiedCSS";
WebExplorerBar1.Groups[0].Items[0].CssClass = "modifiedCSS_1";
// setting new CssClass for the second Group
WebExplorerBar1.Groups[1].CssClass = "modifiedCSS_1";
Additionally you can change “ActiveCssClass”, “HooverCssClass” or “SelectedCssClass” properties of the “WebExplorerBar” Group/Item to apply your style to these events also.
If this approach does not work for you, I can send you the example itself and you can modify it to reproduce your scenario.
Thank you for choosing Infragistics.
Hi,
I am using Infragistics WebExplorerBar Version=10.3.20103.2120 and I tried both ActiveCssClass and SelectedCssClass properties for Groups node but still after selecting any child node, css class is not applied to the ExplorerBarGroup.
Can any one help me please?
Thanks in advance.
I'm experiencing the very same with v10.3.20103.2171: after changing default CSS classes for both ExplorerBarGroup and ExplorerBarItem (as in the code below), I can see in generated HTML document that only ExplorerBarItem is properly overridden. ExplorerBarGroup keeps default "igeb_Group".
Do I need to upgrade ?
Regards.
ebgDynamic= new ExplorerBarGroup();
ebgDynamic.Expanded = true;
ebgDynamic.CssClass = "panel_Group";
ebgDynamic.SelectedCssClass = "panel_GroupSelected";
webDynamic.Groups.Add(ebgDynamic);
ebiDynamic=new ExplorerBarItem();
ebiDynamic.CssClass = "panel_Item";
ebiDynamic.SelectedCssClass = "panel_ItemSelected";
ebiDynamic.ActiveCssClass = "panel_ItemActive";
ebgDynamic.Items.Add(ebiDynamic);