Public Class MyCustomVisualItem
Inherits SimpleListViewVisualItem
Private imageelement As RadImageItem
Private stackLayout As StackLayoutPanel
Protected Overrides Sub CreateChildElements()
MyBase.CreateChildElements()
Me.stackLayout = New StackLayoutPanel()
Me.stackLayout.Orientation = Orientation.Horizontal
Me.stackLayout.EqualChildrenWidth = True
Me.imageelement = New RadImageItem
' Me.imageelement.
Me.imageelement.MinSize = New Size(120, 120)
Me.stackLayout.Children.Add(Me.imageelement)
Me.Children.Add(Me.stackLayout)
End Sub
Protected Overrides Sub SynchronizeProperties()
MyBase.SynchronizeProperties()
Me.Text = ""
Dim myId As Decimal = CType(Me.Data.DataBoundItem, Decimal)
Me.imageelement.Image = loadThumbnail(myId)
'Me.contentElement.Text = Convert.ToString(Me.Data("Name"))
'Me.buttonElement1.Text = "Call " + Convert.ToString(Me.Data("Phone"))
'Me.buttonElement2.Text = "Fax " + Convert.ToString(Me.Data("Fax"))
End Sub
Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
Get
Return GetType(SimpleListViewVisualItem)
End Get
End Property
Private Function loadThumbnail(ByVal iD As Decimal) As Image
Dim temp As Byte() = (From cont In Program.travel_context.images _
Where cont.image_id = iD _
Select cont.icon).First
Dim temp_image As Image = Image.FromStream(New MemoryStream(temp))
Return temp_image
End Function
End Class
Update: Ignore this post or close it. The problem was not the RadComboBox itself.
Best regards
Martin
Hi,
I've a RadComboBox inside a UserControl with the DropDropStyle=DropDownList. I added three elements and after that I selected the third one:
radComboBoxItems.Add(new RadComboBoxItem("1", 1));
radComboBox.Items.Add(new RadComboBoxItem("2", 2));
radComboBox.Items.Add(new RadComboBoxItem("3", 3));
radComboBoxSelectedValue = 3;
I also tried:
radComboBoxSelectedIndex = 2;
In both ways the the SelectedIndex is correct and when the ListBox appears the correct item is selected. But the ComboBox itself doesn't display the selected item. The funny thing is, that the same code works fine on a Windows Form. So, what's the problem there.
Regards
Martin
frmCPBase.MdiParent =
Me
frmCPBase.WindowState = FormWindowState.Maximized
gsResize(frmCPBase, frmCPBase.pnlMain)
frmCPBase.Show()
Public
Sub
gsResize(
ByVal
aoForm
As
Form,
ByVal
aoPnl
As
Panel)
Try
'* Center the MDI Child
If
aoForm.WindowState = 2
Then
'maximized
Dim
yInt
As
Integer
= Screen.PrimaryScreen.WorkingArea.Height / 2 - aoForm.Height / 2
aoForm.Location =
New
Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - aoForm.Width / 2, 120)
If
aoForm.Location.X < 0
Then
aoForm.Location =
New
Point(0, aoForm.Location.Y)
End
If
If
aoForm.Location.Y < 0
Then
aoForm.Location =
New
Point(aoForm.Location.X, 0)
End
If
If
aoForm.Left < 0
Then
aoForm.Location =
New
Point(0, aoForm.Location.Y)
End
If
End
If
'* Center the frame
If
aoForm.WindowState = 2
Then
aoPnl.Location =
New
Point((aoForm.Width / 2) - (aoPnl.Width / 2), (aoForm.Height / 2) - (aoPnl.Height / 2))
Else
aoPnl.Location =
New
Point((aoForm.Width / 2) - (aoPnl.Width / 2), (aoForm.Height / 2) - (aoPnl.Height / 2))
End
If
Catch
ex
As
Exception
End
Try
End
Sub
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial
Class
frmMain
Inherits
System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected
Overrides
Sub
Dispose(
ByVal
disposing
As
Boolean
)
Try
If
disposing
AndAlso
components IsNot
Nothing
Then
components.Dispose()
End
If
Finally
MyBase
.Dispose(disposing)
End
Try
End
Sub
'Required by the Windows Form Designer
Private
components
As
System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private
Sub
InitializeComponent()
Me
.components =
New
System.ComponentModel.Container()
Me
.RadMenuItem4 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuItem5 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuItem3 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuHeaderItem1 =
New
Telerik.WinControls.UI.RadMenuHeaderItem()
Me
.Timer1 =
New
System.Windows.Forms.Timer(
Me
.components)
Me
.cbMarkets =
New
Telerik.WinControls.UI.RadMenuComboItem()
Me
.RadMenuItem2 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.pnl2ndWithLogosAndMenu =
New
Telerik.WinControls.UI.RadPanel()
Me
.pnlRightInfo =
New
Telerik.WinControls.UI.RadPanel()
Me
.btnHelp =
New
Telerik.WinControls.UI.RadButton()
Me
.btnUser =
New
Telerik.WinControls.UI.RadButton()
Me
.lblDateandTime =
New
Telerik.WinControls.UI.RadLabel()
Me
.RadMenu1 =
New
Telerik.WinControls.UI.RadMenu()
Me
.RadMenuItem1 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuItem6 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.pnlFirstBackground =
New
Telerik.WinControls.UI.RadPanel()
CType
(
Me
.pnl2ndWithLogosAndMenu, System.ComponentModel.ISupportInitialize).BeginInit()
Me
.pnl2ndWithLogosAndMenu.SuspendLayout()
CType
(
Me
.pnlRightInfo, System.ComponentModel.ISupportInitialize).BeginInit()
Me
.pnlRightInfo.SuspendLayout()
CType
(
Me
.btnHelp, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.btnUser, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.lblDateandTime, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.RadMenu1, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.pnlFirstBackground, System.ComponentModel.ISupportInitialize).BeginInit()
Me
.pnlFirstBackground.SuspendLayout()
Me
.SuspendLayout()
'
'RadMenuItem4
'
Me
.RadMenuItem4.AutoSize =
False
Me
.RadMenuItem4.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem4.
Class
=
""
Me
.RadMenuItem4.Name =
"RadMenuItem4"
Me
.RadMenuItem4.Text =
"Cycle Processing"
'
'RadMenuItem5
'
Me
.RadMenuItem5.AutoSize =
False
Me
.RadMenuItem5.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem5.
Class
=
""
Me
.RadMenuItem5.Name =
"RadMenuItem5"
Me
.RadMenuItem5.Padding =
New
System.Windows.Forms.Padding(0, 2, 0, 2)
Me
.RadMenuItem5.Text =
"Dunning"
'
'RadMenuItem3
'
Me
.RadMenuItem3.AutoSize =
False
Me
.RadMenuItem3.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem3.
Class
=
""
Me
.RadMenuItem3.Name =
"RadMenuItem3"
Me
.RadMenuItem3.Padding =
New
System.Windows.Forms.Padding(0, 2, 0, 2)
Me
.RadMenuItem3.Text =
"Carrier Provisioning"
'
'RadMenuHeaderItem1
'
Me
.RadMenuHeaderItem1.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.FitToAvailableSize
Me
.RadMenuHeaderItem1.
Class
=
""
Me
.RadMenuHeaderItem1.DisplayStyle = Telerik.WinControls.DisplayStyle.Text
Me
.RadMenuHeaderItem1.Name =
"RadMenuHeaderItem1"
Me
.RadMenuHeaderItem1.Padding =
New
System.Windows.Forms.Padding(5, 5, 0, 0)
Me
.RadMenuHeaderItem1.Text =
"Market"
'
'Timer1
'
'
'cbMarkets
'
Me
.cbMarkets.
Class
=
""
'
'
'
Me
.cbMarkets.ComboBoxElement.ArrowButtonMinWidth = 16
Me
.cbMarkets.ComboBoxElement.DefaultValue =
Nothing
Me
.cbMarkets.ComboBoxElement.EditorElement =
Me
.cbMarkets.ComboBoxElement
Me
.cbMarkets.ComboBoxElement.EditorManager =
Nothing
Me
.cbMarkets.ComboBoxElement.Focusable =
True
Me
.cbMarkets.ComboBoxElement.MaxValue =
Nothing
Me
.cbMarkets.ComboBoxElement.MinValue =
Nothing
Me
.cbMarkets.ComboBoxElement.NullTextColor = System.Drawing.SystemColors.GrayText
Me
.cbMarkets.ComboBoxElement.NullValue =
Nothing
Me
.cbMarkets.ComboBoxElement.OwnerOffset = 0
Me
.cbMarkets.ComboBoxElement.Value =
Nothing
Me
.cbMarkets.Name =
"cbMarkets"
Me
.cbMarkets.Text =
""
'
'RadMenuItem2
'
Me
.RadMenuItem2.AutoSize =
False
Me
.RadMenuItem2.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem2.
Class
=
""
Me
.RadMenuItem2.Name =
"RadMenuItem2"
Me
.RadMenuItem2.Padding =
New
System.Windows.Forms.Padding(0, 2, 0, 2)
Me
.RadMenuItem2.Text =
"Trans Processing"
'
'pnl2ndWithLogosAndMenu
'
Me
.pnl2ndWithLogosAndMenu.BackColor = System.Drawing.Color.Transparent
Me
.pnl2ndWithLogosAndMenu.BackgroundImage = Global.WindowsApplication1.My.Resources.Resources.ClientUtil_Heading
Me
.pnl2ndWithLogosAndMenu.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
Me
.pnl2ndWithLogosAndMenu.Controls.Add(
Me
.pnlRightInfo)
Me
.pnl2ndWithLogosAndMenu.Controls.Add(
Me
.RadMenu1)
Me
.pnl2ndWithLogosAndMenu.Location =
New
System.Drawing.Point(0, 0)
Me
.pnl2ndWithLogosAndMenu.Name =
"pnl2ndWithLogosAndMenu"
Me
.pnl2ndWithLogosAndMenu.Size =
New
System.Drawing.Size(996, 114)
Me
.pnl2ndWithLogosAndMenu.TabIndex = 12
Me
.pnl2ndWithLogosAndMenu.ThemeName =
"Windows7"
'
'pnlRightInfo
'
Me
.pnlRightInfo.Controls.Add(
Me
.btnHelp)
Me
.pnlRightInfo.Controls.Add(
Me
.btnUser)
Me
.pnlRightInfo.Controls.Add(
Me
.lblDateandTime)
Me
.pnlRightInfo.Location =
New
System.Drawing.Point(577, 68)
Me
.pnlRightInfo.Name =
"pnlRightInfo"
Me
.pnlRightInfo.Size =
New
System.Drawing.Size(360, 18)
Me
.pnlRightInfo.TabIndex = 6
CType
(
Me
.pnlRightInfo.GetChildAt(0).GetChildAt(1), Telerik.WinControls.Primitives.BorderPrimitive).Visibility = Telerik.WinControls.ElementVisibility.Hidden
'
'btnHelp
'
Me
.btnHelp.Location =
New
System.Drawing.Point(300, 0)
Me
.btnHelp.Name =
"btnHelp"
'
'
'
Me
.btnHelp.RootElement.ToolTipText =
"Click for HELP"
Me
.btnHelp.Size =
New
System.Drawing.Size(48, 18)
Me
.btnHelp.TabIndex = 7
Me
.btnHelp.Text =
"HELP"
'
'btnUser
'
Me
.btnUser.Location =
New
System.Drawing.Point(250, 0)
Me
.btnUser.Name =
"btnUser"
'
'
'
Me
.btnUser.RootElement.ToolTipText =
"Click to LOG OUT"
Me
.btnUser.Size =
New
System.Drawing.Size(48, 18)
Me
.btnUser.TabIndex = 6
Me
.btnUser.Text =
"UserName"
'
'lblDateandTime
'
Me
.lblDateandTime.AutoSize =
False
Me
.lblDateandTime.ForeColor = System.Drawing.Color.White
Me
.lblDateandTime.Location =
New
System.Drawing.Point(3, 1)
Me
.lblDateandTime.Name =
"lblDateandTime"
'
'
'
Me
.lblDateandTime.RootElement.ForeColor = System.Drawing.Color.White
Me
.lblDateandTime.Size =
New
System.Drawing.Size(234, 16)
Me
.lblDateandTime.TabIndex = 3
Me
.lblDateandTime.Text =
"Date and Time here"
Me
.lblDateandTime.TextAlignment = System.Drawing.ContentAlignment.MiddleRight
'
'RadMenu1
'
Me
.RadMenu1.Dock = System.Windows.Forms.DockStyle.Bottom
Me
.RadMenu1.Items.AddRange(
New
Telerik.WinControls.RadItem() {
Me
.RadMenuItem1,
Me
.RadMenuItem2,
Me
.RadMenuItem3,
Me
.RadMenuItem4,
Me
.RadMenuItem5,
Me
.RadMenuItem6,
Me
.RadMenuHeaderItem1,
Me
.cbMarkets})
Me
.RadMenu1.Location =
New
System.Drawing.Point(0, 64)
Me
.RadMenu1.Name =
"RadMenu1"
Me
.RadMenu1.Size =
New
System.Drawing.Size(996, 50)
Me
.RadMenu1.TabIndex = 0
Me
.RadMenu1.Text =
"RadMenu1"
Me
.RadMenu1.ThemeName =
"Windows7"
'
'RadMenuItem1
'
Me
.RadMenuItem1.AutoSize =
False
Me
.RadMenuItem1.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem1.
Class
=
""
Me
.RadMenuItem1.Name =
"RadMenuItem1"
Me
.RadMenuItem1.Padding =
New
System.Windows.Forms.Padding(4, 2, 0, 2)
Me
.RadMenuItem1.Text =
"System Profiles"
'
'RadMenuItem6
'
Me
.RadMenuItem6.AutoSize =
False
Me
.RadMenuItem6.Bounds =
New
System.Drawing.Rectangle(0, 0, 100, 24)
Me
.RadMenuItem6.
Class
=
""
Me
.RadMenuItem6.MdiList =
True
Me
.RadMenuItem6.Name =
"RadMenuItem6"
Me
.RadMenuItem6.Text =
"Forms"
'
'pnlFirstBackground
'
Me
.pnlFirstBackground.BackgroundImage = Global.WindowsApplication1.My.Resources.Resources.PageHeading_Topstrip2
Me
.pnlFirstBackground.Controls.Add(
Me
.pnl2ndWithLogosAndMenu)
Me
.pnlFirstBackground.Location =
New
System.Drawing.Point(0, 0)
Me
.pnlFirstBackground.Name =
"pnlFirstBackground"
Me
.pnlFirstBackground.Size =
New
System.Drawing.Size(999, 114)
Me
.pnlFirstBackground.TabIndex = 15
Me
.pnlFirstBackground.Text =
"RadPanel2"
Me
.pnlFirstBackground.ThemeName =
"Windows7"
'
'frmMain
'
Me
.AutoScaleDimensions =
New
System.Drawing.SizeF(6.0!, 13.0!)
Me
.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me
.ClientSize =
New
System.Drawing.Size(892, 526)
Me
.Controls.Add(
Me
.pnlFirstBackground)
Me
.IsMdiContainer =
True
Me
.Name =
"frmMain"
Me
.Text =
"Client Utility Center"
Me
.WindowState = System.Windows.Forms.FormWindowState.Maximized
CType
(
Me
.pnl2ndWithLogosAndMenu, System.ComponentModel.ISupportInitialize).EndInit()
Me
.pnl2ndWithLogosAndMenu.ResumeLayout(
False
)
Me
.pnl2ndWithLogosAndMenu.PerformLayout()
CType
(
Me
.pnlRightInfo, System.ComponentModel.ISupportInitialize).EndInit()
Me
.pnlRightInfo.ResumeLayout(
False
)
CType
(
Me
.btnHelp, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.btnUser, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.lblDateandTime, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.RadMenu1, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.pnlFirstBackground, System.ComponentModel.ISupportInitialize).EndInit()
Me
.pnlFirstBackground.ResumeLayout(
False
)
Me
.ResumeLayout(
False
)
End
Sub
Friend
WithEvents
RadMenuItem4
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuItem5
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuItem3
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuHeaderItem1
As
Telerik.WinControls.UI.RadMenuHeaderItem
Friend
WithEvents
Timer1
As
System.Windows.Forms.Timer
Friend
WithEvents
cbMarkets
As
Telerik.WinControls.UI.RadMenuComboItem
Friend
WithEvents
RadMenuItem2
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
pnl2ndWithLogosAndMenu
As
Telerik.WinControls.UI.RadPanel
Friend
WithEvents
pnlRightInfo
As
Telerik.WinControls.UI.RadPanel
Friend
WithEvents
btnHelp
As
Telerik.WinControls.UI.RadButton
Friend
WithEvents
btnUser
As
Telerik.WinControls.UI.RadButton
Friend
WithEvents
lblDateandTime
As
Telerik.WinControls.UI.RadLabel
Friend
WithEvents
RadMenu1
As
Telerik.WinControls.UI.RadMenu
Friend
WithEvents
RadMenuItem1
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuItem6
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
pnlFirstBackground
As
Telerik.WinControls.UI.RadPanel
End
Class
Hi,
I have setup a dataSet with 3 tables Locations,Customers and Orders. I have setup 3 relations "Locations to Customers" , "Locations to Orders" and "Customers to Orders"
I have a form that has two GridViews one to show All the Customers and one to show the Selected Customers Orders.
I have done this by:
MainForm.DataSource = FormData;
MainForm.DataMember =
"Customers"
;
SubForm.DataSource = FormData;
SubForm.DataMember =
"Customers.Customers_Orders"
;