Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 544.7k

Value of Other Fields

Aug 28 2024 4:19 PM

Hi

  In a list i am displaying only 4-5 fields but there are more fields. How i will get the values of other fields on click of Edit button

htmlTable.Append("<table class='table table-bordered table-hover datatable-highlight' id='tbldata'>");
                    htmlTable.Append("<thead><tr style='background-color:green;color:white; text-align: center;'><th>Sr.</th><th>Code</th><th>Description</th><th>Swift Code</th><th>Status</th><th class='text-center nosort'>Action</th></th></tr></thead>");
                    htmlTable.Append("<tbody>");
                    foreach (DataRow row in dt.Rows)
                    {
                        String Status = "Blocked";
                        if (Convert.ToBoolean(row["status"]))
                        {
                            Status = "Active";
                        }

                        htmlTable.Append("<tr>");
                        htmlTable.Append("<td>" + Count.ToString() + "</td>");
                        htmlTable.Append("<td>" + row["bankcode"] + "</td>");
                        htmlTable.Append("<td>" + row["bankname"] + "</td>");
                        htmlTable.Append("<td>" + row["swiftcode"] + "</td>");


                        htmlTable.Append("<td class='text-center'>");
                        htmlTable.Append("<a id='btnEdit' 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>");

                        //string deleteAttributes = Status == "Blocked" ? "style='pointer-events: none; opacity: 0.5;' onclick='return false;'" : "data-toggle='modal' data-target='#modal_Delete' onclick='BindData(this);'";
                        string deleteAttributes = Status == "Blocked" ? "style='pointer-events: none; opacity: 0.5;' onclick='return false;'" : "data-toggle='modal' data-target='#modal_Delete' ";
                        htmlTable.Append($"<a id='btnDel' class='list-icons-item text-danger-600' { deleteAttributes}><i class='icon-bin mr-1'></i></a>");

                        htmlTable.Append("</td>");

                        htmlTable.Append("<td style='display:none'>" + row["docentry"] + "</td>");
                        htmlTable.Append("<td style='display:none'>" + row["status"] + "</td>");
                        htmlTable.Append("</tr>");
                        Count++;
                    }
                    htmlTable.Append("</tbody>");
                    htmlTable.Append("</table>");
                    PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });

Thanks


Answers (2)