Hello Peter,
Thank you for writing back.
Here is a sample code snippet demonstrating how to create a
RadDropDownList similar to the one filled with scheduler's backgrounds:
Public
Class
CustomAppointmentEditForm
Private
Function
CreateImageByBackgroundInfo(backgroundInfo
As
IAppointmentBackgroundInfo)
As
Image
Dim
defaultImageSize
As
New
Size(11, 11)
Dim
image
As
New
Bitmap(defaultImageSize.Width, defaultImageSize.Height)
Dim
graphics__1
As
Graphics = Graphics.FromImage(image)
Dim
rect
As
New
Rectangle(Point.Empty, defaultImageSize)
rect.Inflate(-1, -1)
Using path
As
GraphicsPath = (
New
RoundRectShape(1)).CreatePath(rect)
Using gradientBrush
As
New
LinearGradientBrush(rect, backgroundInfo.BackColor, _
backgroundInfo.BackColor2, backgroundInfo.GradientAngle)
graphics__1.FillPath(gradientBrush, path)
End
Using
Using pen
As
New
Pen(backgroundInfo.BorderColor)
graphics__1.DrawPath(pen, path)
End
Using
End
Using
Return
image
End
Function
Protected
Overrides
Sub
LoadBackgrounds()
MyBase
.LoadBackgrounds()
Dim
scheduler
As
RadScheduler = TryCast(
Me
.SchedulerData, RadScheduler)
Me
.RadDropDownList1.DataSource = scheduler.GetBackgroundStorage()
Me
.RadDropDownList1.DisplayMember =
"DisplayName"
Me
.RadDropDownList1.ValueMember =
"Id"
For
Each
item
As
RadListDataItem
In
Me
.RadDropDownList1.Items
item.Image = CreateImageByBackgroundInfo(item.DataBoundItem)
Next
End
Sub
End
Class
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the
Telerik Feedback Portal and vote to affect the priority of the items