Telerik Forums
UI for WPF Forum
1 answer
131 views

Hello,

There is an issue when RadGridView does not re-evaluate row item if filter property of viewmodel (datacontext of the row) was changed.

For example, RadGridView contains the FilterDescriptor to display all customers where address property is "Address1". It works fine i.e. RadGridView  shows only customers where address property equals to "Address1. But then I'll change the address property of viewmodel item from "Address1" to "Address2". And I can see this row on GridView. Expected behavior is RadGridView should filter out customer where address property equals to "Address2".

Is here any workaround?

Thank you,

Yuriy.

Ivan Ivanov
Telerik team
 answered on 18 Jul 2017
1 answer
170 views

Hi,

I tried to use "search as you type" on my GridViewComboBoxColumn. But it doesn't work.

When I type something on the search bar doesn't found anything on grid.

<UserControl.Resources>       
        <CollectionViewSource x:Key="DirectionsCollectionViewSource" x:Name="DirectionsCollectionViewSource" />
    </UserControl.Resources>
 
......
<telerik:GridViewComboBoxColumn UniqueName="Direction" Header="Direction"
                                          DataMemberBinding="{Binding Path=Direction, UpdateSourceTrigger=PropertyChanged}"
                                          SelectedValueMemberPath="Value"
                                          ItemsSource="{Binding Source={StaticResource DirectionsCollectionViewSource}}"                                                                                                       
                                          DisplayMemberPath="Label">                   
              </telerik:GridViewComboBoxColumn>

 

Collection View Source is populated with the following values:

List<SSCStringValueObject> directions = new List<SSCStringValueObject>();
           directions.Add(new SSCStringValueObject("O", "Out");
           directions.Add(new SSCStringValueObject("I", "In");
 
           return directions;

 

Telerik version used: 2017.2.614.45

 

What am I missing? Can you provide me an example, please?

 

Thank you

Dilyan Traykov
Telerik team
 answered on 18 Jul 2017
1 answer
668 views

Hi,

The following code works by searching text on telerik:RadGridView . It highlights all appearance of the text on all columns (i.e. 12 columns) of the data.

Our client requests to only highlight the appearance of the text on the specific 3 columns of the data. no highlights happen on the rest of columns of data no matter if it matches.

Can somebody help me out?

Thanks in advance.

Zhen

public void DoSearch(string text)
{
var grid = this.ExtendedControl;
var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
searchBytextCommand.Execute(text, grid);
}

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Jul 2017
1 answer
166 views

Hello,

In my code, for Raddiagram, default SettingsPaneHomeControl is used. In that there are options such as Bring to Front,Back,Forward,Backward.

Bring to Back, Front works properly. But Bring to forward, backward does not detect first click, and after second it works properly for some diagrams, and for some diagrams it does not work.

How i should i debug this? 

Is there any way i can change its properties?

 

Thanks in advance.

Martin Ivanov
Telerik team
 answered on 18 Jul 2017
2 answers
168 views

Hi, 

I have these comboboxes that use a keyed style that defines the ClearSelectionButtonContent, the first combobox that is clicked looses its ClearSelectionButtonContent after clicking on another one. To try it out, create a new WPF app and paste the code below in the MainWindow.xaml file and experiment with it, you will see what I mean. It can even be seen in design mode. I'm using VS 2017 (15.2 2643.15) and telerik 2017.1.222.45. 

Thanks for looking into this issue.

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
    x:Class="WpfApp2.MainWindow"
    Title="MainWindow" Height="150" Width="325">
    <Window.Resources>
        <Style x:Key="radcomboboxstyle" TargetType="{x:Type telerik:RadComboBox}">
            <Setter Property="ClearSelectionButtonVisibility" Value="Visible"/>
            <Setter Property="ClearSelectionButtonContent">
                <Setter.Value>
                    <Grid>
                        <Ellipse Height="20" Width="20" Fill="Red"/>
                        <TextBlock Text="X" TextElement.FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" />
                    </Grid>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <Label Content="ComboBox1" VerticalAlignment="Center"/>
            <telerik:RadComboBox Width="150" Height="30" Style="{StaticResource radcomboboxstyle}" >
                <telerik:RadComboBoxItem Content="Item 1"/>
                <telerik:RadComboBoxItem Content="Item 2"/>
                <telerik:RadComboBoxItem Content="Item 3"/>
            </telerik:RadComboBox>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="1">
            <Label Content="ComboBox2" VerticalAlignment="Center"/>
            <telerik:RadComboBox Width="150" Height="30" Style="{StaticResource radcomboboxstyle}" >
                <telerik:RadComboBoxItem Content="Item 1"/>
                <telerik:RadComboBoxItem Content="Item 2"/>
                <telerik:RadComboBoxItem Content="Item 3"/>
            </telerik:RadComboBox>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="2">
            <Label Content="ComboBox3" VerticalAlignment="Center"/>
            <telerik:RadComboBox Width="150" Height="30" >
                <!-- Setting the style explicitly instead of via a reference to the keyed style defined in the resources -->
                <telerik:RadComboBox.Style>
                    <Style TargetType="{x:Type telerik:RadComboBox}">
                        <Setter Property="ClearSelectionButtonVisibility" Value="Visible"/>
                        <Setter Property="ClearSelectionButtonContent">
                            <Setter.Value>
                                <Grid>
                                    <Ellipse Height="20" Width="20" Fill="Red"/>
                                    <TextBlock Text="X" TextElement.FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" />
                                </Grid>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </telerik:RadComboBox.Style>
                <telerik:RadComboBoxItem Content="Item 1"/>
                <telerik:RadComboBoxItem Content="Item 2"/>
                <telerik:RadComboBoxItem Content="Item 3"/>
            </telerik:RadComboBox>
        </StackPanel>
    </Grid>
</Window>

Michel Cossette
Top achievements
Rank 1
 answered on 17 Jul 2017
13 answers
437 views
Hi
I have a problem with the RadDocking pane which doesn't auto-hide after selecting an item in a list box contained within the RadPane. I want the user to be able to mouse-over the pane header to show the pane (in unpinned mode) and then click or double click an item in the list contained within the pane. When the user moves the mouse away or sets focus to another part of the application, the pane should auto-hide.
Currently if the user mouses over the pane header, the pane slides into view, and on mouse leave the pane auto-hides correctly. However, if they mouse over the header and then select an item in the list box on the pane, the pane then refuses to auto-hide, no matter what control gets focus after that. The only way to hide the pain is then to manually pin and unpin it.

How can I get the pane to auto-hide correctly?

XAML below:

<
telerik:RadDocking>
      <telerik:RadDocking.DocumentHost>
          <!--document here-->
      </telerik:RadDocking.DocumentHost>
           
      <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft">
          <telerik:RadPaneGroup>                       
              <telerik:RadPane IsPinned="True" Header="Products" CanUserClose="False"
                              CanFloat="False"
                              CanDockInDocumentHost="False"
                              ContextMenuTemplate="{x:Null}">
                  <telerik:RadPane.HeaderTemplate>
                      <DataTemplate>
                          <TextBlock Text="{Binding}" Margin="0, 0, 80, 0"/>
                      </DataTemplate>
                  </telerik:RadPane.HeaderTemplate>
                       
                  <!--Product List-->
                  <telerik:RadListBox>
                             <!--- databound to product list -->
                  </telerik:RadListBox>
              </telerik:RadPane>
          </telerik:RadPaneGroup>
      </telerik:RadSplitContainer>
  </telerik:RadDocking>

Thanks,
Guy
Kevin
Top achievements
Rank 1
 answered on 17 Jul 2017
2 answers
712 views

I am attempting to set a column's cell template in code to a template that is also generated in code, but its not working as I assumed it would.
The template seems to only be applied to one row at a time, always the last row to draw. I suspect this is because its an instance of a template and not a resource, but I'm not sure the right way to set this up.

I am making a custom search control that displays results in a grid; I need to add a button to a column and hook the click event up. It is much easier for me to set up in code in this case.

 

public override void OnApplyTemplate()
{
    base.OnApplyTemplate();

   //find grid column control part
    GridViewColumn PART_SelectColumn = GetTemplateChild("PART_SelectColumn") as Telerik.Windows.Controls.GridViewColumn;

    //make cell content
    RadButton btn_SelectItem = new RadButton() { Content = "Add"};
    btn_SelectItem .Click += PART_SelectItem_Click;

    //generate template - code builds a sealed datatemplate with the button as the content
    DataTemplate SelectTemplate = DataTemplateExtentions.CreateDataTemplate ( () => { return btn_SelectItem }  );

    //Set the column's cell template - I suspect this is what I'm doing wrong
    PART_SelectColumn.CellTemplate = SelectTemplate;

}

 

see attached image; the template only applies to the last row. 

Anyone know where I'm going wrong?

 

jen
Top achievements
Rank 1
 answered on 17 Jul 2017
4 answers
363 views

Hello

 

When I set DropDownPlacement = "Left", the MenuItem sometimes opens to the left, sometimes to the right.
If I set DropDownPlacement = "Right" the same game - the MenuItem opens sometimes left, sometimes right.

 

<telerik:RadMenu x:Name="topmenu" Grid.Row="0" Grid.ColumnSpan="4" IconColumnWidth="0" VerticalAlignment="Top" HorizontalAlignment="Stretch">
            <telerik:RadMenuItem Header="Allgemein" DropDownPlacement="Bottom">
                <telerik:RadMenuItem Header="Beenden" Command="{Binding ExitApplicationCommand}"/>
                <telerik:RadMenuItem Header="Info" Command="{Binding InfoCommand}"/>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Header="Protokolle" Command="{Binding OpenChangeProtocolViewCommand}"/>
 
            <telerik:RadMenuItem DataContext="{Binding MenuDocuments}" ItemsSource="{Binding ChildMenuItems, UpdateSourceTrigger=PropertyChanged}"
                                 Header="{Binding Header, UpdateSourceTrigger=PropertyChanged}" StaysOpenOnClick="True"
                                 DropDownPlacement="Left">
                <telerik:RadMenuItem.Resources>
                    <HierarchicalDataTemplate DataType="{x:Type local:MenuItemViewModel}" ItemsSource="{Binding ChildMenuItems, UpdateSourceTrigger=PropertyChanged}">
                        <telerik:RadMenuItem Header="{Binding Header, UpdateSourceTrigger=PropertyChanged}"
                                             Command="{Binding ExecuteCommand}" StaysOpenOnClick="True"
                                             DropDownPlacement="Left">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="MouseEnter" >
                                    <i:InvokeCommandAction Command="{Binding MouseEnterCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </telerik:RadMenuItem>
                    </HierarchicalDataTemplate>
                </telerik:RadMenuItem.Resources>
            </telerik:RadMenuItem>
        </telerik:RadMenu>

 

We would like, that all menuitem always open on the left site from parent menu.

Is this possible with the RadMenu Control?

For what purpose is the setting DropDownPlacement?

 

Thank you

Birgit
Top achievements
Rank 1
 answered on 17 Jul 2017
1 answer
282 views

Hello.

 

I have a column in my RadGridView that's bound to a DateTime field of my data source. It's showing both date and time (i.e. 7/7/2017 2:22 PM). When I'm clicking the Filter button (next to the column name) I'm getting the filtering popup with the distinct values and two Date pickers. Is there a way to make them DateTime pickers instead?

 

I tried to use AutoGenerateColumns="True" so that my customizations don't interfere but I'm still getting Date pickers.

Thank you.

Dilyan Traykov
Telerik team
 answered on 17 Jul 2017
9 answers
630 views

I use ExportToXlsx to export gridview data to an excel file using the following code snippet

 

gridView.ExportToXlsx(fs, new GridViewDocumentExportOptions()
{
    ShowColumnHeaders = true,
    AutoFitColumnsWidth = true
});

 

 Sometimes when opening the file in Excel I get the error message:

 

     Excel found unreadable content in ... Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.

 

I can open the file after clicking yes, but the content is not in sync with the information as shown in the GridView.

It seems that this happens when the grid has empty cells e.g. we have a date field which can be omitted (null).

If I use the exportToPdf method al goes well using the same date in the gridview. So it seems it's an issue related to Excel export.

Is this a bug or otherwise how can I fix this issue? 

I use version 2015.1.401.45

 

Regards,
Peter

 

Yana
Telerik team
 answered on 17 Jul 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?