Click here to Skip to main content
15,913,685 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
Am developing an software using windows application. In that i display the records using datagridview, In that i need the first row as static(i.e, while do ascending and descending the the first will be the same place) and ascending and descending will be done in second row. How can i do that, Can any one help me about this.
Posted
Updated 20-Dec-15 16:58pm
v2
Comments
Sergey Alexandrovich Kryukov 21-Dec-15 0:40am    
Do you mean that the part starting from the next row should be scrollable, but not the first row?
One idea is: combine two instances of DataGridView and sync their columns.
—SA
MSVelu8788 21-Dec-15 1:00am    
Thanks for the quick reply, i want the first row static if i make changes like ascending or descending the first row could not be affect, bcz i using the first row for filteration and searching...

1 solution

You have to do some login yourself. When DataGridView Sorting event called you have to skip that row at runtime.
For this . please follow below link. it will help you.

http://stackoverflow.com/questions/15781859/disable-sorting-of-one-row-in-datagridview[^]

Regards,
AARIF SHAIKH
 
Share this answer
 
Comments
MSVelu8788 21-Dec-15 1:21am    
Thanks for the quick reply.

in your solution "DataGridView1_SortCompare(object sender, DataGridViewSortCompareEventArgs e)" event is not firing. i set this.dataGridView1.Columns["Priority"].SortMode =
DataGridViewColumnSortMode.Automatic;, but not wroking..
BillWoodruff 21-Dec-15 3:09am    
Voted #5 to counter-act undeserved down-vote. The link cited is relevant to the OP's concerns here !
MSVelu8788 21-Dec-15 3:23am    
I don't understand what you are trying to tell.

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