I am trying to get the headers of the table (In the picture Highlighted with red colour) using following ways. But here the number of rows are coming as "zero". Every time I am getting error as "IndexArrayOutofBoundException" because of the Rows is "zero".
Below "grdRebalanceSetuptable" is the Table name of the object.
grdRebalanceSetuptable().getNAProperty("Rows[0].Cells[0].Column.Header.Caption")
I tried another way:
grdRebalanceSetuptable().getNAProperty("DisplayLayout.Bands[0].Columns[0].Header.Caption")
But it is not giving the correct Header names. It is giving some other values.
Another way:
I tried by getting the childrens of the table. Also tried by getting all the propeties of the table. But I am unable to get the Header values of the table.
grdRebalanceSetuptable().getProperties();
From the propeties I checked one by one as below to get the header values.
grdRebalanceSetuptable().getProperty("current row"));grdRebalanceSetuptable().getProperty("Text"));
Please give me your suggestions to get the Headers of the attached image table. The attached image window is a popup window which is coming after clicking an icon in the application.
ThanksChandu
Chandu,
The columns may or may not display in the same order as they are in the Columns collection and it is also possible that some of the columns could be hidden.
There is a VisiblePosition and VisiblePositionWithinBand off of the header that may help you to determine where the column is actually displayed:
grdRebalanceSetuptable().getNAProperty("DisplayLayout.Bands[0].Columns[0].Header.VisiblePositionWithinBand");
For determining if a column is hidden, you can check the HiddenResolved property of the column:
grdRebalanceSetuptable().getNAProperty("DisplayLayout.Bands[0].Columns[0].HiddenResolved");
Let me know if you have any questions with this matter.
Hi Ammar,
I had already tried this way. I am getting the headers but not in the order. I tried below one to get first 3 values. I got 3 values but not in the order. I got "Alpha, Combo and Max" values istead of "Country, Security ID and Security Name".
grdRebalanceSetuptable().getNAProperty("DisplayLayout.Bands[0].Columns[0].Header.Caption");grdRebalanceSetuptable().getNAProperty("DisplayLayout.Bands[0].Columns[1].Header.Caption");grdRebalanceSetuptable().getNAProperty("DisplayLayout.Bands[0].Columns[2].Header.Caption");
Please give me your suggestions.
Regards,Chandu
Try:
When there are no rows in the grid you can get to the colums collection via DisplayLayout
Let me know if this works.
Regards,
Ammar