Get Gridview current field value

  • Thread starter Thread starter Mark B
  • Start date Start date
M

Mark B

I have a Gridview template field 'Color'.

I want to set its Text value to the string result of the following function:

<%=fGetColorStringFromCounterIDLookup(intCurrentCounterID) %>

where intCurrentCounterID is the value of the particular row's field value
for the CounterID.

How can I pass the current CounterID number to that function?

I know <% #Eval(CounterID) %> gets the current CounterID but haven't been
able to set the syntax to pass that result to the function.
 
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(6).Text = GridView1.DataKeys(e.Row.RowIndex).Value
End If

End Sub
 
Back
Top