in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Deselect a row...

Last post 05-30-2008 12:46 AM by anilsoni85. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-29-2008 11:19 AM

    Deselect a row...

    I need to be able to show visually that now rows are selected.  I would assume this would be built in.  First when we load the form with a truedbgrid it highlights the first row but does not actually select it.  We’ve handled this in the load event by adding row(0) to the selectedrows collection. 

    Second we need to be able to deselect all rows.  I’ve done this in the mousedown event by checking if the row that was clicked was already in the selectedrows collection and if so selectedrows.clear.  However, the highlight is still there.  So visually it looks as if the row is still selected.  I can't seem to get rid of the highlight.

    To complicate things even more, my rows can have one of 3 different colors depending on the value of a particular cell in that row.  See my other post: http://forums.componentone.com/CS/forums/p/75291/205004.aspx#205004.  So if the rowbackcolor was green I need it to go back to green when we remove the highlight, if yellow, etc.

    Your help is greatly appreciated,

    +------------------------------------+
      Jessie Burns, Developer                          
      Bogardus Medical Systems, Inc.               
      3555 NW 58th St., Suite 500                     
      Oklahoma City, OK 73112   

       E-Mail: jburns@oncochart.com                     
    +------------------------------------+

    Filed under: ,
  • 05-30-2008 12:46 AM In reply to

    Re: Deselect a row...

    Rows gets highlight when you have set the C1TrueDBGrid.MarqueeStyle = HighlightRow. A highlighted row cannot be dis-selected  by just C1TrueDBGrid.SelectedRows.Clear() instead try using C1TrueDBGrid.MarqueeStyle=NoMarquee when you want no rows to be selected and C1TrueDBGrid.MarqueeStyle = HighlightRow when you want them to be highleted. I hope this will work in your case.

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.