InvalidCastException was unhandled by usercode
<p>when i try this   </p>

<pre><code>protected void Grid_ViewSorting(Object sender, GridViewSortEventArgs e)
{
        DataGrid myGrid = (DataGrid) sender;
        DataTable datatable =(DataTable) myGrid.DataSource;        
       DataView dataView = datatable.DefaultView;

       if(e.SortDirection.ToString() == "ASC")
       {
                   dataView.Sort = e.SortExpression + "DESC";
        } else
        {
            dataView.Sort = e.SortExpression + "ASC";
       }
 }
</code></pre>

<p>i got the error msg invalidCastException Was Unhandled By userCode
Unable to cast Object OF type 'System.Web.UI.WebControls.GridView' to type 'System.Web.UI.Web.Contro.DataGrid'.</p>
