Keep row at top of datagridview

Posted on 2006-03-21
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...



Also, can I make the text "ALL" bold?
Question by:RySk8er30
    LVL 14

    Accepted Solution

    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
    LVL 6

    Expert Comment


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

    DataGridViewRow.Frozen Property

    Author Comment

    Freezing the row doesn't work.  I believe this is only for scrolling.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video discusses moving either the default database or any database to a new volume.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now