How to databind control in GridViewDataColumn Data Template

3 posts, 0 answers
  1. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 07 Oct 2010 Link to this post

    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. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 07 Oct 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tingting
    Tingting avatar
    14 posts
    Member since:
    May 2012

    Posted 06 Jul 2012 Link to this post

    Hello, 

       I want to know how can i change the size of the icon witch is used to expand a row. 
      
    Thank you    
Back to Top