I have a query just want to order by if ticketStatus = Attended first then Issue, then Unpaid, then Cancelled. Thanks
var duplicate = dt.AsEnumerable()
.OrderBy((x,index) => index(ticketStatusOrder.IndexOf(x["TicketStatus"].ToString())))
//.OrderBy(x => x["TicketStatus"].ToString() == "Attended")
//.ThenBy(x => x["TicketStatus"].ToString() == "Issued")
//.ThenBy(x => x["TicketStatus"].ToString() == "Unpaid")
//.ThenBy(x => x["TicketStatus"].ToString() == "Cancelled")
.GroupBy(x => new {EventID = x["EventID"].ToString(), ContactID = x["ContactID"].ToString()})
.Select(x => x.FirstOrDefault()).CopyToDataTable();