Results 1 to 7 of 7

Thread: [RESOLVED] [2005] DataGridView + selection Q

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    Köln
    Posts
    395

    Resolved [RESOLVED] [2005] DataGridView + selection Q

    Greetings,

    how can I achive that a databound dgv after her initial filling NOT the first row selected is?

    thx in advance

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: [2005] DataGridView + selection Q

    Can u explain in brief

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    Köln
    Posts
    395

    Re: [2005] DataGridView + selection Q

    @shakti5385

    I have a databound dgv. When the application starts the dgv gets all the records from the db. After this the dgv has automaticly the focus on the first row.

    What I need is that whatever row is not selected until the user has clicked on a row.

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: [2005] DataGridView + selection Q

    Set allow user to addRow as False

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    Köln
    Posts
    395

    Re: [2005] DataGridView + selection Q

    @shakti5385

    all properties starting with "AllowUser....." are set = false.

    Still the first record in the dgv is highligted
    Last edited by Bongo; May 5th, 2007 at 08:34 AM.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] DataGridView + selection Q

    As long as the grid is not the first control in the Tab order then you can set its CurrentCell property to Nothing AFTER it is populated. If it is the first control in the Tab order then you can still use the same code but it must be done AFTER the form has been displayed, i.e. in the Shown event handler.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    Köln
    Posts
    395

    Re: [RESOLVED] [2005] DataGridView + selection Q

    thanks to all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width