We are attempting to retrieve the value of the "SKU" (circled - red) row/cell. We can get the cell value from the column Sales$ (circled - yellow) but the same method does not seem to work for the row values.
Can you please provide us with some direction on this?
Thank you.
Hello Paul,
In the above PivotGrid, the values circled in yellow and red belong to two different data areas. The value highlighted in yellow is from cell values of measures that are queried for and the one highlighted in red is from the Rows/Columns header cell values. Both values cannot be accessed using the same method.
You would have to look into the row headers in order to access the value circled in red.
Please let me know if I may be of further assistance.
Thank you for the reply. We understand these are two different areas! What we need to know is what method we should be using to get the values from the "row headers".
Just to clarify - we are using WinPivotGrid.
After researching for a method to get row headers, I realized that the method to get the text displayed by a row header through the API is internal. The primary context for the RowHeaderUIElement is a TableViewHeaderCell, which is defined in the OLAP assembly and is internal as well. However, I believe there is one workaround to achieve this which is not so straight forward. You can try accessing the tuple member with which that row header is associated from the OLAP data source. For example, you can try doing something like this and see if it works for your requirement:
[Code] ITuple tuple = pivotGrid.DataSource.Result.RowAxis.Tuples[activeRowIndex];//You would have to get the tuple member with which that header is associated IMember memberRowHeader= tuple.Members[0];[/Code]
If you need further assistance in implementing this send me a sample application and I will modify it to demonstrate this approach.
Please let me know if you have any questions.
Thank you for the helpful reply.
Below is the code we are using to retrieve the row header value using the DoubleClick event. Your suggestion works perfectly when the row CELL (yellow circle above) is clicked on but oRow is empty and returns an error when the row HEADER is clicked on (red circle).
Private Sub ultraPivotGrid1_DoubleClick(sender As Object, e As EventArgs) Handles ultraPivotGrid1.DoubleClick
Dim oRow As Infragistics.Win.UltraWinPivotGrid.Data.PivotGridRow
oRow = ultraPivotGrid1.RowFromPoint(ultraPivotGrid1.PointToClient(System.Windows.Forms.Form.MousePosition))
If oRow.Axis.Tuples.Count > 1 Then
MsgBox(oRow.Axis.Tuples(oRow.Index + 1).Members(0).Caption)
End If
End Sub
What do we need to do in order to properly retrieve the row header value when the row header is clicked on?
Thanks again for your assistance with this.
I have reviewed OLAP DataSource source code to see if the relevant method to get row header text is public but it’s not. The oRow is empty because the header area that you are clicking on is not directly associated with any row.
After investigating for a way to access row header text from tuple and doing some research, this has been determined to be a product idea.You can suggest new product ideas for future versions (or vote for existing ones) at <https://es.infragistics.com/community/ideas>.
Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.
Thank you in advance to submitting your product idea.
That is not the answer we were hoping for … but thank you for getting back to us.
You are welcome.