More in this section

Forums / Developing with Sitefinity / DisplayMode and SelectedItemId obsolete

DisplayMode and SelectedItemId obsolete

2 posts, 0 answered
  1. Dan Cozine
    Dan Cozine avatar
    3 posts
    28 May 2010
    18 Oct 2010
    Link to this post
    In Sitefinity 3.7, I have a custom single item content view control where I set a DisplayMode of SingleItem and a SelectedItemId equal to the guid for the piece of content I want displayed.  It works as expected, but I get compile warnings stating those properties are obsolete and I should use BehaviorMode and FilterExpression instead.

    If I try setting BehaviorMode to Details and FilterExpression to "ID = \"  <<GUID of content item>> \"", nothing appears on the page.

    How should I be modifying my code to make use of these new properties?


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    18 Oct 2010
    Link to this post
    Hi Dan,

    The problem comes from the Visual Studio settings. You have set it in mode where the "warnings" are recognized as errors. Generally setting the obsolete members works fine.

    1. You could change your Visual Studio compilation sensitivity
    2. The second option is adding ContentItemKey ( by default it is Cntitem) as a QueryString and adding the item ID ( the GUID). You might find this post useful.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered