if (!Page.IsPostBack){
originalEnabledColor = igcWebTxtEvent.EnabledStyle.BackColor; originalFocusedColor = igcWebTxtEvent.FocusedStyle.BackColor ;
originalHoverColor=igcWebTxtEvent.HoveredStyle.BackColor ;
}
protected void chkOmitEvent_CheckedChanged(object sender, EventArgs e)
{
if (chkOmitEvent.Checked)
{
igcWebTxtEvent.EnabledStyle.BackColor=
System.Drawing.Color.LemonChiffon;
igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;
}
else
{
igcWebTxtEvent.EnabledStyle.BackColor = originalEnabledColor;
igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;
}
}
Now the problem is that after the server event is called after postback, all colors become lemon, when hovered/focused. And this behavior propogates since the client side function only sets the enabled color and not the focused/hovered colors. So even when the checkbox is unchecked, the hovered/focused colors remain lemon.
However the "else" part of the if condition (when the skin behavior is restored)
else
{
igcWebTxtEvent.EnabledStyle.BackColor = originalEnabledColor;
igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;
}
works fine when it is restored after a postback. And the main observation is that if I do not add the following two lines:
igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;
the hover/focused background colors remain lemon whereas the enabled style one is the same as the skin which is blue. Because my understanding was setting the enabled style background color sets all background colors as is the case when I am setting it to Lemon but not the case when I am setting it to its original color. Original backcolor also happens to be "None". Which is why I guess this is happening.
This is what I am looking for ideally:
1. When a checkbox is checked, the enabled backcolor becomes lemon however focused/hovered remain white
2. When the the checkbox is unchecked, the original skin behavior is restored.
This has to be handled on both client side and server side due to postbacks. On client side it is working fine. However, on the server side it is not.
Is there any other way of acheiving this? I tried to play around with the style attributes, css attributes on the server side but got nothing to work.
Any help would be greatly appreciated.
Thanks,
Tal
function TP_cancelEvent(e)
{
if(!e) { e = window.event; }
if(e.stopPropagation) { e.stopPropagation(); }
if(e.preventDefault) { e.preventDefault(); }
var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object
var theSelectionObject = editor.getSelection();
var theSelectedElement = theSelectionObject.getParentElement();
alert(
'Event Cancelled.\n\ntheSelectionObject.getHtml()\n\n' + theSelectionObject.getHtml());
e.cancelBubble =
true;
e.cancel =
true;
e.returnValue =
false;
return false;
}

<telerik:RadComboBox
ID="RadComboBox_Broker" runat="server"
Width="200px" Height="115px"
Skin="Vista"
MarkFirstMatch="false" HighlightTemplatedItems="True"
ShowToggleImage="True" AllowCustomText="false" EnableLoadOnDemand="false">
<ItemTemplate>
<div class="qsfexBrokerView">
<img class="qsfexBrokerPic" src='Images/people/<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt="" />
<span class="qsfexBrokerName"><%# DataBinder.Eval(Container, "Text") %></span>
</div>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem
ImagePath="images/black.gif"
Text="Florence Osbourne">
</telerik:RadComboBoxItem>
<telerik:RadComboBoxItem
ImagePath="pic2.jpg"
Text="Ildó Zinnia">
</telerik:RadComboBoxItem>
<telerik:RadComboBoxItem
ImagePath="pic3.jpg"
Text="Josephine Steph">
</telerik:RadComboBoxItem>
<telerik:RadComboBoxItem
ImagePath="pic4.jpg"
Text="Abe Rodney">
</telerik:RadComboBoxItem>
</Items>
</telerik:RadComboBox>