Reputation: 2686
Below is my DataTable values.
Cards Signals
card1 DO
card1 DO
card2 DO
card2 DO
card2 DO
card3 DO
I want my DataTable which has the value "card2"
at the top. How we can achieve this?
Upvotes: 0
Views: 125
Reputation: 2830
Suppose dtMy
is your current table, and you will get your sorted result in dt
DataTable dt = new DataTable();
dt = new DataView(dtMy, "Cards= 'card2'", "", DataViewRowState.CurrentRows).ToTable();
dt.Merge(new DataView(dtMy, "Cards<> 'card2'", "", DataViewRowState.CurrentRows).ToTable());
Upvotes: 2