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. Any way to ensure a selected Datagrid row is visble?

Any way to ensure a selected Datagrid row is visble?

Scheduled Pinned Locked Moved C#
helpquestion
1 Posts 1 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.
  • R Offline
    R Offline
    rwestgraham
    wrote on last edited by
    #1

    I have a form with two DataGrid controls. When a user selects a row in DataGrid1, DataGrid2 is populated with child data using a filtered DataView object. I also have certain criteria that allows me to preselect a "default" row of data in DataGrid2. So basically user clicks on a row in DataGrid1, DataGrid2 is populated with all valid child data, and then the program also automatically selects a row in DataGrid2 that in most cases will be the correct selection. But the user also has the choice to change the selection in DataGrid2 before continuing. The code works fine - the CurrentCellChanged event in DataGrid1 correctly populates all rows into DataGrid2 and then additional code correctly "pre-selects" a default row in DataGrid2. In most cases the user will simply accept the default selection in DataGrid2, but they still need to be able to review the programmatic default selection before they accept it. The problem is I can preselect a default row in DataGrid2, but that selection may not always be within the rows that are visible in DataGrid2. What I want to do is ensure that the preselected (programmatically selected) default row in DataGrid2 is always visible without the user actually having to scroll down to find the preselected row. Is this possible??? TIA!!!!

    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