About removing warning messages from application

4 posts, 0 answers
  1. Klaas van der Heijden
    Klaas van der Heijden avatar
    2 posts
    Member since:
    Feb 2009

    Posted 23 Dec 2009 Link to this post

    Hi,

    We are using telerik rad controls of version 2009.3.1103.1030.
    we are tryng to remove all the warings where few of the properties have become obsolete.
    Please find herewith the details about the warnings which i have gone through.

    1) I came up with one warning that says that
    "Warning 1 'Telerik.Windows.Controls.EditorSettings<IController.Pages.GridViewCustomEditor>' is obsolete: 'This class is obsolete.'".

    Here is my sample code:
    public class GridViewCustomEditorSettings : EditorSettings<GridViewCustomEditor>
    {

    }
     
    2)  Warning 6    'Pages.ValidationGridViewControlModel.PropertyChanged' hides inherited member 'Framework.Windows.Controls.ModelView.PropertyChanged'.
    Use the new keyword if hiding was intended.   

    3) Warning:  'Telerik.Windows.Controls.TextBoxEditorSettings' is obsolete: 'This class is obsolete.'   
    Sample Code:
                GridViewDataColumn dataColumn = e.Cell.Column as GridViewDataColumn;
                dataColumn.EditorSettings = new TextBoxEditorSettings();

    4) Warning   'Telerik.Windows.Controls.GridViewBoundColumnBase.EditorSettings' is obsolete: 'This property is obsolete. Use appropriate column type, or create custom column which inherits from the GridViewBoundColumnBase class.' 
               GridViewDataColumn dataColumn = e.Cell.Column as GridViewDataColumn;
                dataColumn.EditorSettings = new TextBoxEditorSettings();

    5) Warning  'Telerik.Windows.Controls.RadWindow.PinMode' is obsolete: 'This property will be removed. The pin feature is no longer supported.'   

    6) Warning   CA1305 : Microsoft.Globalization : Because the behavior of 'Convert.ToBoolean(string)' could vary based on the current user's locale settings, replace this call in 'App.Application_Startup(object, StartupEventArgs)' with a call to 'Convert.ToBoolean(string, IFormatProvider)'. If the result of 'Convert.ToBoolean(string, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'.   

    Sample Code: 
    File - App.xaml.cs
    Convert.ToBoolean(e.InitParams["IsLoged"])

    7) Warning  CA1006 : Microsoft.Design : Consider a design where 'Items.GetHierarchy(ItemDto, Action<ObservableCollection<ItemDto>, object>)'   doesn't nest generic type 'Action<ObservableCollection<ItemDto>, object>'.   

    Sample Code:
     public void GetHierarchy(ItemDto parentItem, Action<ObservableCollection<ItemDto>, object> callback)
     { }

    Can you please let me know, How to remove these warnings?

    Thanks.


  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 23 Dec 2009 Link to this post

    Hello Joost,

    EditorSettings i s obsolete and if you want to create your own custom editors please check this blog post for more info:
    http://blogs.telerik.com/nedyalkonikolov/posts/09-11-12/how_to_create_custom_editor_with_radgridview_for_silverlight_and_wpf.aspx

    As to the other problems:
    5) PinMode is obsolete - you just need to remove the code that sets the PinMode of RadWindow. If you want to set window.PinMode=PinMode.Pin, we would recommend setting window.CanMove = false.

    6) I believe that this is not related to the Telerik controls, but generally this warning is displayed when you use ToString(), ToBoolean() or other convert methods without specifying IFormatProvider. I suppose that you will be able to workaround it by using the following code: Convert.ToBoolean(e.InitParams["IsLoged"], CultureInfo.InvariantCulture). Usually this could be ignored, but if you parse numbers, there could be culture specific problems - for example some cultures use different decimal separator.

    7) This also seem unrelated to the Telerik controls. However, it says that it is not a good practice to nest generic types, for example: Action<ObservableCollection<ItemDto>, object> nests two generic types. It suggests that you should create a class that inherits from ObservableCollection<ItemDto>, for example named ItemDtoCollection and then the action will be Action<ItemDtoCollection>. This warning could be ignored, but since it is supposed to improve the readability of the code, you might consider changing your classes.

    Best wishes,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Craig Somers
    Craig Somers avatar
    6 posts
    Member since:
    Sep 2012

    Posted 01 Feb 2010 Link to this post

    On making PinMode obsolete, what if you want to set it to NoPin with CanMove=true -- how would you duplicate that without using PinMode?
  4. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 04 Feb 2010 Link to this post

    Hi Craig,

     If you are talking about the RadWindow - this is the default behavior of the control - it acts like you set the PinMode to NoPin and CanMove to true. Please refer to our examples page: http://demos.telerik.com/silverlight/#Window/Configurator.

    Hope this answers you question.

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top