.net - Sort DataTable rows by length in c# -


P> 1.Ooava 2. 2.AOB
3.Oro 4.Uroba


N. LineBox

To sort rows by length, not by name. I want to sort the table based on length of areas.

You can set your datatable , len () Due to the call to the function, a column containing an expression is automatically counted, due to which the values ​​in the column are automatically counted:

  add table.Columns ("lengthname", typef (int), "lane (Name)");  

Then you can sort your new column to DataTable before using any type of UI control before binding it in the grid:

  table. Default view. Security = "lengthname";  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -