We help IT Professionals succeed at work.

Keep row at top of datagridview

RySk8er30
RySk8er30 asked
on
Medium Priority
473 Views
Last Modified: 2010-10-05
I have a datagridview that has a few rows in it.  Is there a way to keep an item always at the top of the row even if the sort order gets changed?  For example...

ALL
Item1
Item2

ALL
Item2
Item1

Also, can I make the text "ALL" bold?
Comment
Watch Question

You might want to use your own dataclass to fill your grid with, and implement your custom sorting class (implementing IComparer)
If you make sure that ALL always wins from your other elements , it will always be sorted first..
I never had to implement this kind of stuff, but it might just work :D

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:


try 2 freeze the First row ... i didnt test it ...but i think it will work

DataGridViewRow.Frozen Property

http://msdn2.microsoft.com/en-US/library/system.windows.forms.datagridviewrow.frozen.aspx

Author

Commented:
Freezing the row doesn't work.  I believe this is only for scrolling.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.