Combo in Hirarchy

Posted by: vishnupriya on 8 September 2017, 2:16 pm EST

  • Posted 8 September 2017, 2:16 pm EST

    HI,


    Some one can help us How to make one column in the Hirarchical view, having 3 levels of data as a combobox type. Please note the items in the combo box will differ at the first,second and third level (I have three lists of data avialable.).


    I am able to bind the combo box at the parent level. But Not sure How I can do it at child levels with differnt items in the combo box?


    Some one can help us?



    Thanks in advance,
    Vishnupriya

  • Replied 8 September 2017, 2:16 pm EST

    Hi,


    For dispalying the combo box in the hirarchical view ( 3 leavels), I am using the below code.
    BUt this is not working properly.


    First time it is coming for parent rows. When I am exapnding the first level, the combo box is not displaying. When I exapnd the second level then in the first level, combo box is displaying and in the second level is not displaying.
    If I am exapnding the other parent row, then teh above second level combo is dispalying.. But same case for again other rows.


    Can some one can help us why it is happening. Is there any wrong in the code?


    Code is attached here.



      FarPoint.Win.Spread.Model.DefaultSheetDataModel objDSDM;
                    objDSDM = (FarPoint.Win.Spread.Model.DefaultSheetDataModel)fpSpreadRangeDecision.Sheets[0].Models.Data;
                   
      int intRangeCodeColPOS = objDSDM.GetColumnIndex("STATUS");
                   
                    fpSpreadRangeDecision.ActiveSheet.Columns[intRangeCodeColPOS].CellType = cmboStatus1;
                   
                    ArrayList alSht1 = fpSpreadRangeDecision.Sheets[0].GetChildSheets();
                    ArrayList alSht2;             


                    FarPoint.Win.Spread.SpreadView childvw, grandchildvw;
                    foreach (FarPoint.Win.Spread.SheetView chlSht1 in alSht1)
                    {
                        childvw = fpSpreadRangeDecision.GetRootWorkbook().GetSpreadView(chlSht1, 0, 0);
                        if (childvw != null)
                        {
                            childvw.Sheets[0].Columns[intRangeCodeColPOS].CellType = cmboStatus2;


                            alSht2 = chlSht1.GetChildSheets();                     
                                foreach (FarPoint.Win.Spread.SheetView chlSht2 in alSht2)
                                {
                                    grandchildvw = childvw.GetSpreadView(chlSht2, 0, 0);
                                    if (grandchildvw != null)
                                    {
                                        grandchildvw.Sheets[0].Columns[intRangeCodeColPOS].CellType = cmboStatus3;                                  
                                    }
                                }
                        }
                    }


    Thanks in advance,
    Vishnupriya  

  • Replied 8 September 2017, 2:16 pm EST

    Hello,

    You may try setting up the combo cell in ChildViewCreated Event. It seems to be working fine for me,



    Normal
    0




    false
    false
    false

    EN-US
    X-NONE
    X-NONE













    MicrosoftInternetExplorer4





























































































































































    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin-top:0in;
    mso-para-margin-right:0in;
    mso-para-margin-bottom:10.0pt;
    mso-para-margin-left:0in;
    line-height:115%;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;}



    Private Sub FpSpread1_ChildViewCreated(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ChildViewCreatedEventArgs) Handles FpSpread1.ChildViewCreated



    Dim cbstr As String()



    cbstr = New String() {"Jan", "Feb",
    "Mar", "Apr",
    "May", "Jun"}



    Dim cmbocell As New
    FarPoint.Win.Spread.CellType.ComboBoxCellType()



    cmbocell.Items = cbstr



    cmbocell.AutoSearch =
    FarPoint.Win.AutoSearch.SingleCharacter



    cmbocell.Editable = True



    cmbocell.MaxDrop = 4



    e.SheetView.Columns(0).CellType
    = cmbocell



    End Sub

    It works for all the Ievels. I hope it will help you.

    Thanks,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels