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

How to databind control in GridViewDataColumn Data Template

2 Answers 403 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Art Kedzierski
Top achievements
Rank 2
Art Kedzierski asked on 07 Oct 2010, 02:51 PM
I'm having an issue getting a RadProgressBar to databind in a DataTemplate of a GridViewData Column. Here is my code:

<telerik:RadGridView Name="radGridView1"
                     Canvas.Left="48"
                     Canvas.Top="48"
                     telerik:StyleManager.Theme="Transparent"
                     ShowGroupPanel="False"
                     AutoGenerateColumns="False"
                     ItemsSource="{Binding}"
                     IsFilteringAllowed="False"
                     CanUserSelect="False"
                     RowIndicatorVisibility="Collapsed"
                     RowStyle="{DynamicResource GridViewRowStyle1}"
                     HeaderRowStyle="{DynamicResource GridViewHeaderRowStyle1}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Width="300"
                                    DataMemberBinding="{Binding Path=TSE, Converter={StaticResource TSEconverter}}"
                                    Header="TSE"
                                    CellStyle="{StaticResource GridViewCellStyle1}"
                                    HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}" />
        <telerik:GridViewDataColumn Width="100"
                                    DataMemberBinding="{Binding Path=My_Count}"
                                    Header="Count"
                                    CellStyle="{StaticResource GridViewCellStyle1}"
                                    HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}"
                                    TextAlignment="Center"
                                    HeaderTextAlignment="Center" />
        <telerik:GridViewDataColumn Width="150"
                                    DataMemberBinding="{Binding Path=My_Percent_Double, Mode=OneWay}"
                                    Header="Status"
                                    CellStyle="{StaticResource GridViewCellStyle1}"
                                    HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}"
                                    TextAlignment="Center"
                                    HeaderTextAlignment="Center">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                            <telerik:RadProgressBar Name="PercentBar"
                                                    Orientation="Horizontal"
                                                    Margin="0"
                                                    Height="24"
                                                    Style="{StaticResource statusBar}"
                                                    Value="{Binding Path=My_Percent_Double, Mode=OneWay}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn Width="100"
                                    DataMemberBinding="{Binding Path=My_Status}"
                                    Header="2pd"
                                    CellStyle="{StaticResource GridViewCellStyle1}"
                                    HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}"
                                    TextAlignment="Center"
                                    HeaderTextAlignment="Center" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

I can see the progress bar on project run, but no values are present (zero bars). What am I doing wrong?

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 07 Oct 2010, 03:29 PM
Hi Art Kedzierski,

The proper way would be to create a custom column as demonstrated in this blog post.

Greetings,
Veselin Vasilev
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
0
Tingting
Top achievements
Rank 1
answered on 06 Jul 2012, 07:28 AM
Hello, 

   I want to know how can i change the size of the icon witch is used to expand a row. 
  
Thank you    
Tags
GridView
Asked by
Art Kedzierski
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Tingting
Top achievements
Rank 1
Share this question
or