This is a migrated thread and some comments may be shown as answers.

[Solved] Global Setting for ExpandAnimation

8 Answers 210 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
jsearl
Top achievements
Rank 1
jsearl asked on 29 May 2009, 04:00 PM
Hello,

Is there a way I can set the default ExpandAnimation duration setting globally or in the Skin file without having to update every RadComboBox in my application?  Any help here would be appreciated.

Thanks,
Jeremy

8 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 01 Jun 2009, 11:18 AM
Hello jsearl,

The Expand-/Collapse- Animation properties cannot be set globally via a Skin file.

Please try using another approach - add a Key in the <appSettings> section of the web.config and specify the Animation Type and Duration there.

Inherit from the RadComboBox control, override its OnPreRender method and set the corresponding properties as specified in the web.config.

Alternatively you could create a base page (and inherit other pages from it) which would do the same in its OnPreRender method.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Tobias
Top achievements
Rank 1
answered on 13 Dec 2009, 02:29 PM
Hi,

can you probably give an example for the <appSettings> section of the web.config
to control the expand and collapse animazion of all comboboxes in the application?

Thanks a lot,
Tobi
0
Simon
Telerik team
answered on 14 Dec 2009, 10:57 AM
Hello Tobias,

Yes, here is an example: provided that you have added the following to the AppSettings section of your web.config file:

<appSettings>
    <add key="RCBExpandAnimationType" value="InExpo" />
    <add key="RCBExpandAnimationDuration" value="2000" />
</appSettings>

you could then use these values to set the ExpandAnimation properties (advisably in the Page_PreRender event handler):

protected void Page_PreRender(object sender, EventArgs e)
{
    RadComboBox1.ExpandAnimation.Type = (AnimationType) Enum.Parse(typeof(AnimationType), ConfigurationManager.AppSettings["RCBExpandAnimationType"]);
    RadComboBox1.ExpandAnimation.Duration = int.Parse(ConfigurationManager.AppSettings["RCBExpandAnimationDuration"]);
}

I hope this is helpful.

Regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tobias
Top achievements
Rank 1
answered on 14 Dec 2009, 11:05 AM
Thanks for your replay, Simon.

When I understand that correct, there isn't a possibility to define the animation of all my Comboboxes once and not to have to set collapse-, expandanimation...  for each combo on every site?
0
Simon
Telerik team
answered on 14 Dec 2009, 11:18 AM
Hi Tobias,

Indeed, using this approach you still need to write the code in each page using a RadComboBox.

Another approach requiring less code and is easier to implement is to inherit from RCB and set the Expand/Collapse Animation properties in the PreRender method override as opposed to doing so in the Page_PreRender on each page.

Still you will need to update the references of all RCBs across you project to use the inherited version of the control.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tobias
Top achievements
Rank 1
answered on 14 Dec 2009, 11:24 AM
OK, thanks.
This just could be a feature request to set a property once in web.config.
(My customer don't like the animations. He wants all RCBs to open and close with animation set to "None")
0
Simon
Telerik team
answered on 14 Dec 2009, 03:31 PM
Hello Tobias,

Actually there is another approach which requires even less setup and code - Themes.

You could define a default Theme which will set the [Expand/Collapse]Animation- Type/Duration properties to RadComboBox so that they apply to all of your pages.

Here is an example of a simple Theme doing just as described above:

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<telerik:RadComboBox runat="server" ExpandAnimation-Type="None" ExpandAnimation-Duration="0"
    CollapseAnimation-Type="None" CollapseAnimation-Duration="0" />

I hope this helps.

All the best,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tobias
Top achievements
Rank 1
answered on 14 Dec 2009, 03:54 PM
Hello Simon,

that did it! This was exactly what I needed.
Thank you very much. I like telerik support.
You are all doing a great job.

Thanks
Tags
ComboBox
Asked by
jsearl
Top achievements
Rank 1
Answers by
Simon
Telerik team
Tobias
Top achievements
Rank 1
Share this question
or