Skip to Content

Grid getvalue after sort

Hi guys,

I am trying to get the value in a particular cell of a grid after it is sorted.

I am using the SAPbouiCOM.IGrid object. When I use the sort function:


If I then try to get the value in a field using:

oGrid.DataTable.GetValue(0, z).ToString();

The value returned is wrong. This is because the grid has been resorted and is no longer the same as the datatable. Is there a way to get the value in a particular row of the grid?


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2012 at 01:14 PM

    Hi Costas,

    You should use the getDataTableRowIndex if you want to get the current row after you sort it out.

    I assume that your (z) is the Row Index.

    Ex :

    dg_Main.DataTable.GetValue("Column Name", dg_Main.getDataTableRowIndex(z))


    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.