Click here to Skip to main content
15,616,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI Friendz,
I am facing some problen while implementing this. I have a Table and three radio buttons out side the table. The radio buttons consists of the column names of the table.Now checking the radio buttons i have to sort the table accordingly..

Can anyone guide me or give some sample applications to do this
Thank you all
Updated 22-May-12 3:30am
sunandandutt 22-May-12 4:21am    
kindly elaborate your question.
sivasankari ts 22-May-12 4:21am    
Radio button for toggling sorting ascending/descending?
Jim Jos 22-May-12 5:08am    
Table you mean HTML table or Gridview where do you want to sort at client or server?
SwapnadipSaha 22-May-12 7:03am    
Hi JimJos,
Actually i'm using HTML Table and I want to sort at client side. May b Javascript or Jquery would be suitable for this since I'm using MVC3 Razor ViewEngine

1 solution

you should use RadioButtonList in place of RadioButtons
then on selectedindexchanging event of this list

Re-Fill Grid

you can use dataview for sorting
DataView dv = tblDetail.DefaultView;
dv.Sort = RadioButtonList.SelectedValue;  /// this is selected option 
GridView.DataSource = dv;

Accept as solution if your problem got solved
Share this answer
SwapnadipSaha 22-May-12 7:01am    
Thank you for the response.. But here i am not using grid view. i am using HTML table only. and I/m working on mvc3.So need suggestion on Javascript or Jquery

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