Get Gridview current field value

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.
 
M

Mark B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top