Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2725
WebGrid 'Style' Property cannot be set declaratively after I upgraded
posted

Hi

 I am getting this error in  WebGrid:     'Style' Property cannot be set declaratively

after I upgraded

 

Gary 

 

Parents
  • 21382
    posted

    What version did you upgrade from?

     The WebGrid used to allow setting of Style properties directly, allowing the whole object to be updated.  But (and it has been a while) that mechanism did not play nicely with CLR2.  If memory serves, it had something to do with the way when a page deserialized, the object was created differently if the accessor allow for setting of objects rather than having the object created by the Grid and exposing sub properties of it. 

     Actually it seems it was done in 2006v3

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/WebGrid_Breaking_Changes_in_WebGrid.html

     

    Anyway, you would either have to change your object reference to point to the Style object off the Grid directly, or  take the style you make and use the .CopyFrom() method off the grid style to import it.

     

Reply Children