Refer this code
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function IndexChange(ddl) {
var index = ddl.selectedIndex;
alert('Selected Value = ' + ddl.value + '\r\nSelected Index = ' + index);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Number" />
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="ddlCourses" runat="server" onchange="IndexChange(this);">
<asp:ListItem Text="Please select" Value="0" />
<asp:ListItem Text="IT" Value="IT" />
<asp:ListItem Text="CS" Value="CS" />
<asp:ListItem Text="BSC-IT" Value="BSC-IT" />
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
C#
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Rows.Add(1);
dt.Rows.Add(2);
this.GridView1.DataSource = dt;
this.GridView1.DataBind();
}