Telerik Forums
UI for WPF Forum
1 answer
67 views

Hi, I have a docking pane hosting a Winform property control.

When I set the pane to a Autohide state, the Winform property in it disappears.

I'm using the latest 2016 Q2 release. Please help!

Nasko
Telerik team
 answered on 28 Jul 2016
2 answers
127 views

Hi,

I want to apply a different CurrentVisibleRangeText dependant on what view definition the user is in.

So DayView would be in the format ddd dd\MM\yyyy

Timeline and MonthView would be dd\MM\yyyy - dd\MM\yyyy

So I've changed the CurrentInterval ContentControl to use VisibleRange instead of CurrentVisibleText :

<ContentControl x:Name="CurrentInterval"
      VerticalAlignment="Center"
      HorizontalAlignment="Right"
      Style="{StaticResource NavigationIntervalStyle}"
      Content="{TemplateBinding VisibleRange}"/>

Now how do I apply the NavigationIntervalStyle?  So far I have :

<Style x:Key="NavigationIntervalStyle" TargetType="ContentControl">
    <Setter Property="Margin" Value="5" />
    <Setter Property="VerticalAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Right" />
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="ContentTemplate">
        <Setter.Value>
            <DataTemplate>
                <Grid>
                    <TextBlock Margin="0 1 0 0" Text="{Binding Path=Start, StringFormat={}{0:ddd dd/MM/yyyy}}" Foreground="White" />
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

This works ok for DayView but obviously not giving me what I want for Timeline or MonthView - I would presume I would need another TextBlock linked to VisibleRange.End - but how to set the Visibility of this textbox so I don't get it in DayView?  Also would it be at all feasible for MonthView to run off the actual Month date and not just what is visible.. i.e. so it says 01/07/2016 - 31/07/2016 and not 27/07/2016 - 31/07/2016 (which is the actual VisibleRange of the month).

Kieron
Top achievements
Rank 1
 answered on 27 Jul 2016
3 answers
516 views

I am changing ItemsSource of RadGridview.

    gv.ItemsSource = enumerated;

     gv.Rebind();

After that I am clearing all the Descriptors

    gv.FilterDescriptors.Clear();
    gv.SortDescriptors.Clear();
    gv.GroupDescriptors.Clear();

Then reapplying all Descriptors.

    gv.FilterDescriptors.AddRange(filters);
    gv.SortDescriptors.AddRange(sorts);
    gv.GroupDescriptors.AddRange(groups);

But the RadGridview is not showing new Items, instead showing items Filtered before.
Dilyan Traykov
Telerik team
 answered on 27 Jul 2016
8 answers
265 views

Hi,

I want the ability for the user to be able to click on a Group Header (in DayView) and for the Group Header and Row to be Selected - however a few issues I cant seem to solve :

I'm overriding the GroupHeaderBaseStyle but can't seem to bind the Command on the GroupHeaderButton to my ViewModel - how do I go about achieving this so I can catch when the user has clicked on each GroupHeader?

There doesn't seem to be an IsSelected property for the GroupHeader - so how would I go about storing this information as per the user clicking on each header?

Thanks.

Kieron
Top achievements
Rank 1
 answered on 27 Jul 2016
10 answers
338 views
Is there a way to prevent the closing of the Backstage until a condition is true. So if the user clicks on another tab, I would like to keep it open.

Gord
Top achievements
Rank 1
 answered on 27 Jul 2016
11 answers
562 views

Hi,

I need to implement DragDrop feature between listBoxes and also re-order within ListBox. I know there is one good sample from Demo, see attachment screenshot. But What I am missing here is the Drop preview line. I know in RadTreeView, there is the default DragDrop behavior comes with a good Drop preview line and API for me to enable/disable it. How can I do the same for ListBox?

I thought about using RadTreeView to take advantage of the default DragDrop behavior, but don't know how to make the UI layout to look like this one in ListBox. Please advise if there is any alternatives to get the layout like the one in the demo, and the drop preview line in RadTreeView.

Many thanks,

Mingxue

Nasko
Telerik team
 answered on 27 Jul 2016
3 answers
119 views

When I import the word file attached, it has a stackOverFlow exception when I running following code 

            foreach (var section in document.Sections)
            {
                document.CaretPosition.MoveToEndOfDocumentElement(section);
                editor.ChangeSectionColumns(SectionColumnsLayout.One);
            }

Is there any way to solve it, or how can I modify the word file to avoid the crash?

Todor
Telerik team
 answered on 27 Jul 2016
8 answers
219 views

Hi,

I want to to move dataform's button (add, edit, delete, navigation, cancel and commit) outside of the DataForm maintaining their appearance , so when I change application's theme from windows8 to windows8touch , the appearance of the buttons change like if it was in the dataform.

thanks

Yoan
Telerik team
 answered on 27 Jul 2016
4 answers
209 views

Hello,

I'm having trouble to automatically expand all groups within a RadGridView. I set the AutoExpandGroups to true and also call the RadGridView's method ExpandAllGroups(). It does expand all the groups, but it also adds an unwanted white space to my grid, that vanishes after I manually collapse one of the groups.

I also tried to set the GroupRenderMode to Flat. It solves the white space issue, but it adds unwanted information to my groups' headers.

Is there a way to make it work properly?

 

*Telerik UI for WPF version 2015.3.930.45

Thanks in advance.

Stefan
Telerik team
 answered on 27 Jul 2016
3 answers
972 views

I'm trying to create a column with a delete button that the user will use to delete rows. I want to force the user to use this button when they want to delete a row.

These were my requirements

  1. Clicking the delete button deletes the row immediately
  2. Clicking Delete on the keyboard won't delete the row
  3. The user can't enter the delete row by clicking outside of the button or using Tab to move between cells

Things I've done so far

  1. Created the column with the button and bound it to RadGridViewCommands.Delete
  2. Used the PreviewKeyDown event to stop the row delete when the user clicks Delete on the keyboard
  3. Set TabStopMode="Skip" and IsReadOnly="true" on the column with the delete buttons to keep the use from entering the delete column

So far this works but I found two issues (possibly the same issue but may require different solutions)

  1. When I create a new row, I can't click the delete button
  2. If I edit the value in a cell, I can't click the delete button

I figured they may be the same issue because they both have to do with being in edit mode for a row.

 

Issue when creating a new row

I run my project, click the bottom of the grid to create a new row, then try clicking the delete button on that row. Nothing happens.

It probably doesn't make much sense to delete a row while it's being added so that may be why this doesn't work. If possible I would like the delete button to cancel adding the new row, so kind of like a delete. If this isn't possible, I would like to be able to hide the button when a new row is created so it's obvious to the user they can't click it.

 

Issue when editing a row

I run my project, double click in one of the cells to start editing the cell, the try clicking the delete button. Again, nothing happens. The cell being edited seems to lose focus and no longer shows the edit box but I can't click the delete button. To get the delete to work I have to single click into a different cell and then click the delete button.

 

I appreciate any help you can provided.

 

This is the XAML for MainWindow

<Window
    x:Class="TelerikWpfGridViewDeleteButton.MainWindow"
    xmlns:local="clr-namespace:TelerikWpfGridViewDeleteButton"
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525"
    DataContext="{StaticResource MyViewModel}">
 
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
     
    <Grid>
        <telerik:RadGridView
            Name="RadGridViewVariableCutOff"
            ItemsSource="{Binding GridRows}"
            Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
            GroupRenderMode="Flat"
            NewRowPosition="Bottom"
            ShowGroupPanel="False"
            RowIndicatorVisibility="Collapsed"
            CanUserFreezeColumns="False"
            AutoGenerateColumns="False"
            SelectionMode="Single"
            SelectionUnit="Cell"
            PreviewKeyDown="RadGridViewVariableCutOff_PreviewKeyDown">
 
            <telerik:StyleManager.Theme>
                <telerik:Office_SilverTheme/>
            </telerik:StyleManager.Theme>
 
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn
                    Header="First Value"
                    Width="1*"
                    DataMemberBinding="{Binding Path=FirstValue}"/>
 
                <telerik:GridViewDataColumn
                    Header="Second Value"
                    Width="1*"
                    DataMemberBinding="{Binding Path=SecondValue}"/>
 
                <telerik:GridViewDataColumn
                    Header=""
                    Width="26"
                    TabStopMode="Skip"
                    IsReadOnly="True"
                    CellStyle="{StaticResource TelerikNoCellPadding}">
 
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadButton
                                Template="{StaticResource FlatImageButton}"
                                Margin="0"
                                Command="telerikGrid:RadGridViewCommands.Delete"
                                CommandParameter="{Binding}">
                                <Image Source="Delete_WithPadding.png"/>
                            </telerik:RadButton>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
 
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
 
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

 

This is the code behind for MainWindow

using System.Windows;
using System.Windows.Input;
 
namespace TelerikWpfGridViewDeleteButton
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void RadGridViewVariableCutOff_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Delete) e.Handled = true;
        }
    }
}

 

This is my view model

using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
 
namespace TelerikWpfGridViewDeleteButton
{
    public class MyViewModel : INotifyPropertyChanged
    {
        private ObservableCollection<RowData> gridRows;
        public ObservableCollection<RowData> GridRows
        {
            get
            {
                if (gridRows == null)
                {
                    gridRows = new ObservableCollection<RowData>();
                    gridRows.Add(new RowData() { FirstValue = 1, SecondValue = 2 });
                    gridRows.Add(new RowData() { FirstValue = 3, SecondValue = 4 });
                    gridRows.Add(new RowData() { FirstValue = 4, SecondValue = 6 });
                }
 
                return gridRows;
            }
            set
            {
                gridRows = value;
                NotifyPropertyChanged();
            }
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

 

This is the class used in the observable collection

namespace TelerikWpfGridViewDeleteButton
{
    public class RowData
    {
        public decimal FirstValue { get; set; }
        public decimal SecondValue { get; set; }
 
        public RowData()
        {
        }
    }
}

 

This is my resource dictionary

<ResourceDictionary
    xmlns:local="clr-namespace:TelerikWpfGridViewDeleteButton">
     
    <ControlTemplate x:Key="FlatImageButton" TargetType="{x:Type Button}">
        <Border x:Name="bdr_main" SnapsToDevicePixels="True" BorderThickness="1" CornerRadius="0" Background="White">
            <ContentPresenter RecognizesAccessKey="True"></ContentPresenter>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="bdr_main" Property="BorderBrush" Value="Black"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
 
    <Style x:Key="TelerikNoCellPadding" TargetType="{x:Type telerik:GridViewCell}">
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Padding" Value="0"/>
    </Style>
</ResourceDictionary>

 

And this is my App.xaml

<Application x:Class="TelerikWpfGridViewDeleteButton.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:TelerikWpfGridViewDeleteButton"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <local:MyViewModel x:Key="MyViewModel" />
    </Application.Resources>
</Application>

 

And I've attached the delete button image I used

Stefan
Telerik team
 answered on 27 Jul 2016
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?