I have a WebHierarchicalDataGrid and I need to get values from the cells in the child row when a user click on a button outside of the grid. Can any one point me in the right direction on how to accomplish this?
Thank You
Stephen Sjostrom
Hi Galina,
Here is my code section. I'm unsure of what you mean about making it a public method.
Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
Dim activeCell As GridRecordItem Dim activeRowIndex As int Try
activeCell = wdgTimeRptGroup.GridView.Behaviors.Activation.ActiveCell activeRowIndex = activeCell.Row.Index Dim rowValues = GetChildRowValues(activeRowIndex, 0)
Catch ex As Exception
End Try End Sub
Thank you
Hello Stephen,
Depending on your application's structure and where you call the method from, you need to adjust the access modifiers of your methods & properties. In my initial response I sent you the GetChildRowValues method with the following signature:
protected IEnumerable<string> GetChildRowValues(int parentRowIndex, int childRowIndex)
In this line, I suggest you try changing protected to public so the access to this method has no restrictions at all.
public IEnumerable<string> GetChildRowValues(int parentRowIndex, int childRowIndex)
You may refer to the Accessibility Levels topic for more details.
Let me know if I may be of any further assistance.
Sorry for the delay but the following line returns activecell = nothing. Can you point into the right direction of what maybe the problem?
activeCell = wdgTimeRptGroup.GridView.Behaviors.Activation.ActiveCell
Hi Stephen,
If there is no active cell in the grid, then the line you mention would return nothing. I suggest you check it is not 'Nothing' before you proceed with getting the row and its values.
As I mentioned in my previous reply, I am using the active cell as an example but you will have to adapt the code to get the cell of interest as per your application's requirements.