Item appears duplicated in the popup when selected Desert Theme

1 Answer 16 Views
DropDownList Themes and Visual Style Builder
Willian
Top achievements
Rank 1
Iron
Willian asked on 02 Dec 2024, 12:41 PM | edited on 02 Dec 2024, 12:44 PM
           

Hello,

 

How do i make the item appear only once in the popup when the theme is Desert?

 

1 - Without Theme

 

2 - Desert Theme

 

Code:

 

      List<TecnicoServicoInfo> listaTecnicos = new List<TecnicoServicoInfo>();

            TecnicoServicoInfo tec = new TecnicoServicoInfo();
            tec.CdFuncionario = -1;
            tec.DsFuncionario = " ";
            TecnicoServicoInfo tec1 = new TecnicoServicoInfo();
            tec1.CdFuncionario = 80;
            tec1.DsFuncionario = "robsu";
            TecnicoServicoInfo tec2 = new TecnicoServicoInfo();
            tec2.CdFuncionario = 1558;
            tec2.DsFuncionario = "joelssu";
            TecnicoServicoInfo tec4 = new TecnicoServicoInfo();
            tec4.CdFuncionario = 333;
            tec4.DsFuncionario = "TESTE UM NOME MAIOR QUE TODOS OS OUTROS PARA VER O TEMA";
            listaTecnicos.Add(tec);
            listaTecnicos.Add(tec2);
            listaTecnicos.Add(tec1);
            listaTecnicos.Add(tec4);
            listaTecnicos = listaTecnicos.OrderBy(x => x.DsFuncionario).ToList();

            ddlTecnico.DropDownStyle = RadDropDownStyle.DropDown;
            ddlTecnico.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            ddlTecnico.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
            ddlTecnico.Items.Clear();

            ddlTecnico.DescriptionTextMember = "DsFuncionario";
            ddlTecnico.ValueMember = "CdFuncionario";
            ddlTecnico.DisplayMember = "DsFuncionario";

            ddlTecnico.DataSource = listaTecnicos;


            ddlproxima.DropDownStyle = RadDropDownStyle.DropDown;
            ddlproxima.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            ddlproxima.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
            ddlproxima.Items.Clear();

            ddlproxima.DescriptionTextMember = "DsFuncionario";
            ddlproxima.ValueMember = "CdFuncionario";
            ddlproxima.DisplayMember = "DsFuncionario";


            ddlproxima.DataSource = listaTecnicos;

            ddlproxima.AutoSizeItems = false;
            ddlproxima.AutoSize = false;

 

Telerik version: 23.2.718

 

Thank You!

1 Answer, 1 is accepted

Sort by
0
Willian
Top achievements
Rank 1
Iron
answered on 03 Dec 2024, 02:39 PM

I've found out why it was "duplicating".

 

In fact it wasnt duplicating what happens is that displaymember = textmember 

 

i've just deleted that line and it worked as expected.

 

Thanks

Nadya | Tech Support Engineer
Telerik team
commented on 04 Dec 2024, 06:17 PM

Hello, Willian,

I am really glad to see that you have managed to fix the item's text which appears duplicated on your side. The DescriptionTextMember property sets a property name which will be used to extract a text for description text from the data items. When set, you should see the descriptions for the items. Not setting it, will not show description text which is your desired behavior. 

If you have any other questions, do not hesitate to contact me.

Tags
DropDownList Themes and Visual Style Builder
Asked by
Willian
Top achievements
Rank 1
Iron
Answers by
Willian
Top achievements
Rank 1
Iron
Share this question
or