Results 1 to 2 of 2

Thread: change backcolor row in datagrid

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    change backcolor row in datagrid

    Hi,
    I currently have a datagrid that is displaying items in an inventory. The user is able to modify inventory contents, and then there is a button to save the changes back to the SQL database.

    What I would like to implement is something that will change the color of each row that the user has updated.

    The only thing close that I've found is DataGrid.SelectionBackColor but the problem with that is that it changes the row color of the currently selected row, instead of row[x] in the DataGrid. So if the user moves the mouse to select a different row, the updated row loses the color, and the newly selected (non-updated) row gains it.

    Anyone have a solution for a DataGrid to change the color of any row and then have it remain there?

    I noticed you can't even get to an individual row with the DataGrid, there is no DataGrid.Row[x] feature. If there was, it might have a nice DataGrid.Row[x].BackColor property I could use.

    Thanks in advance,

    Steve
    steve

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

    Re: change backcolor row in datagrid

    Follow the Windows Forms FAQ link in my sig. It has heaps of information on using the DataGrid including this.
    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

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