We use the following code to put a filter on tree items which work great intially.
snip .....
TreeListView.FilterDescriptors.SuspendNotifications();
ClearFilters();
ApplyFilter(Reflector.GetProperty<ProjectReleaseLineViewModel>((line) => line.HasError).Name, true, FilterOperator.IsEqualTo);
snip ......
private void ClearFilters()
{
foreach (var column in TreeListView.Columns.OfType<Telerik.Windows.Controls.GridViewBoundColumnBase>())
{
var filterControl = column.FilteringControl as ColumnFilterControl;
if (filterControl != null)
{
filterControl.Reset(column);
}
}
}
private void ApplyFilter(string member, object value, FilterOperator @operator = FilterOperator.IsEqualTo)
{
var filter = new CompositeFilterDescriptor();
filter.FilterDescriptors.Add(new FilterDescriptor(member, @operator, value));
var colum = TreeListView.Columns.OfType<GridViewBoundColumnBase>().Skip(2).First();
colum.DataControl.FilterDescriptors.Add(filter);
}
When performing this action the tree explands showing the lines which have errors.
The strange behaviour happens after that through the following actions.
- The use manually collapses the expanded items al the way to level zero
- Then the filter is cleared through the following code
How to implement Telerik checkbox in WPF to trigger functions while still remembering original state?
I have a checkbox that when checked should exclude an item in a RadGridView while still remembering the state (of the item being included), so if (or when) a user unchecks the checkbox, the item is included back in the list within the RadGridView. Essentially setting the original data back when unchecked to revert back to original data.
Hi!
When I create a ConditionalDataTemplateSelector to use as CellTemplateSelector in a GridView, I have to specify the name of the field in my DataTemplateRule like this:
<telerik:ConditionalDataTemplateSelector x:Key="PriceSelectedSelector"> <telerik:DataTemplateRule Condition="IsSelected = False OR IsSelected = null" Template="t1" /> <telerik:DataTemplateRule Condition="IsSelected = True" Template="t2" /></telerik:ConditionalDataTemplateSelector>But if I have a lot of columns that are just true/false I have to create a new ConditionalTemplateSelector for each and every column. Is there a way to build this in a more general way like "If the value in this cell is true, take template t1" so I could use my ConditionalTemplateSelector on different columns regardless of the name of the field?
Regards
Heiko
Dear Telerik Team,
I've been playing with TileList for a while and it seems like the items virtualization does not work despite it is using an items panel that *should* allow virtualization. the documentation does not state whether TileList does support virtualization (it does for few other controls).
Cheers, Greg
Hi Team,
I have used the RadSplitButton to show the drop down along with button. But the drop down popup is opened outside window, please share any idea to load the popup only within window. Please refer the below code
<telerik:RadSplitButton Margin="20,152,0,0" Foreground="#8F8F8F" HorizontalAlignment="Left" VerticalAlignment="Top" Content="DROP DOWN"> <telerik:RadSplitButton.DropDownContent> <StackPanel Orientation="Vertical"> <telerik:RadListBox ItemsSource="{Binding AddressBooks}" BorderThickness="0"> <telerik:RadListBoxItem>AAA AAA AAA AAA</telerik:RadListBoxItem> <telerik:RadListBoxItem>BBB BBB BBB BBB</telerik:RadListBoxItem> <telerik:RadListBoxItem>CCC CCC CCC CCCC CCC</telerik:RadListBoxItem> </telerik:RadListBox> <Button Content="ADD NEW" BorderThickness="0,1,0,0"/> </StackPanel> </telerik:RadSplitButton.DropDownContent></telerik:RadSplitButton>
Please refer the attached image to know more about the issue. And I am using Windows 8.1 OS.
Regards,
Antony Raj
Hi. Im trying to create a DataFormDataField for comments. The requirements are that the textbox needs to accept return, wrap and always show 3 lines no matter the ammount of text.
my first attempt i came up with the following
<telerik:DataFormDataField x:Name="Comm"
Label="Comments"
LabelPosition="Above"
Width="355"
Canvas.Left="10"
Canvas.Top="61">
<TextBox Height="50"
AcceptsReturn="True"
TextWrapping="Wrap"
Text="{Binding BIGCOMMENTS, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="{Binding IsReadOnly, ElementName=Comm, Mode=OneWay}"
VerticalContentAlignment="Top"
TabIndex="18" />
</telerik:DataFormDataField>
works nice until you need to resize, it gets a bit wonky. second attempt was to modify the template in blend.
<ControlTemplate x:Key="WBDataFormMultiLineDataField"
TargetType="{x:Type telerik:DataFormDataField}">
<Border x:Name="PART_RootElement"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
CornerRadius="{DynamicResource {x:Static telerik:Office2016ResourceKey.CornerRadius}}"
UseLayoutRounding="True">
<Grid x:Name="PART_DataFormDataFieldGrid"
Margin="{TemplateBinding Padding}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="24" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentControl x:Name="PART_Label"
ContentTemplate="{TemplateBinding LabelTemplate}"
Content="{TemplateBinding Label}"
Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
IsTabStop="False"
Margin="4,0"
VerticalAlignment="Center"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
<TextBox x:Name="PART_ContentPresenter"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Grid.Row="1"
Text="{Binding DataMemberBinding, RelativeSource={RelativeSource TemplatedParent}}"
VerticalAlignment="Stretch"
AcceptsReturn="True"
TextWrapping="Wrap"
VerticalContentAlignment="Top"
TabIndex="18" />
<Grid x:Name="DescriptionIcon"
Background="Transparent"
Grid.Column="2"
HorizontalAlignment="Center"
Margin="4,0,0,0"
Grid.Row="1"
VerticalAlignment="Center">
<Grid.ToolTip>
<ToolTip Content="{TemplateBinding Description}" />
</Grid.ToolTip>
<Grid.Visibility>
<Binding Path="Description"
RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<dataForm:DescriptionVisibilityConverter />
</Binding.Converter>
</Binding>
</Grid.Visibility>
<TextBlock Foreground="{DynamicResource {x:Static telerik:Office2016ResourceKey.IconBrush}}"
FontWeight="Normal"
FontStyle="Normal"
FontSize="16"
FontFamily="/Telerik.Windows.Controls;component/Themes/Fonts/TelerikWebUI.ttf#TelerikWebUI"
HorizontalAlignment="Center"
Margin="1,0,0,0"
Text=""
VerticalAlignment="Center"><Run Text="" /></TextBlock>
</Grid>
</Grid>
</Border>
</ControlTemplate>
I basically replaced the content presenter (which was showing a text box) with an acutal textbox. this works much better in terms of resizing, however i lose functionality for 'DataMemberBinding', which i need.
Any ideas to an ideal solution?