Telerik Forums
UI for WinForms Forum
2 answers
54 views
I've tried implement custom filter as per  Permanent editor in a filter cell - Telerik UI for WinForms instruction
but when I run that project drop down list looks too small to hold its content. Please look at attached screenshot. 

Could you advise me how to properly calculate size of dropdown, or in other way make it fit its content. The only way I found is to set 
 this.dropDown.MinSize = new Size(150, 30); 

inside CreateChildElements method. But I'm not sure this is the best way to fix this issue. Could you please advise me how to handle those kinds of size issues?

Ruslan
Top achievements
Rank 1
Iron
 answered on 23 Jan 2025
1 answer
39 views
           

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!

Willian
Top achievements
Rank 1
Iron
 answered on 03 Dec 2024
2 answers
56 views
I had a question about the Dropdown element, I saw how to search for it, but I couldn't find it for dynamic
    public SearchWarehouseNP()
    {
        InitializeComponent();
        dropdownSettlement.DropDownStyle = RadDropDownStyle.DropDown;
        dropdownSettlement.AutoCompleteMode = AutoCompleteMode.Suggest;

        dropdownSettlement.DropDownListElement.AutoCompleteSuggest = new CustomAutoCompleteSuggestHelperUpdate(
            dropdownSettlement.DropDownListElement,
            async query =>
            {
                if (string.IsNullOrWhiteSpace(query) || query.Length < 3)
                    return Enumerable.Empty<DescriptionTextListDataItem>();

                var response = await _searchSettlementService.GetCityData(query);
                if (response.success && response.data.Any())
                {
                    return response.data.First().Addresses.Select(a => new DescriptionTextListDataItem
                    {
                        Text = $"{a.MainDescription} ({a.Area})",
                        Value = a.MainDescription,
                        DescriptionText = a.Area
                    });
                }

                return Enumerable.Empty<DescriptionTextListDataItem>();
            }
        );

        dropdownSettlement.SelectedIndexChanged += (s, e) =>
        {
            if (dropdownSettlement.SelectedItem is DescriptionTextListDataItem selectedItem)
            {
                Console.WriteLine($"Выбрано: {selectedItem.Text} ({selectedItem.Value})");
            }
        };
    }
}
The problem is that the data is not stored in Items
Console.WriteLine empty

using Telerik.WinControls.UI;

namespace NovaPostOrderManager.Helpers;

public class CustomAutoCompleteSuggestHelperUpdate : AutoCompleteSuggestHelper
{
    private readonly Func<string, Task<IEnumerable<DescriptionTextListDataItem>>> _fetchDataAsync;
    private CancellationTokenSource _cts = new();

    public CustomAutoCompleteSuggestHelperUpdate(RadDropDownListElement owner, Func<string, Task<IEnumerable<DescriptionTextListDataItem>>> fetchDataAsync)
        : base(owner)
    {
        _fetchDataAsync = fetchDataAsync;
    }

    protected override async void SyncItemsCore()
    {
        // Текущий текст из поля ввода
        string currentInput = Filter;

        // Проверяем, нужно ли загружать данные
        if (string.IsNullOrWhiteSpace(currentInput) || currentInput.Length < 3)
        {
            DropDownList.ListElement.Items.Clear();
            DropDownList.ClosePopup();
            return;
        }

        // Отменяем предыдущий запрос
        _cts.Cancel();
        _cts = new CancellationTokenSource();

        try
        {
            // Задержка перед началом запроса
            await Task.Delay(300, _cts.Token);

            // Загружаем данные
            var items = await _fetchDataAsync(currentInput);

            _cts.Token.ThrowIfCancellationRequested();

            DropDownList.ListElement.BeginUpdate();
            DropDownList.ListElement.Items.Clear();

            // Добавляем элементы в выпадающий список
            foreach (var item in items)
            {
                DropDownList.ListElement.Items.Add(item);
            }

            DropDownList.ListElement.EndUpdate();

            if (DropDownList.ListElement.Items.Count > 0)
            {
                DropDownList.ShowPopup(); // Показываем список, если есть элементы
            }
            else
            {
                DropDownList.ClosePopup();
            }
        }
        catch (TaskCanceledException)
        {
            // Запрос был отменён — игнорируем
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Ошибка загрузки данных: {ex.Message}");
        }
    }

    protected override bool DefaultFilter(RadListDataItem item)
    {
        if (item is not DescriptionTextListDataItem descriptionItem)
            return base.DefaultFilter(item);

        return descriptionItem.Text.Contains(Filter, StringComparison.CurrentCultureIgnoreCase) ||
               descriptionItem.DescriptionText.Contains(Filter, StringComparison.CurrentCultureIgnoreCase);
    }
}

hans
Top achievements
Rank 1
Iron
 answered on 29 Nov 2024
1 answer
48 views
Is there a simple way of making a simple DropDownList in the StatusStrip control?  (or any other menu)

Thank you in advance.
Nadya | Tech Support Engineer
Telerik team
 answered on 23 Oct 2024
1 answer
54 views

Hi,

how can I remove the arrow button in a RadTabbedForm header (WinForms)?    Please see the attached photo

Thanks,

Roy

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Oct 2024
1 answer
86 views

Hello,

I am new to WinForms.

Is there a possibility to disable the Arrow for the RadDropDownList ?

When I set the component to readonly, I can still choose a new value via the arrow.

But then the value is never saved because it is read-only.

And wich property do I have to set for this?

 

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Sep 2024
1 answer
68 views

How to fix the issue below where a cell is marked with modified just because the cell was clicked?

Before the datasource is set.

After the datasource is set.

The value was not changed, but it is firing he RowsChanged.

How can avoid it to happen?

Nadya | Tech Support Engineer
Telerik team
 answered on 16 Sep 2024
1 answer
63 views

Hi,

I have an RadDropDownList filled with some record of a table (ttSoc) using DataSource and bounded functionality.

I have a button that lets me add/delete records from this table (ttsoc).
Impossible to update the RadDropDownList

 

my code:

in the form load I run ChargeCodeSociete('InitBe').

In the click button  I run ChargeCodeSociete('affiche').

METHOD PRIVATE VOID BtnSociete_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):

// On instancie la classe
        oFrmSociete = NEW frmSociete().
        // En attente du retour de la form en mode dialog box
        WAIT-FOR oFrmSociete:ShowDialog().

oongDescriptionEtudeGeneral:ChargeCodeSociete('Affiche').

RETURN.

END METHOD.

 

IN oongDescriptionEtudeGenral FORM

METHOD PUBLIC VOID ChargeCodeSociete( INPUT ipcMode AS CHARACTER ):
        CASE ipcMode:
            WHEN 'InitBe' THEN DO:
                beSociete= NEW fichier.description_etude.be.beSociete().

                beSociete:ReadbeSociete(OUTPUT DATASET dsSoc).

                //Associer le query du dataset au probadingSource
                bsSociete:HANDLE = DATASET dsSoc:HANDLE.
            END.
            WHEN 'Affiche' THEN DO:
                DATASET dsSoc:TOP-NAV-QUERY():QUERY-PREPARE("FOR EACH ttSoc").
                DATASET dsSoc:TOP-NAV-QUERY():QUERY-OPEN().   


                DropDownListCodeSociete: ?????

            END.
        END CASE.

 

thank you for your feedback

                                                                                              
Dinko | Tech Support Engineer
Telerik team
 answered on 26 Aug 2024
8 answers
820 views
Hi,

I am unable to highlight the full dropdown list (including the text box and button) 

The attached file will show how it is currently highlight but would like to highlight in the same way(color and thickness) as the textbox in the attached file. I used the below code but it did not highlight the button.

Thanks in advance for your help.



radDDL.DropDownListElement.TextBox.Fill.BackColor = Color.Red;
Todor
Telerik team
 updated answer on 12 Aug 2024
3 answers
131 views

1.RadDropDownList:

  • How can I change the color of the RadDropDownListArrowButtonElement when the mouse triggers the radDropDownList control? I have not been able to find a way to modify this color.I try my best to solve it ,but it works not well.

  • How can I change the color of the dropdown content when the mouse hovers over it? I have also not been able to find a way to modify this color.

  • How can I remove the white shadow under the downward triangle? I want it to be entirely black without any white shadow.

2.RadSpinEditor:

When I use RadSpinEditor, I have the same questions in it.

  • How can I change the color of the dropdown content when the mouse hovers over it?

  • How can I remove the white shadow under the downward triangle?

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 25 Jul 2024
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?