Selected | Alternate Row deon't work: fix

Last post 10-13-2006 10:50 PM by psi_u. 2 replies.

Sort Posts:

  • Selected | Alternate Row deon't work: fix

    10-13-2006, 8:14 AM
    • Member
      15 point Member
    • psi_u
    • Member since 09-30-2006, 1:00 PM
    • Posts 3

    The symptoms:

     I want the background of the selected rows to be yellow.

    It works only on the selected rows, that aren't an alternate rows.

    The problem:

    the method "GetRowClass", which determines the ClassName for the appropriate RowState, using all the options of the enumeration of DataControlRowState (except normal).

    However, there is another option: "Selected | Alternate". Since its nor Selected neither Alternate, The Switch doesn't get them in either CASE. Therefore it returns the ClassName as NULL (or: "").

    The solution:

    One simple way, that demonstrate the problem and the solution is by adding these lines after the last Case. That should resolve the problem:

    	case DataControlRowState.Normal:
                        break;
                    default:
                        className += " AspNet-GridView-Selected ";
                        className += gridView.SelectedRowStyle.CssClass;
                        break;

     Hope this helps.

  • Re: Selected | Alternate Row deon't work: fix

    10-13-2006, 12:32 PM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 6:22 PM
    • Groovybits.com
    • Posts 741

    Thanks.  Angel Eyes also posted a fix for this, http://forums.asp.net/thread/1399505.aspx.  It will be fixed in the next version of the kit.

    Russ Helfand
    Groovybits.com
  • Re: Selected | Alternate Row deon't work: fix

    10-13-2006, 10:50 PM
    • Member
      15 point Member
    • psi_u
    • Member since 09-30-2006, 1:00 PM
    • Posts 3

    Well, its almost a year by now...., sooooo, I forgot..

     Anyway, I can't read VB well enough, but I guess that "OR" is the equivalent to "|".

     I think my way will cover also the other options, such as edit etc.

     

    Thanks anyway.

Page 1 of 1 (3 items)