<Grid x:Name="LayoutRoot" DataContext="{StaticResource DataContext}"> <telerik:RadPdfViewer x:Name="pdfViewer" DocumentSource="A10000292S_Notice.pdf" /> </Grid> 
private void Window_Loaded(object sender, RoutedEventArgs e)
{
List<string> strings = new List<string>();
radGridView1.ItemsSource = strings;
strings.Add("a");
strings.Add("b");
strings.Add("c");
radGridView1.Items.Refresh();
}
The rows do not appear until I click a column header to re-order that column. As Items.Refresh() does not work what can I call to make the rows appear?
I know using an ObservableCollection rather than list<string> will work, but I can't do that in this situation.
thanks
Hi,
I have two styling issues wtih the GridView. The first is I am trying to by default set a column style to not display the Filter for a column by default (we only have a few columns in each grid that are filterable). My code is as follows:
<Style TargetType="telerik:GridViewColumn" > <Setter Property="IsFilterable" Value="False"/> </Style>Second, I have a cell style set as well but I now when I set the Background brush for a column it has no affect. What am I doing wrong?
<Style TargetType="telerik:GridViewCell" > <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:GridViewCell}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/> </Border> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="BorderBrush" Value="#FFEFEFEF" /> <Setter Property="BorderThickness" Value="0,0,1,0" /> <Setter Property="Margin" Value="2,0,0,0"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Stretch"/> </Style>In the gridview I am setting the background as such:
Any help would be greatly appreciated!
David A.
<telerik:GridViewDataColumn DataMemberBinding="{Binding HoursCompleted}" Header="Hours" UniqueName="HoursCompleted" DataFormatString=" {0:n2}" HeaderTextAlignment="Center" Width="60" Background="#33FDA500"/>
Our use case is to have a grid which can be expanded to show more granular details including child data, similar to your samples. One of the catches is that not all the data is available in the ItemsSource collection of objects. To avoid what will appear as a memory leak over time, we chose to load / unload the child data as needed. We have success using the RowIsExpandedChanged event to manage the data. We also use the HierarchyChildTemplate and specify the DataTemplate as a collective group of controls and UserControls.
One of these UserControls is another GridView to present a collection of child details of the parent record. This user control will subscribe to events and update its grid with additions and edits. To wire up these events we use an identifier passed to the control via a DependancyProperty. We have found that once a row has been expanded and the UserControl initialized for those events it will remain in effect even when the row is collapsed. To confirm this we wired up the CoerceValueCallback on the DependancyProperty and it is not getting fired when we expand the row after the first time. We understand that due to the virtualization rows are destroyed when out of view. So, in turn, just the event of the user scrolling around will perform a sort of "clean up." As good practice of not leaving resources in use when no longer visible, is there some property we should be setting to destroy the HierarchyChildTemplate when the row is collapsed?
Here are some segments of code we are using.
<Telerik:RadGridView Grid.Row="1" x:Name="radGridViewMain" ItemsSource="{Binding Incidents}"
IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False"
RowIsExpandedChanged="radGridViewMain_RowIsExpandedChanged"
ShowGroupPanel="True" RowIndicatorVisibility="Collapsed"
TelerikGridViewHeaderMenu:GridViewHeaderMenu.IsEnabled="True"
CustomFilter:CustomFilterBehavior.TextBox="{Binding ElementName=textBoxFilter}">
<Telerik:RadGridView.ChildTableDefinitions>
<Telerik:GridViewTableDefinition>
<Telerik:GridViewTableDefinition.Relation>
<TelerikWindowsData:PropertyRelation ParentPropertyName="PrimaryKey"/>
</Telerik:GridViewTableDefinition.Relation>
</Telerik:GridViewTableDefinition>
</Telerik:RadGridView.ChildTableDefinitions>
<Telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<Controls:ChildItems PrimaryKey="{Binding PrimaryKey}" />
For I As Integer = 0 To Me.RadTileView1.Items.Count - 1
Dim item As RadTileViewItem = TryCast(Me.RadTileView1.Items(6), RadTileViewItem)
item.TileState =
TileViewItemState.Maximized
Thread.Sleep(5000)
Next