Hello, Sandor,
You can create a custom
AutoCompleteSuggestHelper and customize its popup form in order to add a
RadButton. You can find below a sample code snippet which result is illustrated in the provided screenshot:
public
RadForm1()
{
InitializeComponent();
for
(
int
i = 0; i < 100; i++)
{
this
.radDropDownList1.Items.Add(
"Item"
+ i);
}
this
.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest;
this
.radDropDownList1.DropDownListElement.AutoCompleteSuggest =
new
CustomAutoCompleteSuggestHelper(
this
.radDropDownList1.DropDownListElement);
this
.radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.VisualItemFormatting += DropDownList_VisualItemFormatting;
}
private
void
DropDownList_VisualItemFormatting(
object
sender, Telerik.WinControls.UI.VisualItemFormattingEventArgs args)
{
args.VisualItem.DrawFill =
true
;
args.VisualItem.BackColor = Color.Yellow;
args.VisualItem.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}
public
class
CustomAutoCompleteSuggestHelper : AutoCompleteSuggestHelper
{
public
CustomAutoCompleteSuggestHelper(RadDropDownListElement owner) :
base
(owner)
{
}
protected
override
RadDropDownListElement CreateDropDownElement()
{
return
new
CustomRadDropDownListElement();
}
}
public
class
CustomRadDropDownListElement : RadDropDownListElement
{
protected
override
RadPopupControlBase CreatePopupForm()
{
DropDownPopupForm form =
base
.CreatePopupForm()
as
DropDownPopupForm;
StackLayoutElement stack =
new
StackLayoutElement();
stack.Orientation = Orientation.Horizontal;
RadButtonElement button1 =
new
RadButtonElement();
button1.Text =
"Button1"
;
button1.StretchHorizontally =
false
;
button1.StretchVertically =
false
;
stack.Children.Add(button1);
DockLayoutPanel.SetDock(button1, Telerik.WinControls.Layouts.Dock.Bottom);
button1.StretchHorizontally =
true
;
form.SizingGripDockLayout.Children.Insert(1, button1);
return
form;
}
}
Should you have further questions please let me know.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.