not CLS-Compliant

3 posts, 0 answers
  1. Eric Moreau
    Eric Moreau avatar
    22 posts
    Member since:
    Sep 2007

    Posted 24 Aug 2010 Link to this post

    Hi

    I am creating some extension methods on the grid to ease the development. The compiler throws a warning: "Type of parameter pGrid is not CLS-Compliant".

    How to fix it.

    for example, this is one of my method:

    <System.Runtime.CompilerServices.Extension()> _

     

    Public Function AddColumn(ByVal pGrid As RadGridView, _

     

     

    ByVal pDataField As String, _

     

     

    ByVal pDataType As System.Type _

     

    )

    As Boolean

     

    AddColumn(pGrid, pDataField, pDataType, 0, pDataField, 0, 1,

    String.Empty, True)

     

     

    End Function

     

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 25 Aug 2010 Link to this post

    Add this declaration to the top of the method
    <CLSCompliantAttribute(False)> _
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 27 Aug 2010 Link to this post

    Hello everyone,

    Thank you for writing.

    I was not able to reproduce the described warning. Here is the extension method I used to test your scenario:

    Imports Telerik.WinControls.UI
     
    Module Module1
     
        <System.Runtime.CompilerServices.Extension()> _
        Public Function AddColumn(ByVal pGrid As RadGridView, ByVal pDataField As String, ByVal pDataType As System.Type) As Boolean
            'your code here...
            Return True
        End Function
     
    End Module

    Would you please check whether the above code produces the warning on your side?

    I am looking forward to your reply.
    Greetings,
    Julian Benkov
    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
Back to Top