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

radRating with Lightswitch

1 Answer 49 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Supreet asked on 07 Jan 2012, 09:57 AM
   I am trying to use radRating control with a Lightswitch application.
I am using it within a DataGrid for which the columns are generated on the fly.

One of these columns has to be a Rating Control column.

To achieve this I've done a simple POC 
Here is what I've tried.

XAML on my User Control
        <!--<local:DateTimeConverter x:Key="DateConverter" />-->
        <DataTemplate x:Key="myCellTemplate">
            <rate:RadRating x:Name="myRatingControl"/>

    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadGridView Name="radGridView1" AutoGenerateColumns="False"></telerik:RadGridView>

C# code
Binding bind = new Binding();
                        bind.Path = new System.Windows.PropertyPath("childClass");
                        bind.Converter = new FeedbackValueConverters();
                        bind.ConverterParameter = i;
                        bind.Mode = BindingMode.TwoWay;

                        dg.Columns.Add(new GridViewDataColumn
                            Header = header,
                            IsReadOnly = true,
                            CellTemplate= (DataTemplate)dgAttendance.Resources["myCellTemplate"],
                            CellEditTemplate = (DataTemplate)dgAttendance.Resources["myTextBoxCellTemplate"],
                            DataMemberBinding = bind

With this I do see the columns generated with rating control but When I make changes to the value of any of these rating controls, Convert Back () method of value converter is not being called??

Is there something that is missing because of which the UI is not firing the event where the change has to be captured back in code?

Any help is appreciated.

Thanks & Reagrds

1 Answer, 1 is accepted

Sort by
Petar Mladenov
Telerik team
answered on 11 Jan 2012, 02:45 PM
Hi Supreet ,

Could you please check out this article and let us know if it helped you? Please notice that the control in the CellTemplate needs to have its Binding defined too:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Salary}">
   <telerik:RadNumericUpDown Value="{Binding Salary}" />
Actually you are specifying once the DataContext for the cell with the DataMemberBinding and then you are specifying the property to bind to.
Having this in mind, please try to re-factor your code to set the binding and converter in your XAML. You can also check out the attached project. Greetings,
Petar Mladenov
the Telerik team

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

Asked by
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question