I use a RadDropDownList, I want to give the user the ability to search the items in the drop down so I use the default DropDownStyle = DropDown with AutoCompleteMode = SuggestAppend.
However, I want to ensure that the user selects a valid item from the list and doesn't leave random text. So I created the extension method EnsureValidSelection() below that remembers the original value, and on validation resets it to that original value if no valid value is now selected.
This works well when the ValueMember is an int. But when it's a string, it ignores the code that sets the SelectedValue.
public static void EnsureValidSelection(this RadDropDownList combo)
{
object originalValue = null;
combo.Enter += DropDownEnter;
combo.SelectedValueChanged += DropDownSelectedValueChanged;
combo.Validated += DropDownValidated;
return;
void DropDownEnter(object sender, EventArgs e)
{
originalValue = ((RadDropDownList)sender).SelectedValue;
}
void DropDownSelectedValueChanged(object sender, EventArgs e)
{
if (originalValue != null && combo.SelectedValue != null)
originalValue = combo.SelectedValue;
}
void DropDownValidated(object sender, EventArgs e)
{
if (combo.SelectedValue == null)
combo.SelectedValue = originalValue;
originalValue = null;
}
}
Hi, Telerik Team.
I’m using Telerik UI for WinForms 2015 Q1 with a custom theme, and I want the text color to remain black even when the control is disabled. Currently, when Enabled=False, the text automatically becomes gray.
My goal is for the text color to be black in both Enabled and Disabled states.
This already works for RadTextBox, using the HostedTextBoxBase approach from the forum.
However, for the following controls, the text still becomes gray when disabled:
RadDropDownList
RadDateTimePicker
I already modified the Disabled state in Visual Style Builder and updated elements like RadDropDownTextBoxElement and TextBoxFill(Fill Primitive). I’ve attached my .tssp file.
Could you please review the .tssp and let me know if there is any incorrect setting, or if I’m modifying the wrong element to keep the disabled text color black?
Also, if there is a recommended way to achieve this without using Visual Style Builder (for example programmatically), I would appreciate your guidance.
Thank you.

this.dropDown.MinSize = new Size(150, 30);
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!

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

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?

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?

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
