Click here to Skip to main content
16,021,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for (int i = 0; i < grdhd.Items.Count; i++)
                {
                    if ((grdhd.Items[i].FindControl("chkhd") as CheckBox).Checked)
                    {
                        <big>string[] appdate = grdhd.Items[i].Cells[1].Text.Split('/');</big>
                        days = Convert.ToSingle(days - 0.5);
                        objhd.EmpCode = Session["EmpCode"].ToString();
                        objhd.EmpNo = Convert.ToInt32(Session["UserID"]);
                        objhd.Day = grdhd.Items[i].Cells[2].Text;
                        objhd.hddates = Convert.ToDateTime(appdate[1].ToString() + "/" + appdate[0].ToString() + "/" + appdate[2].ToString());
                        objhd.Slot = (grdhd.Items[i].FindControl("ddlslot") as DropDownList).SelectedItem.Text;
                        if (Session["UserName"] != null)
                            objhd.CreatedBy = Session["UserName"].ToString();
                        objhd.CreatedDate = System.DateTime.Now;
                        objhd.ModifiedBy = "";
                        objhd.ModifiedDate = System.DateTime.Now;
                        objhd.DeletedFlag = '0';
                        objhd.Insert(objhd);
                    }
                }


Please tell me why the line in bold letter gives error.
Posted
Updated 2-Aug-11 3:36am
v5
Comments
RaisKazi 2-Aug-11 9:00am    
What error you are getting?
gauriv 2-Aug-11 9:04am    
In grdhd.Items[i].Cells[1].Text i have date in the format '1/1/2011' so i want to split it but when we actually run it it shows nbsp?so what is the actual code get data from cells of grid.please help
Herman<T>.Instance 2-Aug-11 9:34am    
what is the layout of the grid? In which column the datefield is shown? Is it shown in the first column?

1 solution

My thought would be that you would ask your Telerik questions in their forums since you would stand a much better chance of their own support technicians knowing what to do.
 
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