Results 1 to 6 of 6

Thread: Datagrid problem in VS.NET 2003

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    Datagrid problem in VS.NET 2003

    Hi,

    I have placed a Datagrid on a VB.NET form, which is True for ReadOnly and Enabled property.

    When user is editing some textbox, system will set Enabled of Datagrid to False. After editing, system will set Enabled back to True.

    This is done by a common function, but I found that sometime the datagrid can successfully return to Enabled state, while some time it will be in a state where the scroll bar is disabled, but I can still use mousewheel to scroll through the records!

    Any idea what property I've been missed?

    Thx!

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: Datagrid problem in VS.NET 2003

    Sounds like a possible bug, but it's hard to say without seeing the code you're using. having said that, it sounds like a bit of a kludgy way to do things. Why not allow in-place editing of the records, or else open a modal dialogue to edit a specific record? The dialogue will prevent access to the grid while you're editing so there's no need to mess around with it.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    Re: Datagrid problem in VS.NET 2003

    Your idea is great, but at this stage, it is not possible for me to change the structure.

    Actually, what I want to do is to disable scrolling in the Datagrid.....is there any method to prohabit user from doing it except Disable it?

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: Datagrid problem in VS.NET 2003

    You could set the ScrollBars property to None but the user would still be able to navigate around using the arrow keys. What does an enabled grid mean if not one you can navigate around? I don't really see that it makes sense to prevent scrolling if the grid is enabled.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    Re: Datagrid problem in VS.NET 2003

    just an alternative to disable the datagrid because of the said problem during editing......

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: Datagrid problem in VS.NET 2003

    But why is scrolling a problem? If you don't want the user to select a different row than the one they're editing then that's fair enough, but scrolling and selecting a different row are two completely different things. You can do each without doing the other. In my opinion the use of a dialogue to edit a single record in this situation is much better design.

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