我试图用刀尖在网格上的每一行显示细节每当在特定的小区用户所指向的每一行。它应该显示每一行的细节,但它只显示第一行的细节。谁能帮我?如何阅读网
for (int i = 1; i <= e.Row.Cells.Count - 1; i++)
{
if (e.Row.Cells[i].Text == "0" || string.IsNullOrEmpty(e.Row.Cells[i].Text) || e.Row.Cells[i].Text == " ")
{
e.Row.Cells[i].Text = "";
}
else
{
e.Row.Cells[i].BackColor = System.Drawing.Color.Blue;
dateSetExport.Tables.Clear();
dateSetExport.Reset();
SqlParameter[] param = new SqlParameter[2];
param[1] = new SqlParameter("@Startdate", gvDetails.HeaderRow.Cells[i].Text);
param[0] = new SqlParameter("@Employe_Id", e.Row.Cells[0].Text.Split('-')[0]);
DataTable dt1 = DataHelper.getDataTableExecuteSP("usp_GetToolTip", param);
dt1.TableName = "ToolTip";
dateSetExport.Tables.Add(dt1);
string tooltip = "";
for (int j = 0; j < dt1.Rows.Count; j++)
{
tooltip = tooltip + dt1.Rows[j]["normal_working_hours"].ToString() + " Hours : " + dt1.Rows[j]["description"].ToString()+"\n\n";
}
e.Row.Cells[i].ToolTip = tooltip;
}
}
哪些电网事件是你创建的工具提示? 。 –
工具提示=提示+ dt1.Rows [j]的[ “normal_working_hours”]的ToString()+ “时间:”。+ dt1.Rows [j]的[ “描述”]的ToString()+ “\ n \ n” 个;与小时 – vicky