Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Making the coloum header of datagridview read only

Making the coloum header of datagridview read only

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pradip Kishore
    wrote on last edited by
    #1

    Hi, I have a datagridview control in which I populate data from a data table.When I click on the coloumn header of the gridview control,then the data which are displayed are sorted in the reverse order on which it was originally diaplayed. Issue:Now I want that the data should not be sorted when ever I click on any of the coloumn headers of the data gridview i.e I want all the coloumn headers of the gridview controls should be read only irrespective of clicking on it.When I will click on the gridview column header no actions should not be there in th gridview. Please help me out in this issue.Its very urgent. Thanks in advance.

    Pradip Kishore

    F 1 Reply Last reply
    0
    • P Pradip Kishore

      Hi, I have a datagridview control in which I populate data from a data table.When I click on the coloumn header of the gridview control,then the data which are displayed are sorted in the reverse order on which it was originally diaplayed. Issue:Now I want that the data should not be sorted when ever I click on any of the coloumn headers of the data gridview i.e I want all the coloumn headers of the gridview controls should be read only irrespective of clicking on it.When I will click on the gridview column header no actions should not be there in th gridview. Please help me out in this issue.Its very urgent. Thanks in advance.

      Pradip Kishore

      F Offline
      F Offline
      Francis K Antony
      wrote on last edited by
      #2

      Hi Pradip Kishore Use DataGridView Properties Columns->; Selected Columns, (Select Column) and use Behavior: SortMode->;(Select your options) Notsortable

      Franics K Antony

      P 1 Reply Last reply
      0
      • F Francis K Antony

        Hi Pradip Kishore Use DataGridView Properties Columns->; Selected Columns, (Select Column) and use Behavior: SortMode->;(Select your options) Notsortable

        Franics K Antony

        P Offline
        P Offline
        Pradip Kishore
        wrote on last edited by
        #3

        Hi Francis, Thanks a lot for the quick response. I have a requirement that when even I checked on certain data items in the gridview(GV) then the color must be changed (which i did),but now the problem is that when I click on any of the coloumn headers,the colors of the items which I had checked got vanished and the data is shown in the GV as fresh data as if no items have been checked. Please let me know how to prevent the color change when somebody clicks on any of the coloumn headers of the GV..? Thanks in advance.

        Pradip Kishore

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups