row X of Y

speedykenspeedyken Member Posts: 15
edited 2007-07-31 in Dynamics AX
Hi,

I know how you can get te total amount of rows in a grid.
But how can jou get the rownumber that is selected.

Below the grid should come:

row X of Y.

thanks

Comments

  • MikerMiker Member Posts: 105
    Hi for this purpose you should create class, for example, then you will get selected rows, using class FormDataSource
    here some code for you
    calledDataSource ; //your data source
    if (calledDataSource.anyMarked()) //YourTable_ds = calledDataSource
    {
    for (YourTableMarked = calledDataSource.getFirst(true, false); YourTableMarked ;
    YourTableMarked = calledDataSource.getNext())
    {

    info(YourTableMarked .YourField);
    }

    }
    else
    {
    YourTableMarked = calledDataSource.cursor();
    info('Select only'+ YourTableMarked.YourField) ;
    }
    going to Europe
  • speedykenspeedyken Member Posts: 15
    hi miker,

    thanks for you're answer, but It's something else I want to do.
    I want to get de rownumber of the selected row.
    if there are 100records in the grid and the selected row is the 50th row, then should come below:

    row 50 of 100

    or something like that.
    Or is that possible with you're code?

    Greetz
Sign In or Register to comment.