Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > MultiColumn ComboBox > Group Header text problem

Not answered Group Header text problem

Feed from this thread
  • Ian avatar

    Posted on Dec 5, 2011 (permalink)

    Hi Telerik

    I am building a multicolumn dropdown list in which I wish to use grouping. The grid has three columns, SecurityType, InstrumentGroup and Instrument. I want to group on SecurityType and within that grouping by InstrumentGroup so as to create a little hierarchy to act as a visual aid in selection.

    If I allow manual grouping and drag the required columns to the group panel everything works fine but if I attempt to achieve the grouping programmaically the group header text for the InstrumentGroup header shows the same text as the SecurityType header.

    I have attached the relevant snippet in the hope that you will have some insight into this one. Please note the commented out code was left in so you could see the other method I tried.

    Regards
    Ian Carson

    Grid is setup like so..

    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);
    }


    Data is entered using this method and for testing there is only a single row as follows:
    SecurityType="Forex", InstrumentGroup="EUR", Instrument="EUR/USD"

    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);
          
    }




     

    Reply

  • Julian Benkov Julian Benkov admin's avatar

    Posted on Dec 8, 2011 (permalink)

    Hello Ian,

    Please send me screenshots of the different results that come from the manual UI input on one hand and the API grouping operation on the other hand. This will help me provide you with further assiatance. Thank you for your cooperation.

    Best wishes,
    Julian Benkov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > MultiColumn ComboBox > Group Header text problem
Related resources for "Group Header text problem"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]