Error message while uploading the documents of Share Point Grid View

Hello,
I made a Share Point Grid View and uploaded the documents. When I try to save the file, an error message appears that I should check the document out (The source code, and file address that I have made is attached). Upon saving the document, an error message appeared.


Can somebody here understand JavaScript programming?
The file "http://172.16.10.238:101/sites/SEWS/Documents/SharePointProjectItem.spdata" is not checked out. You must first check out this document before making changes. Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: eb1a73ba-2864-4ffa-8cb8-bc2b80022bb3 Go back to site.
The code is as follows:
using (SPSite mySite = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb myWeb = mySite.OpenWeb())
{
SPList list = myWeb.Lists["Documents"];
string strListId = list.ID.ToString();
string strWebUrl = SPContext.Current.Web.Url.ToString();
//View Properties template
MenuItemTemplate mitViewProp = (MenuItemTemplate)mtName.FindControl("mitViewProp");
string strViewUrl = strWebUrl + "/Documents/Forms/DispForm.aspx?ID=%ID%";
mitViewProp.ClientOnClickNavigateUrl = "javascript:OpenPopUpPage('" + strViewUrl + "')";
//Edit Properties template
MenuItemTemplate mitEditProp = (MenuItemTemplate)mtName.FindControl("mitEditProp");
string strEditUrl = strWebUrl + "/Documents/Forms/EditForm.aspx?ID=%ID%";
mitEditProp.ClientOnClickNavigateUrl = "javascript:OpenPopUpPage('" + strEditUrl + "',RefreshPage)";
//Check In template
MenuItemTemplate mitCheckIn = (MenuItemTemplate)mtName.FindControl("mitCheckIn");
string strCheckInUrl = strWebUrl + "/_layouts/checkin.aspx?List=" + strListId + "&FileName=" + strWebUrl + "/Documents/%FileName%";
mitCheckIn.ClientOnClickNavigateUrl = "javascript:OpenPopUpPage('" + strCheckInUrl + "')";
//Check Out template
MenuItemTemplate mitCheckOut = (MenuItemTemplate)mtName.FindControl("mitCheckOut");
mitCheckOut.ClientOnClickScript = "javascript:alert('test function calling from server site event.')";
Please give suggestions on how to make my SharePoint project work.
Thanks.
