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

Get the selected Row

Hi ,everyone , I want to get the selected row number ,and in the matrix ,the row is multiselected , and I use the GetNextSelectedRow, but I always get the same index ,and how can i get other index .

if you have the codes that can help me ,please post it here , thanks .

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, 2005 at 07:13 AM

    Hi Dave,

    If you use GetNextSelectedRow you have to specify a start position (this is an optional variable). Declaration of function:

    Public Function GetNextSelectedRow( _
       Optional ByVal FirstRow As Long = 0, _
       Optional ByVal OrderType As BoOrderType = 0 _
    ) As Long

    What I think you should do is if you get the first selected row index, then the next time you get the row you must specify that it must check from the previous result:

    iFirstRow = oMatrix.GetNextSelectedRow
    iSecondRow = oMatrix.GetNextSelectedRow(iFirstRow)

    Hope it helps,

    Adele

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2005 at 07:17 AM

    Depending on what type of event that triggers what you want to do, you may also get the rowindex from that event.

    Eg, here is some code that gets the rowindex and column index when the user presses a key in the matrix:

    if (( pItemEvent.FormType == 2000012810) && pItemEvent.EventType == SAPbouiCOM.BoEventTypes.et_KEY_DOWN && pItemEvent.ItemUID.Equals("19") && pItemEvent.BeforeAction == false){

    String col = pItemEvent.ColUID;

    int row = pItemEvent.Row;

    }

    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.