Hi All,
I'm having an issue with a GridView inside a repeater.
I've got the grid successfully bound to the repeater row, so in my test case, I have two grids that show up - one with two rows, the other with one.
The issue is that when I'm performing processing on cell data in a given row, it is also reflected in the other grid!
I know is about having to grab the right grid instance and making a change to that one, but I'm stuck on this.
Here's the code:
Code:
Protected Sub TestGrid_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
' because the grid resides inside the Repeater's ItemTemplate, it must be referenced as follows:
Dim TestGrid As GridView = CType(RptApprovals.Controls(0).FindControl("TestGrid"), GridView)
e.Row.Cells(6).Text = String.Format("{0:c}", salary)
.
.
.
The issue is that updating cell 6 does so on both grids that are displayed. The data must be unique per grid instance.
Thanks.