Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
protected void dgvJobSearch_ItemCommand(object source, DataGridCommandEventArgs e)
    {
        if (e.CommandName == "BID")
        {

           string strBid = serviceus.getMaxId("SERVICEUS_BID", "BID_ID");
            int Bid= Convert.ToInt32(strBid);
            string strJobTile = (string)((Label)e.Item.Cells[0].Controls[3]).Text;//Desc
            string strTransactionid = (string)((Label)e.Item.Cells[0].Controls[7]).Text;//Time
            string strMember = (string)((Label)e.Item.Cells[0].Controls[11]).Text;//Time
            string strDescrption = (string)((Label)e.Item.Cells[0].Controls[13]).Text;//Time
            string strAmount = (string)((TextBox)e.Item.Cells[0].Controls[17]).Text;//Time
            string strCooment = (string)((TextBox)e.Item.Cells[0].Controls[21]).Text;//Time
            DateTime strProjectEndDate = (DateTime)(Convert.ToDateTime(((Label)e.Item.Cells[0].Controls[29]).Text));//Time
            string strProviderId = (string)((Label)e.Item.Cells[0].Controls[31]).Text;//Time
             string strProjectId = (string)((Label)e.Item.Cells[0].Controls[33]).Text;//Time
            //int strUserId = Convert.ToInt32(Session["Userid"].ToString());
            TimeSpan strPEndDate = strProjectEndDate - DateTime.Now;
            string strPEDATE = strPEndDate.Days.ToString();

            string strBidCount = serviceus.Get_SERVICEUS_BIDS_COUNT(strProjectId);

            int strUserId = 1;

            strBidCount = strBidCount + 1;

            serviceus.UPDATE_SERVICEUS_BIDS_COUNT(strProjectId, strBidCount);

            //strPEndDate.Days;
            serviceus.Insert_ServiceUs_BID(Bid, strAmount, "", strPEDATE, DateTime.Now.ToShortDateString(), strProviderId, strProjectId, strBidCount, strTransactionid, strUserId, "PENDING");

        }
    }
Posted
Updated 7-Feb-11 19:13pm
v2
Comments
JF2015 8-Feb-11 1:14am    
Could you please elaborate what exactly is the problem you are facing. Please use the "Improve question" link to add some details. Thanks!

1 solution

Did you try using FindControl at cell level instead of indexing the control?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900