We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Rating control inside datagrid column not working

Thread ID:

Created:

Updated:

Platform:

Replies:

110507 Aug 8,2013 03:44 AM UTC Aug 28,2013 01:07 PM UTC WPF 1
loading
Tags: GridControl
Brett Klopfer
Asked On August 8, 2013 03:44 AM UTC

Hi,
I'm having trouble getting the rating control to display in a GridDataControl column. The rating control works fine outside a GridDataControl, however it is not rendered in the datagrid.

        <syncfusion:GridDataControl Name="dataGridSupplierList"
                                                Grid.Row="2"
                                                HorizontalAlignment="Stretch" 
                                                Margin="6,0" 
                                                VerticalAlignment="Stretch" 
                                                ItemsSource="{Binding SupplierList}" 
                                                SelectedItem="{Binding Path=SelectedSupplier, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                                IsSynchronizedWithCurrentItem="True" 
                                                ShowAddNewRow="False" 
                                                VisualStyle="Office14Black" 
                                                AutoPopulateColumns="False" 
                                                AutoPopulateRelations="False"
                                                AllowEdit="False" 
                                                ShowFilters="False"
                                                ShowGroupDropArea="True"
                                                >
            <syncfusion:GridDataControl.VisibleColumns>
                <syncfusion:GridDataVisibleColumn HeaderText="Supplier" MappingName="Name" Width="180" AllowFilter="True">
                    <syncfusion:GridDataVisibleColumn.HeaderStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                    </syncfusion:GridDataVisibleColumn.HeaderStyle>
                    <syncfusion:GridDataVisibleColumn.ColumnStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Left" CellTypeEnum="TextBlock" />
                    </syncfusion:GridDataVisibleColumn.ColumnStyle>
                </syncfusion:GridDataVisibleColumn>
 
                <syncfusion:GridDataVisibleColumn HeaderText="Trading" MappingName="Trading" Width="120" AllowFilter="True">
                    <syncfusion:GridDataVisibleColumn.HeaderStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                    </syncfusion:GridDataVisibleColumn.HeaderStyle>
                    <syncfusion:GridDataVisibleColumn.ColumnStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Left" CellTypeEnum="TextBlock" />
                    </syncfusion:GridDataVisibleColumn.ColumnStyle>
                </syncfusion:GridDataVisibleColumn>
 
                <syncfusion:GridDataVisibleColumn HeaderText="Suburb" MappingName="Suburb" Width="180" AllowFilter="True">
                    <syncfusion:GridDataVisibleColumn.HeaderStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                    </syncfusion:GridDataVisibleColumn.HeaderStyle>
                    <syncfusion:GridDataVisibleColumn.ColumnStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Left" CellTypeEnum="TextBlock" />
                    </syncfusion:GridDataVisibleColumn.ColumnStyle>
                </syncfusion:GridDataVisibleColumn>
 
                <syncfusion:GridDataVisibleColumn HeaderText="State" MappingName="State" Width="80" AllowFilter="True">
                    <syncfusion:GridDataVisibleColumn.HeaderStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                    </syncfusion:GridDataVisibleColumn.HeaderStyle>
                    <syncfusion:GridDataVisibleColumn.ColumnStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Left" CellTypeEnum="TextBlock" />
                    </syncfusion:GridDataVisibleColumn.ColumnStyle>
                </syncfusion:GridDataVisibleColumn>
 
                <syncfusion:GridDataVisibleColumn HeaderText="Status" MappingName="Rating" Width="120" AllowFilter="True">
                    <syncfusion:GridDataVisibleColumn.HeaderStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                    </syncfusion:GridDataVisibleColumn.HeaderStyle>
                    <syncfusion:GridDataVisibleColumn.ColumnStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" CellTypeEnum="IntegerEdit" />
                    </syncfusion:GridDataVisibleColumn.ColumnStyle>
                </syncfusion:GridDataVisibleColumn>
 
                <syncfusion:GridDataVisibleColumn HeaderText="Status2" MappingName="RatingDouble" Width="200">
                    <syncfusion:GridDataVisibleColumn.HeaderStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                    </syncfusion:GridDataVisibleColumn.HeaderStyle>
                    <syncfusion:GridDataVisibleColumn.ColumnStyle>
                        <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" CellTypeEnum="DataBoundTemplate">
                            <syncfusion:GridDataColumnStyle.CellItemTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="30" />
                                        </Grid.ColumnDefinitions>
                                        <sfrating:SfRating Value="{Binding Path=CellBoundValue}" ItemsCount="5" Precision="Standard" HorizontalAlignment="Stretch" ShowToolTip="False" Visibility="Visible" Width="120" Grid.Column="0" />
                                        <TextBlock Text="{Binding CellBoundValue}" Grid.Column="1" />
                                    </Grid>
                                </DataTemplate>
                            </syncfusion:GridDataColumnStyle.CellItemTemplate>
 
                        </syncfusion:GridDataColumnStyle>
                    </syncfusion:GridDataVisibleColumn.ColumnStyle>
                </syncfusion:GridDataVisibleColumn>
 
            </syncfusion:GridDataControl.VisibleColumns>
 
        </syncfusion:GridDataControl>
Everything else works fine, just the rating control. The textbox (for diagnostics only) adjacent to the rating control also displays the correct value, just can't see the rating control.

Any help would be greatly appreciated.

Saravanan M [Syncfusion]
Replied On August 28, 2013 01:07 PM UTC

Hi Brett,

We have analyzed your query  . you need to set proper Height for sfRating then only it will be visible in UI. Please refer the below code snippet.

<sfrating:SfRating Value="{Binding Path=CellBoundValue}"

                   ItemsCount="5" Precision="Standard"

                   Height="150"  Width="150"

                   VerticalAlignment="Stretch"

                   HorizontalAlignment="Left"

                   ShowToolTip="False"

                   Visibility="Visible"

                   Grid.Column="0" />

 

 

Please let us know if you have any queries,

Regards,

Saravanan.M


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;