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

Define Columns in Xaml for a Derived RadGridView

2 Answers 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jean Paul Mir V.
Top achievements
Rank 1
Jean Paul Mir V. asked on 12 Apr 2012, 12:57 AM
Hi,

I'm trying to create a Custom GridView by inheriting RadGridView and adding some specific functionality. So far, the custom control definition is plain basic:
Imports Telerik.Windows.Controls
Imports System.ComponentModel
 
Public Class MCPaginatedGridView
    Inherits RadGridView 
End Class

This usercontrol is inside of a user control library referenced across all Prism modules in a big solution.
When I'm trying to instantiate this control in a different assembly like this:

<MCControls:MCPaginatedGridView Grid.Row="12"
                                Grid.Column="0"
                                Grid.ColumnSpan="5"
                                FontSize="10"
                                MinHeight="250" 
                                AutoGenerateColumns="False">
    <MCControls:MCPaginatedGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding LoteCobranzaDetalleId}" Header="ID" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NumeroContrato}" Header="Contrato" UniqueName="NumeroContrato" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding CedulaDomiciliatario}" Header="Cedula" UniqueName="CedulaDomiciliatario" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NombreDomiciliatario}" Header="Nombre" UniqueName="NombreDomiciliatario" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding FechaValor, Mode=TwoWay}" DataFormatString="{}{0:d}" Header="Fecha Valor" UniqueName="FechaValor" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding FechaVencimiento, Mode=TwoWay}" DataFormatString="{}{0:d}" Header="Fecha Venc." UniqueName="FechaVencimiento" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding SaldoCuota, Mode=TwoWay}" Header="Monto" DataFormatString="{}{0:c}" UniqueName="Saldo" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding MontoPendientePorProcesar, Mode=TwoWay}" DataFormatString="{}{0:c}" Header="Pendiente" UniqueName="MontoPendientePorProcesar" />
    </MCControls:MCPaginatedGridView.Columns>
</MCControls:MCPaginatedGridView>

... an exception is thrown by the Xaml Editor indicating that: "The property 'MCControls:MCPaginatedGridView.Columns' is not declared as attached property"

Could you please provide any help on this?

Thanks in advance
JP

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Apr 2012, 07:20 AM
Hello,

 Do you have all needed references added to this project? You can check the grid assemblies here:
http://www.telerik.com/help/silverlight/installation-installing-controls-dependencies.html 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jean Paul Mir V.
Top achievements
Rank 1
answered on 12 Apr 2012, 04:57 PM
Hi Vlad,

Thanks for your answer!
Yes, I have all these references in both projects: The controls library and the prism module (Here copyLocal=False).
In fact, I've used telerik in other cases directly (not deriving it) and it works fine...

Any Ideas?
Tags
GridView
Asked by
Jean Paul Mir V.
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jean Paul Mir V.
Top achievements
Rank 1
Share this question
or