Below is the gridview rowcommand code which i want to convert in radgrid itemdatabound any budy have solution
protected void Gridviiew_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.Header)
{
dtTotalDuration = Convert.ToDateTime("01/01/1900");
dtTotalTimeSpent = Convert.ToDateTime("01/01/1900");
}
else if (e.Row.RowType == DataControlRowType.DataRow)
{
Int32 intRow = e.Row.RowIndex + 1;
int intSeconds;
string strValue;
string strHtml;
//strHtml = "javascript:var w=window.showModalDialog('Course.aspx?ChapterNum=" + intRow.ToString() + "', null, 'dialogHeight=700px; dialogTop=75px; dialogLeft=250px; dialogWidth=800px; edge=Raised; center=No; help=Yes; resizable=no; status=no; scroll=yes');";
strHtml = "javascript:var w=openCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
// e.Row.Cells[4].Attributes.Add("OnClientClick", "function_Name()");
//Add New
string strhtmlnew1 = "javascript:RadWindowOpenCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
e.Row.Cells[4].Attributes.Add("OnClick", "javascript:RadWindowOpenCourse('" + intRow.ToString() + "','" + Session["CID"] + "');return false;");
strValue = DataBinder.Eval(e.Row.DataItem, "Course_Duration").ToString();
intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
dtTotalDuration = dtTotalDuration.AddSeconds(Convert.ToDouble(intSeconds));
strValue = DataBinder.Eval(e.Row.DataItem, "Customer_Duration").ToString();
intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
dtTotalTimeSpent = dtTotalTimeSpent.AddSeconds(Convert.ToDouble(intSeconds));
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = dtTotalDuration.ToString("HH:mm:ss");
e.Row.Cells[2].Text = dtTotalTimeSpent.ToString("HH:mm:ss");
}
}
catch (Exception ex)
{
if (ex.Message.Substring(0, 56) != "Specified argument was out of the range of valid values.")
{
clsErrorLogData.LogError("Content", "Gridviiew_RowDataBound", ex.Source + "_" + Common_App.MyString(Session["CID"]), ex.Message, "");
}
}
}
protected void Gridviiew_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.Header)
{
dtTotalDuration = Convert.ToDateTime("01/01/1900");
dtTotalTimeSpent = Convert.ToDateTime("01/01/1900");
}
else if (e.Row.RowType == DataControlRowType.DataRow)
{
Int32 intRow = e.Row.RowIndex + 1;
int intSeconds;
string strValue;
string strHtml;
//strHtml = "javascript:var w=window.showModalDialog('Course.aspx?ChapterNum=" + intRow.ToString() + "', null, 'dialogHeight=700px; dialogTop=75px; dialogLeft=250px; dialogWidth=800px; edge=Raised; center=No; help=Yes; resizable=no; status=no; scroll=yes');";
strHtml = "javascript:var w=openCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
// e.Row.Cells[4].Attributes.Add("OnClientClick", "function_Name()");
//Add New
string strhtmlnew1 = "javascript:RadWindowOpenCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
e.Row.Cells[4].Attributes.Add("OnClick", "javascript:RadWindowOpenCourse('" + intRow.ToString() + "','" + Session["CID"] + "');return false;");
strValue = DataBinder.Eval(e.Row.DataItem, "Course_Duration").ToString();
intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
dtTotalDuration = dtTotalDuration.AddSeconds(Convert.ToDouble(intSeconds));
strValue = DataBinder.Eval(e.Row.DataItem, "Customer_Duration").ToString();
intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
dtTotalTimeSpent = dtTotalTimeSpent.AddSeconds(Convert.ToDouble(intSeconds));
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = dtTotalDuration.ToString("HH:mm:ss");
e.Row.Cells[2].Text = dtTotalTimeSpent.ToString("HH:mm:ss");
}
}
catch (Exception ex)
{
if (ex.Message.Substring(0, 56) != "Specified argument was out of the range of valid values.")
{
clsErrorLogData.LogError("Content", "Gridviiew_RowDataBound", ex.Source + "_" + Common_App.MyString(Session["CID"]), ex.Message, "");
}
}
}