troubleshooting Question

Template Field in gridview that fires drop down selected index changed event getting row index

Avatar of wolfcoop
wolfcoop asked on
.NET ProgrammingASP.NET
6 Comments1 Solution1710 ViewsLast Modified:
I have a template field in the item template of a gridview.  The template field is a status dropdownlist that fires an onindexchanged event for the drop down.  I need to reference the row index of the row that fired the drop down on index changed.

Nothing chages in the gridview so I cant reference the datakey, or use the row event args cause it is a template field off of the item template.  No row is selected, so is there a way to get that information his way???

Please help
Protected Sub drpStatus_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
 
        Dim strStatus as String = sender.SelectedValue
        Dim strID as String = Gridiew1.SelectedRow.Items.cells(0)
        or something like
        Dim strID as String =  GridView1.SelectedDataKey
 
 
    End Sub
ASKER CERTIFIED SOLUTION
wolfcoop

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros