Hello friends,

I have a gridview which has 4 columns.

In the first column i have Name.
In the second i have School Name ( This is a Drop down list which is Disabled on Page Load)
In the third i have Template filed wherein i have put an Button named Edit.
In the fourth i have Grades.

What i want is when the user clicks on the Edit button only that Row's ddl should be enabled and the user can make necessary changes...

How to achieve this??? Please help me out...


7 Years
Discussion Span
Last Post by laghaterohan


Just call this procedure in your Gridview 's rowediting event...

Private Sub _enable()
        Dim ddl As DropDownList

       ddl = ctype(GridView1.Rows(GridView1.EditIndex).FindControl("Dropdownlist1"), DropDownList)
        If Not IsNothing(ddl) Then
            ddl.Enabled = True
        End If
    End Sub

Dont forget to mark as solved if it helps you!!!!

Edited by reach_yousuf: n/a

Votes + Comments
Thanks, Solved.

i want the DDL to be enabled on the click of the Edit button.... How to achieve this??


Convert the field to Template field. In the EditItemTemplate, you place the drop down. Provide the DataKeyNames property in the Grid property.
Set the DataTextField and DataValueField property of Dropdown
Hope this will do it.


hello ,

Can anyone please help me out with my above mentioned problem. Is there any way i can achieve it? It appears to be simple however it is not working for me.
Is there any javascript function that can be helpful?


Hii Yousuf,

I have got it working....I have used a Naming Container property which made things pretty simple..

Thanks a lot for help!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.