Thanks for the reply. But, I am still not able to achieve what I intend to. SelectedIndexChanged doesn't trigger an event. Here is what i did
asp code
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Value="0">Make all 0</asp:ListItem>
<asp:ListItem Value="1">Make all 1</asp:ListItem>
<asp:ListItem Value="2">Edit</asp:ListItem>
<asp:ListItem Selected="True" > </asp:ListItem>
</asp:DropDownList>>
</ItemTemplate>
</asp:TemplateField>
And the vb code i used is;
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
If CType(GridView1.Rows(GridView1.SelectedIndex).Cells(0).FindControl("DropDownList1"), DropDownList).SelectedValue = 0 Then
For i As Integer = 3 To 33
GridView1.Rows(GridView1.SelectedIndex).Cells(i).Text = 0
Next
End If
If CType(GridView1.Rows(GridView1.SelectedIndex).Cells(0).FindControl("DropDownList1"), DropDownList).SelectedValue = 1 Then
For i As Integer = 3 To 33
GridView1.Rows(GridView1.SelectedIndex).Cells(i).Text = 1
Next
End If
End Sub
I don't think that the subroutine is even called once. I am not sure how to do it without using any other control like a button or a link. I want it to be such that when the user selects the list item, the subroutine is called.
Please let me know how to achieve this. Thanks for your help.