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. C#
  4. Reg:Data Grid Display index and Scrool bar problem

Reg:Data Grid Display index and Scrool bar problem

Scheduled Pinned Locked Moved C#
helpcssdatabasequestion
2 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.
  • U Offline
    U Offline
    User 4005525
    wrote on last edited by
    #1

    Hi all, I've two Datagridview controls. Each grid has different datasources. Eg. Datasource of grid1 is Hastable. Datasource of Grid1 is datatable. i want to display all the columns in both gridcontrol in the same order. Eg if Grid1 has columns in the order like Name,Age,DOB,SAL and i want the same order in grid2 also. i'm trying to set displayindex. but it's not displaying in the same order.and also want to add Scrollbars if necessary. Everything has to be done programatically. can anyone help me? thanks in advance sri

    M 1 Reply Last reply
    0
    • U User 4005525

      Hi all, I've two Datagridview controls. Each grid has different datasources. Eg. Datasource of grid1 is Hastable. Datasource of Grid1 is datatable. i want to display all the columns in both gridcontrol in the same order. Eg if Grid1 has columns in the order like Name,Age,DOB,SAL and i want the same order in grid2 also. i'm trying to set displayindex. but it's not displaying in the same order.and also want to add Scrollbars if necessary. Everything has to be done programatically. can anyone help me? thanks in advance sri

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      So you want the event from 1 datagridview to be replicated on the other DG and the event is the sorting of the columns when the user clicks the column header. Do you start to see a pattern here. Take a look at the events available for the DG, there are lots of them and many for the column header. Identify the one used by the DG for sorting and replicate the event on the other DG (you will need a flag to identify the source so you don't fall into an endless loop).

      Never underestimate the power of human stupidity RAH

      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