/// <summary>
 /// loads the gridview with all of the artits
 /// </summary>
 protected void LoadData()
 {
     try
     {
         Artists_Gridview.DataBind();
     }
     catch (Exception ex)
     {
         Message.Text = GetInnerException(ex).Message;
     }
 }
    protected void Artists_Gridview_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //collect the rowIndex
        int row = (int)Convert.ChangeType(e.CommandArgument, TypeCode.Int32);

        //collect the controllers
        Label artistIDController   = (Label)Artists_Gridview.Rows[row].FindControl("ArtistID");
        Label artistNameController = (Label)Artists_Gridview.Rows[row].FindControl("Artist");

        #region Delete command
        if (e.CommandName == "Delete")
        {
            e.Handled = true;
            try
            {
                ArtistController ac = new ArtistController();

                //delete the artist
                ac.DeleteArtist(int.Parse(artistIDController.Text));

                //Reload the data
                Artists_Gridview.DataBind();
            }
            catch (Exception ex)
            {
                Message.Text = GetInnerException(ex).Message;
            }
        }
        #endregion
        #region Edit command
        if (e.CommandName == "Edit")
        {
            e.Handled = true;
            ChangeEditMode(true, artistNameController.Text, artistIDController.Text);
        }
        #endregion
    }