Skip to Content
author's profile photo Former Member
Former Member

How to add next/ new row in a matrix by pressing tab

Hi all,

I have a matrix in that, to add a new/ next row i call the add row menu but i need the row to add automatically by simply pressing the TAB key.

How should i do that??

Help me solving this issue.

Regards,

Jananisuba S

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2013 at 02:33 PM

    Hi Jananisuba,


    If you want to add Row in matrix ob pressing TAB key you can refer following code. It works

    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_KEY_DOWN && pVal.CharPressed == 9 && pVal.ItemUID == "matStd" && pVal.ColUID == "V6")

    {

    oForm = clsAddOn.LDNA_Application.Forms.GetForm("CBF_SCE", pVal.FormTypeCount);

    int i = oMat.VisualRowCount;

    if (oMat.Columns.Item("V6").Cells.Item(i).Specific.Value != "" )

    {

    BubbleEvent = true;

    SAPbouiCOM.DBDataSource dbData = default(SAPbouiCOM.DBDataSource);

    dbData = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item(1);

    dbData.Clear();

    oMat.AddRow();

    oMat.Columns.Item("V0").Cells.Item(pVal.Row + 1).Specific.Value = pVal.Row + 1;

    oMat.Columns.Item("V1").Cells.Item(pVal.Row + 1).Click(SAPbouiCOM.BoCellClickType.ct_Regular);

    }

    }

    -Thanks and regards

    vikas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2013 at 08:54 AM

    Hi Jananisuba,

    Catch the after BoEventTypes.et_KEY_DOWN event, check that the key pressed was tab and then call the matrix/grid add row method.

    You can also add your conditions for the adding of the row on the KeyDown event (e.g.: only add the row if we are on the correct column).


    Best regards,

    Pedro Magueija


    View Pedro Magueija's profile on LinkedIn

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.