[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

Listview Sort Column Datatable?

I have a win app that searches a SQL database then loads a datatable 'da.fill(datatable1) which in turn fills a Listview. This datatable1 is then merged into another datatable like so: (I do this because somtimes I need to merge more tables to satisfy the Crystal Reports .rpt I created.

dtChanges = new DataTable();
dtChanges.Merge(datatable1);
dtChanges.AcceptChanges();

This all works very will, but...

Q.  How do I Sort the Listview columns and reload these datatables so the PDF looks like the Listview?

Q Do I need to export the Listview back into a datatable?

0
kvnsdr
Asked:
kvnsdr
1 Solution
 
SolutionsCSCommented:
dtchange.DefaultView.Sort = "column you wish to sort on"
0
 
kvnsdrAuthor Commented:

Q. How do I get the column name per column clicked by a user?
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now