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

Same properties on multiple Comboboxes.

1 Answer 90 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Aamir
Top achievements
Rank 1
Aamir asked on 07 Apr 2020, 11:04 AM

I have 4 Comboboxes on my pages, I want each of them to have same properties like

EnableAutomaticLoadOnDemand="true"

EnableVirtualScrolling="true"

Filter="Contains"

ItemsPerRequest="15"

MarkFirstMatch="True"

Skin="Default"

EnableLoadOnDemand="True"

ShowMoreResultsBox="True"

 

How can I achieve it without having to write same properties for each of them?

1 Answer, 1 is accepted

Sort by
0
Doncho
Telerik team
answered on 09 Apr 2020, 04:35 PM

Hello Aamir,

For similar scenarios, you can utilize the ASP.NET Themes and Skins, see ASP.NET Themes and Skins.

For example, you can create a Skins file where you will define all the properties you want the ComboBoxes to inherit Globally.

mySkin.skin

<telerik:RadComboBox
            SkinId = "mySkin"
            runat="server"
            EnableVirtualScrolling="true"
            Filter="Contains"
            ItemsPerRequest="15"
            MarkFirstMatch="true"
            Skin="Default"
            ShowMoreResultsBox="true"></telerik:RadComboBox>

 

In the ASPX page, you will need to register the desired Skin:

<%@ Page Language="C#" AutoEventWireup="true" Theme="mySkin" CodeFile="Default.aspx.cs" Inherits="Default" %>

 

From this point on, you can make the ComboBoxes inherit the properties of the mySkin.skin file by setting their SkinID:

<telerik:RadComboBox runat="server" ID="RadComboBox1" SkinID="mySkin" />
<telerik:RadComboBox runat="server" ID="RadComboBox2" SkinID="mySkin" />
<telerik:RadComboBox runat="server" ID="RadComboBox3" SkinID="mySkin" />
<telerik:RadComboBox runat="server" ID="RadComboBox4" SkinID="mySkin" />
<telerik:RadComboBox runat="server" ID="RadComboBox5" SkinID="mySkin" />
<telerik:RadComboBox runat="server" ID="RadComboBox6" SkinID="mySkin" />

 

Kind regards,
Doncho
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ComboBox
Asked by
Aamir
Top achievements
Rank 1
Answers by
Doncho
Telerik team
Share this question
or