在DataGrid的ItemDataBound事件中:
if (e.Item.ItemIndex >= 0)
{
  e.Item.Attributes["onClick"] = "GridPostBack(" + e.Item.ItemIndex.ToString() + ")";
}在.aspx中:
<input type="Hidden" id="GridItem">
<script language=JavaScript>
  function GridPostBack(itemIndex)
  {
    document.GetElementById("GridItem").value = itemIndex;
    document.forms[0].submit();
  }
</script>然后在.cs的Page_Load中:
if (Request["GridItem"] != null && Request["GridItem"].ToString() != "")
{
  Response.Write("You click the item " + Request["GridItem"].ToString());
}I don't test it, try.