Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

Alphanumeric DataView Sort

$
0
0
My DataGridView's DataSource is bound to a DataView. The DataView is equal to my dtBills DataTable. Like so:

Code:

Dim View As New DataView
View.Table = DataSet1.Tables("dtBills")
dgvBills.DataSource = View

I have multiple columns in this DataGridView. One in particular has strings and integers as information. When I click on the DataGridView Column Header to sort the column, it sorts as strings like the column on the left:

Code:

'Curr Col  >>>  ' Wanted Result
10001      >>>  10001
100012    >>>  11000
11000      >>>  12000
110049    >>>  100012
12000      >>>  110049
E-1234    >>>  E-1234
T-12345    >>>  T-1235
T-1235    >>>  T-12345

How would I go about sorting a bound DataGridView Column when pressing on the Column Header as I normally would? Should I use my DataView to help me out?

More simply put, I need the DataGridView columns to be able to sort aplhanumerically, while having a bound DataSource...
Thank you!

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>