protected void gvRating_SelectedIndexChanged(object sender, EventArgs e)
    {
        Label ID = (Label)gvRating.FindControl("lblid");

        objBAL = new ClsBAL();
        DataSet ds = objBAL.GetRatingByRatingId(Convert.ToInt32(ID));
        if (ds.Tables[0].Rows.Count >= 1)
        {
            txtRating.Text = ds.Tables[0].Rows[0]["Rating"].ToString();
            ddlApi.SelectedValue = ddlApi.Items.FindByText(ds.Tables[0].Rows[0]["APIName"].ToString()).Value;
            ddlApi_SelectedIndexChanged(sender, e);
            ddlOperator.SelectedValue = ddlOperator.Items.FindByText(ds.Tables[0].Rows[0]["BusOperatorName"].ToString()).Value;
        }
    }
 protected void gvRating_RowCommand1(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edit")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         objBAL = new ClsBAL();
         DataSet ds = objBAL.GetRatingByRatingId(Convert.ToInt32(id));
         if (ds.Tables[0].Rows.Count >= 1)
         {
             txtRating.Text = ds.Tables[0].Rows[0]["Rating"].ToString();
             ddlApi.SelectedValue = ddlApi.Items.FindByText(ds.Tables[0].Rows[0]["APIName"].ToString()).Value;
             ddlApi_SelectedIndexChanged(sender, e);
             ddlOperator.SelectedValue = ddlOperator.Items.FindByText(ds.Tables[0].Rows[0]["BusOperatorName"].ToString()).Value;
         }
     }
 }