Ramco Ramco

Ramco Ramco

  • 460
  • 2.8k
  • 401.8k

HTML Table

Oct 3 2022 6:08 AM

Hi

   In below code if i have not to display in the list i have to create Headers with display:none option . Is there any other simple way of code for getting value of non-displaying fields in table

                    foreach (var colum in Result)
                    {
                        String Status = colum.Active == true ? "Active" : "Blocked";

                        htmlTable.Append("<tr>");

                        htmlTable.Append("<td style='display:none'>" + colum.PMSCode + "</td>");
                        htmlTable.Append("<td>" + colum.YearMaster.FinancialYear + "</td>");
                        htmlTable.Append("<td>" + Convert.ToDateTime(colum.KRAStartDate).ToString("dd-MM-yyyy") + "</td>");
                        htmlTable.Append("<td>" + Convert.ToDateTime(colum.Q1StartDate).ToString("dd-MM-yyyy") + "</td>");
                        htmlTable.Append("<td>" + Convert.ToDateTime(colum.Q2StartDate).ToString("dd-MM-yyyy") + "</td>");
                        htmlTable.Append("<td>" + Convert.ToDateTime(colum.Q3StartDate).ToString("dd-MM-yyyy") + "</td>");
                        htmlTable.Append("<td>" + Convert.ToDateTime(colum.Q4StartDate).ToString("dd-MM-yyyy") + "</td>");
                        htmlTable.Append("<td>" + Status + "</td>");
                        htmlTable.Append("<td class='text-center'><a id='btnEdit' style='cursor:pointer;' class='list-icons-item text-primary-600' data-toggle='modal' data-backdrop='static' data-keyboard='false' data-target='#modal_form_horizontal' onclick='BindData(this);'><i class='icon-pencil7 mr-1'></i></a></td>");

                        htmlTable.Append("<td style='display:none'>" + colum.KRAEndDate + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q1EndDate + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q2EndDate + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q3EndDate + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q4EndDate + "</td>");

                        htmlTable.Append("<td style='display:none'>" + colum.KRAStatus + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q1Status + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q2Status + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q3Status + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q4Status + "</td>");

                        htmlTable.Append("<td style='display:none'>" + colum.KRAFinalStatus + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q1FinalStatus + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q2FinalStatus + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q3FinalStatus + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.Q4FinalStatus + "</td>");

                        htmlTable.Append("<td style='display:none'>" + colum.EmailNotification + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.PMSStatus + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.FileUploadMandatory + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.SkipPeriodValidations + "</td>");
                        htmlTable.Append("<td style='display:none'>" + colum.InitiateNextQuarterlyReview + "</td>");
                        


                        htmlTable.Append("</tr>");
                    }
                    htmlTable.Append("</tbody>");
                    htmlTable.Append("</table>");

Thanks


Answers (1)