or
public class CustomDropDownListEditor : RadDropDownListEditor{ protected override RadElement CreateEditorElement() { return new CustomDropDownListEditorElement(); }} public class CustomDropDownListEditorElement : RadDropDownListEditorElement{ protected override RadPopupControlBase CreatePopupForm() { this.Popup = new CustomDropDownPopupForm(this); this.Popup.VerticalAlignmentCorrectionMode = AlignmentCorrectionMode.SnapToOuterEdges; this.Popup.SizingMode = this.DropDownSizingMode; this.Popup.Height = this.DropDownHeight; this.Popup.HorizontalAlignmentCorrectionMode = AlignmentCorrectionMode.Smooth; this.Popup.RightToLeft = this.RightToLeft ? System.Windows.Forms.RightToLeft.Yes : System.Windows.Forms.RightToLeft.Inherit; this.WirePopupFormEvents(this.Popup); return Popup; }} public class CustomDropDownPopupForm : DropDownPopupForm{ public CustomDropDownPopupForm(RadDropDownListElement owner): base(owner) {} public override string ThemeClassName { get { return typeof(DropDownPopupForm).FullName; } set {} } public override void ClosePopup(PopupCloseInfo info) { base.ClosePopup(info); if (info.CloseReason == RadPopupCloseReason.Keyboard) { ((RadGridView)this.OwnerElement.ElementTree.Control).EndEdit(); } } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); ((RadGridView)this.OwnerElement.ElementTree.Control).EndEdit(); }}You should handle the EditorRequired event to replace the editor:void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e){ if (e.EditorType == typeof(RadDropDownListEditor)) { e.EditorType = typeof(CustomDropDownListEditor); }}
For those who might want to use this, I have created a quick sample on how to use linq to create dynamic series for chartview:
Example is created in VS2010 / VB.NET
Make sure you import:
System.Data.DataSetExtensions.dll
to use linq.
Me.RadChartView1.ShowLegend = TrueMe.RadChartView1.ShowTitle = TrueMe.RadChartView1.Title = "Sold products per country" Dim graphSeries As New DataTable() graphSeries.Columns.Add("Category", GetType(String)) graphSeries.Columns.Add("Value", GetType(Integer)) graphSeries.Columns.Add("XValue", GetType(String)) graphSeries.Rows.Add("Netherlands", 10, "2011") graphSeries.Rows.Add("USA", 12, "2011") graphSeries.Rows.Add("Germany", 7, "2011") graphSeries.Rows.Add("Netherlands", 25, "2012") graphSeries.Rows.Add("USA", 40, "2012") graphSeries.Rows.Add("Germany", 25, "2012") Dim productGroups = From p In graphSeries _ Group p By Category = p.Field(Of String)("Category") Into Group _ Select Category, ProductGroup = Group For Each g In productGroups Dim barSeries As New Telerik.WinControls.UI.BarSeries("Value", "Category") barSeries.Name = g.Category barSeries.ValueMember = "Value" barSeries.CategoryMember = "XValue" barSeries.ShowLabels = True barSeries.LegendTitle = g.Category Me.RadChartView1.Series.Add(barSeries) barSeries.CombineMode = Telerik.Charting.ChartSeriesCombineMode.Stack barSeries.DataSource = g.ProductGroup.CopyToDataTable Next
radGridView1.CurrentRow.Cells[radGridView1.CurrentColumn.Name].Value.ToString()// // MachineTypeDropDownList // this.MachineTypeDropDownList.AutoCompleteDisplayMember = "M_Type"; this.MachineTypeDropDownList.AutoCompleteValueMember = "MachineID"; this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", this.machineDataBindingSource, "MachineID", true)); this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("SelectedItem", this.machineDataBindingSource, "M_Name", true)); this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.machineDataBindingSource, "MachineID", true)); this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.machineDataBindingSource, "M_Name", true)); this.MachineTypeDropDownList.DataSource = this.machineDataBindingSource; this.MachineTypeDropDownList.DisplayMember = "M_Type"; this.MachineTypeDropDownList.Location = new System.Drawing.Point(182, 52); this.MachineTypeDropDownList.Name = "MachineTypeDropDownList"; this.MachineTypeDropDownList.Size = new System.Drawing.Size(136, 20); this.MachineTypeDropDownList.TabIndex = 0; this.MachineTypeDropDownList.Text = "System.Data.DataViewManagerListItemTypeDescriptor"; this.MachineTypeDropDownList.ValueMember = "MachineID"; this.MachineTypeDropDownList.DataBindingComplete += new Telerik.WinControls.UI.ListBindingCompleteEventHandler(this.MachineTypeDropDownList_DataBindingComplete); this.MachineTypeDropDownList.Initialized += new System.EventHandler(this.MachineTypeDropDownList_Initialized);this.MachineTypeDropDownList.DropDownListElement.Items.Count
or
this.MachineTypeDropDownList.Items.Count private void MachineTypeDropDownList_DataBindingComplete(object sender, Telerik.WinControls.UI.ListBindingCompleteEventArgs e) { System.Diagnostics.Debug.WriteLine("this.MachineTypeDropDownList.DropDownListElement.Items --------------------------------" + this.MachineTypeDropDownList.DropDownListElement.Items.Count); System.Diagnostics.Debug.WriteLine("this.MachineTypeDropDownList.Items --------------------------------" + this.MachineTypeDropDownList.Items.Count); }private void MachineTypeDropDownList_Initialized(object sender, EventArgs e){}