This is a migrated thread and some comments may be shown as answers.

not CLS-Compliant

2 Answers 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric Moreau
Top achievements
Rank 2
Iron
Iron
Veteran
Eric Moreau asked on 25 Aug 2010, 02:41 AM
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 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 25 Aug 2010, 01:28 PM
Add this declaration to the top of the method
<CLSCompliantAttribute(False)> _
0
Julian Benkov
Telerik team
answered on 27 Aug 2010, 03:46 PM
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
Tags
GridView
Asked by
Eric Moreau
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Richard Slade
Top achievements
Rank 2
Julian Benkov
Telerik team
Share this question
or