Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi experts,
my datagridview column is combination of alphabets and numbers. how can i sort numbers,after ending last alphabet.
ex: my coulumn is like this..
SQL
ap16as4779
ka07dh8342
ta5hk1234
ap16as677
ta5hk1233
zm1ap9

I need to sort that column to in this format,

C#
zm1ap'9'
ka07dh'8342'
ap16as'677'
ap16as'4779'
ta5hk'1234'
ta5hk'1233'


for quick understanding perpose i use this single quotes (' '). how can i do this...?

thanks in advance....
Posted
Updated 21-Jun-12 23:04pm
v2
Comments
Rajeev Jayaram 22-Jun-12 5:44am    
Your question is difficult to undestand. Do you need the column to be sorted based on the last alphabet (or) the number following the last alphabet?
sandeep nagabhairava 22-Jun-12 6:05am    
the number after last alphabet...

1 solution

By using Sort Method You can sort the data gridview like

this.dataGridView1.Sort(this.dataGridView1.Columns["Name"],ListSortDirection.Ascending);

and see this link you may get some idea

DataGridView Multi-column Sort[^]
 
Share this answer
 
Comments
Sandeep Mewara 22-Jun-12 6:22am    
I guess OP is looking for sorting ONE column only that has alphanumeric data where word followed by numbers are present.
sandeep nagabhairava 22-Jun-12 6:51am    
ya sandeep...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900