Answers for "datatable select delete"

C#
0

jquery datatable destroy and recreate

$("#Table").DataTable().clear().destroy();
            $("#Table").dataTable({
                "sAjaxSource": '@Url.Action("YourMethod", "UrCOntrollerName")',
                "bServerSide": true,
                "bProcessing": false,
                "searching" : false,

                "columns": [
                    {
                        "data": "ID",
                        "autoWidth": true,
                        "searchable": false,
                        "mRender": function (arqs, type, data) {
                            return "<a href='#' onclick='RemoveCombine(this)' data-id='" + data.ID + "'  class='btn-round-sm' title='Remove' style='padding: 5px 5px 5px 5px;'><span>Remove</span></a>";
                        }
                    },
Posted by: Guest on January-05-2022
2

c# remove rows from datatable

for(int i = dtPerson.Rows.Count-1; i >= 0; i--)
{
    DataRow dr = dtPerson.Rows[i];
    if (dr["name"] == "Joe")
        dr.Delete();
}
dtPerson.AcceptChanges();
Posted by: Guest on August-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language