or
private void GenerateMComboGrids() { mcboInstrument.AutoSizeDropDownToBestFit = true; mcboInstrumentComboElement = mcboInstrument.MultiColumnComboBoxElement; mcboInstrumentComboElement.MultiColumnPopupForm.DropDownAnimationDirection = RadDirection.Left | RadDirection.Down; mcboInstrumentComboElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom; mcboInstrumentComboElement.DropDownHeight = 100; mcboInstrumentComboElement.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; mcboInstrumentComboElement.EditorControl.MasterTemplate.AutoGenerateColumns = false; mcboInstrumentComboElement.EditorControl.ShowGroupedColumns = false; mcboInstrumentComboElement.EditorControl.ShowRowHeaderColumn = false; mcboInstrumentComboElement.EditorControl.EnableGrouping = true; mcboInstrumentComboElement.EditorControl.AutoExpandGroups = true; mcboInstrumentComboElement.EditorControl.ShowGroupPanel = false; mcboInstrumentComboElement.RightToLeft = true; GridViewTextBoxColumn column = new GridViewTextBoxColumn("SecurityType"); column.HeaderText = "Security Type"; mcboInstrumentComboElement.EditorControl.Columns.Add(column); GridViewTextBoxColumn column2 = new GridViewTextBoxColumn("InstrumentGroup"); column2.HeaderText = "Instrument Group"; mcboInstrumentComboElement.EditorControl.Columns.Add(column2); GridViewTextBoxColumn column3 = new GridViewTextBoxColumn("Instrument"); column3.HeaderText = "Instrument"; mcboInstrumentComboElement.EditorControl.Columns.Add(column3); mcboInstrumentComboElement.EditorControl.GroupDescriptors.Expression = "SecurityType ASC; InstrumentGroup ASC"; //GroupDescriptor descriptor = new GroupDescriptor(); //descriptor.GroupNames.Add("SecurityType", ListSortDirection.Ascending); //GroupDescriptor descriptor2 = new GroupDescriptor(); //descriptor2.GroupNames.Add("InstrumentGroup", ListSortDirection.Ascending); //mcboInstrumentComboElement.EditorControl.GroupDescriptors.Add(descriptor); //mcboInstrumentComboElement.EditorControl.GroupDescriptors.Add(descriptor2); //mcboInstrumentComboElement.EditorControl.GroupSummaryEvaluate += new GroupSummaryEvaluateEventHandler(EditorControl_GroupSummaryEvaluate); }private void PopulateInstrumentList() { StrategyDistinctInstruments instruments = new StrategyDistinctInstruments(ThisVariation.StrategyVariation); Dictionary<string, BacktestInstrument> uniqueInstruments = instruments.UniqueInstruments; mcboInstrumentComboElement.EditorControl.TableElement.BeginUpdate(); foreach (KeyValuePair<string, BacktestInstrument> kvp in uniqueInstruments) { GridViewRowInfo rowInfo = mcboInstrumentComboElement.EditorControl.Rows.AddNew(); rowInfo.Tag = kvp.Value.Inst; rowInfo.Cells[0].Value = kvp.Value.SecurityType; rowInfo.Cells[1].Value = kvp.Value.InstrumentGroup; rowInfo.Cells[2].Value = kvp.Value.Inst.Name; } mcboInstrumentComboElement.EditorControl.TableElement.EndUpdate(true); }Private Sub rgvContractDetails_CellEndEdit(sender As Object, e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles rgvContractDetails.CellEndEdit Try If rgvContractDetails.SelectedRows.Count > 1 Then Select Case e.Column.Name Case "Quantity" For Each Row As GridViewRowInfo In rgvContractDetails.SelectedRows Dim oSelectedItem As SalesContractDetail = Row.DataBoundItem Row.Cells("Quantity").Value = e.Value oSelectedItem.QuantityStr = e.Value oSelectedItem.CalculateBalance() Row.Cells("QtyBalance").Value = oSelectedItem.BalanceStr Next Case "QtyCancel" For Each Row As GridViewRowInfo In rgvContractDetails.SelectedRows Dim oSelectedItem As SalesContractDetail = Row.DataBoundItem Row.Cells("QtyCancel").Value = e.Value oSelectedItem.CancelStr = e.Value oSelectedItem.CalculateBalance() Row.Cells("QtyBalance").Value = oSelectedItem.BalanceStr Row.Cells("CancelDate").Value = Today.ToShortDateString Next End If Catch ex As Exception MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End TryEnd Sub