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

Header in RadGridView

1 Answer 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 30 Nov 2010, 04:35 PM
Hi,

I have couple of things about the RadGridView in particular. I have created a Radgidview in following way:-

<UserControl x:Class="MySampleClass"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
              mc:Ignorable="d"
              d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <telerik:RadGridView Grid.Column="0" Grid.Row="0"
                             x:Name="MainGridView"
                             ItemsSource="{Binding Path=MetricsData}"
                             AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" ShowGroupPanel="False" RowIndicatorVisibility="Visible" SelectionMode="Extended" SelectionUnit="Cell"
                             IsFilteringAllowed="False"
                             SelectedCellsChanged="MainGridView_SelectedCellsChanged">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="ColA" Name="Mkt" DataMemberBinding="{Binding Path=Market, Mode=OneWay}" IsResizable="False" IsSortable="False" IsReadOnly="True" />
                <telerik:GridViewDataColumn Header="ColB" Name="SiD" DataMemberBinding="{Binding Path=Sub1, Mode=OneWay}" IsResizable="False" IsSortable="False" IsReadOnly="True" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</UserControl>

This user control resides inside a ScrollViewer(which is inside a GroupBox) in the topmost Page.

The first thing is when I access column name using GridViewCellInfo.Column.UniqueName in code-behind, it returns the string from Binding Path, I was expecting the value from the header name. Is there any way to get the header value or name element.

Other thing, when the radgridview contains many elements and scrolled down, I want the header row to be fixed and only its contained elements to be scrolled. How can I achieve this.

When a mouse rollover occurs over some particular elements of RadgidView, I want to change the visibility of them as hyperlinks(some underline bar appears and color changes to blue) to show that these elements are clickable (I am handling Selected event). Is there any property over some column that I set.

Thanks,
Mark

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 02 Dec 2010, 04:50 PM
Hi Mark,

The UniqueName property of the column returns the Binding path of the property towards which the column is bound. However, if you explicitly set it, once you try to retrieve the UniqueName, you will get the value you have set. In case you want to find the Header name, you may use the corresponding property - Header.
Considering your second issue with scrolling, it is not possible to keep up the Header of the columns and still be able to scroll with the ScrollView. Furthermore, please keep in mind the the ScrollViewer measures with infinity and once you place the grid inside, you automatically disable the virtualization. This may result in degraded performance in case you manage a great amount of data.
As for your last requirement, you may try to work with the IsMouseOver property. However, I would need more details about the exact scenario you want to achieve so that I could provide any further suggestion.
 

Kind regards,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or