In my web application, I have created
DataTable dt= new DataTable();
dt.Columns.Add("Month");
and made fill the column name "Month" with date as
Month(Column name)
oct-2014
July-2016
Aug-2016
and made fill my dynamic table
Now, i want this dynamic table data to be Reverse order
for eg:
Month(Column name)
Aug-2016
July-2016
oct-2014
like this i need to display dynamic data table is first row is last and last row is first.
Thank you.
Try this.
DataTable reversedDt = dt.Clone();
for (var row = dt.Rows.Count - 1; row >= 0; row--)
reversedDt .ImportRow(dt.Rows[row]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With