cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member183246
Participant
0 Kudos

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

Former Member
0 Kudos

Hi Vikas,

Thank you for the Help, its working fine.

Regards,

Janani

Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

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