Telerik Forums
UI for WPF Forum
3 answers
102 views

I have a RadGridView which contains one column which is for input, and this column contains a CellEditTemplate with several fields for input, like name, middle names and surname.

Name and surname must not be empty for the validation to pass. When I click to add new row, the form with these fields appear in view and I can edit them.

If I add text for the mandatory fields, name and surname and then click on other column in this new row, the validation passes and form collapses, which makes the row look as saved when its not.

This could have two solutions, either tell the user that the row is still in edit mode and its not saved, or just prevent the form from collapsing.

How can I do both things for example?

Display message that the row is still in edit mode, and prevent the form from collapsing if it is still in edit mode?

 

Note: I have cell validating event set, and also name and surname have "Required" data annotation attribute.

Dilyan Traykov
Telerik team
 answered on 25 Aug 2020
1 answer
832 views

Hello

Does Telerik UI for WPF have Stepper Control like Stepper in Telerik UI for ASP.NET Core?

Thanks in advanced
Abdulsalam

Martin Ivanov
Telerik team
 answered on 24 Aug 2020
0 answers
122 views

I have a ScheduleView control and I am using a GroupHeaderContentTemplateSelector and a ResourceTypeCollection to display 3 groups:

<scheduleView:ResourceTypeCollection x:Key="ResourcesTypes">
    <scheduleView:ResourceType Name="Schedule">
        <scheduleView:Resource ResourceName="ScheduleOrder" DisplayName="Orders" />
        <scheduleView:Resource ResourceName="ScheduleHeat" DisplayName="Heats" />
        <scheduleView:Resource ResourceName="ScheduleTundish" DisplayName="Tundishes" />
    </scheduleView:ResourceType>
</scheduleView:ResourceTypeCollection>

 

<localStyles:CustomGroupHeaderContentTemplateSelector x:Key="CustomGroupHeaderContentTemplateSelector">
    <localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding FormattedName}" Margin="2" Width="80" Height="30" VerticalAlignment="Center"/>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
        <DataTemplate>
            <telerik:LayoutTransformControl VerticalAlignment="Center">
                <telerik:LayoutTransformControl.LayoutTransform>
                    <RotateTransform Angle="0" />
                </telerik:LayoutTransformControl.LayoutTransform>
                <ContentPresenter Content="{Binding FormattedName}" Margin="5" Width="70"/>
            </telerik:LayoutTransformControl>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalResourceTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding Name.DisplayName}" Margin="2" Width="80" Height="30" VerticalAlignment="Center"/>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalResourceTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
        <DataTemplate>
            <telerik:LayoutTransformControl VerticalAlignment="Center">
                <telerik:LayoutTransformControl.LayoutTransform>
                    <RotateTransform Angle="0" />
                </telerik:LayoutTransformControl.LayoutTransform>
                <ContentPresenter Content="{Binding FormattedName}" Margin="5" Width="60" Height="23" MaxHeight="23" MinHeight="23"/>
            </telerik:LayoutTransformControl>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
     
</localStyles:CustomGroupHeaderContentTemplateSelector>

<scheduleView:RadScheduleView x:Name="scheduleViewOrders" Grid.RowSpan="2"
                              BorderThickness="0 1 1 1"
                              MinAppointmentHeight="20"           
                              FirstVisibleTime="00:00"
                              GroupHeaderContentTemplateSelector="{StaticResource CustomGroupHeaderContentTemplateSelector}"
                              AppointmentItemContentTemplate="{ StaticResource AppointmentTemplate}"
                              ResourceTypesSource="{StaticResource ResourcesTypes}"                                                             
                              ShowAppointmentDeleteButton="False"
                              ShowCurrentTimeIndicator="False"
                              HorizontalScrollBarVisibility="Visible">
    <scheduleView:RadScheduleView.ActiveViewDefinition>
        <scheduleView:DayViewDefinition GroupFilter="{Binding GroupFilter}" Orientation="Horizontal" VisibleDays="10" MinorTickLength="1h"
                                        MajorTickLength="1h" MinTimeRulerExtent="3000"/>
    </scheduleView:RadScheduleView.ActiveViewDefinition>                                   
    <scheduleView:RadScheduleView.GroupDescriptionsSource>
        <scheduleView:GroupDescriptionCollection>
            <scheduleView:DateGroupDescription></scheduleView:DateGroupDescription>
            <scheduleView:ResourceGroupDescription ResourceType="Schedule" />
        </scheduleView:GroupDescriptionCollection>
    </scheduleView:RadScheduleView.GroupDescriptionsSource>    
</scheduleView:RadScheduleView>

 

Now, the problem that I have is next: when I start the application there is no information to display (Image1), then I select a different day, where there is information, but something weird is happening, I can see only one row, the groups have disappeared along with the days (Image2) only after I scroll a little bit everything goes back to normal (Image3).

I am not sure what is happening, have you seen this behavior before?

 

Amige
Top achievements
Rank 1
Veteran
 asked on 21 Aug 2020
2 answers
186 views

Hi,

I tried adding a node and a link to the GraphSource. It worked but after this operation, the diagram layout seems to have been reset even though the AutoLayout property is set to True.

MainWindow.xaml.cs

using System;
using System.Windows;
using radDiagramTest.ViewModels;
using Telerik.Windows.Diagrams.Core;

namespace radDiagramTest
{
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();

      ClassificationGraphViewModel viewModel = RootGrid.Resources["ViewModel"] as ClassificationGraphViewModel;

      ClassificationDiagram.GraphSource = viewModel?.GraphSource;

      ClassificationDiagram.Loaded += ClassificationDiagram_Loaded;
      ClassificationDiagram.AutoFit( new Thickness( 10 ), false );
    }

    private void ClassificationDiagram_Loaded( Object _sender, RoutedEventArgs _e )
    {
      TreeLayoutSettings settings = new TreeLayoutSettings
      {
        TreeLayoutType = TreeLayoutType.TreeDown,
        HorizontalSeparation = 300d,
        VerticalSeparation = 75d
      };

      settings.Roots.Add( ClassificationDiagram.Shapes[0] );

      ClassificationDiagram.Layout( LayoutType.Tree, settings );
      ClassificationDiagram.AutoLayout = true;
      ClassificationDiagram.IsEditable = false;
    }
  }
}

NodeViewModel.cs (node custom view model where the Add button is)

using System;
using System.Windows;
using System.Windows.Input;
using radDiagramTest.ViewModels;
using Telerik.Windows.Controls.Diagrams.Extensions.ViewModels;

namespace radDiagramTest
{
  public class NodeViewModel : HierarchicalNodeViewModel
  {
    public NodeViewModel( ClassificationGraphViewModel _parent )
    {
      m_Parent = _parent;

      AddNodeCommand = new SimpleCommand( AddNodeCommandHandler );
    }

    public ICommand AddNodeCommand { get; set; }
    public String Name { get; set; }

    private void AddNodeCommandHandler()
    {
      NodeViewModel newNode = new NodeViewModel( m_Parent ) { Name = "New Node" };
      m_Parent.GraphSource.AddNode( newNode );

      LinkViewModel newLink = new LinkViewModel( this, newNode ) { Name = "New Edge" };
      m_Parent.GraphSource.AddLink( newLink );
    }

    private readonly ClassificationGraphViewModel m_Parent;
  }
}

Dominik
Top achievements
Rank 1
 answered on 21 Aug 2020
1 answer
216 views

Hi,I'm Using Custom Shape  and I want to Add a ListBox to the SettingsPaneView and Bind the shape's ViewModel to the Listbox ,but the data now show ,Anybody can help me,Thanks.

 

private List<AdjacentSpace6VM> _AdjacentSpaces;
 
    public List<AdjacentSpace6VM> AdjacentSpaces
    {
        get
        {
            return _AdjacentSpaces;
        }
        set
        {
            _AdjacentSpaces = value;
            OnPropertyChanged(() => this.AdjacentSpaces);
        }
    }
<ListBox extensions:SettingsPaneView.EditorPropertyName="DataContext.AdjacentSpaces" extensions:SettingsPaneView.EditorItemType="Shapes,Custom, Connections" extensions:SettingsPaneView.EditorValue="{Binding Path=ItemsSource, Mode=TwoWay, RelativeSource={RelativeSource Self}}" Grid.Row="3" Grid.ColumnSpan="2">
                      <ListBox.ItemsPanel>
                          <ItemsPanelTemplate>
                              <UniformGrid Columns="3" IsItemsHost="True" Margin="0" />
                          </ItemsPanelTemplate>
                      </ListBox.ItemsPanel>
                      <ListBox.ItemContainerStyle>
                          <Style TargetType="{x:Type ListBoxItem}">
                              <Setter Property="Template">
                                  <Setter.Value>
                                      <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                          <Grid>
                                              <Grid.ColumnDefinitions>
                                                  <ColumnDefinition></ColumnDefinition>
                                                  <ColumnDefinition></ColumnDefinition>
                                              </Grid.ColumnDefinitions>
                                              <TextBlock Grid.Column="0" Text="{Binding Number}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="30 10 0 20" Foreground="White"></TextBlock>
                                              <TextBlock Grid.Column="1" Text="{Binding CT}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="10 10 30 20" Foreground="White"></TextBlock>
                                              <TextBlock Grid.Column="1" Text="aaa" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="10 10 30 20" Foreground="White"></TextBlock>
                                          </Grid>
                                      </ControlTemplate>
                                  </Setter.Value>
                              </Setter>
                          </Style>
                      </ListBox.ItemContainerStyle>
                  </ListBox>
Vladimir Stoyanov
Telerik team
 answered on 21 Aug 2020
2 answers
82 views

Hey,

I have a few RadGridViews with editable data.
If someone now edits a value and commits the changes with the Return key, it does save the changes as expected. But also it jumps to the next row and starts the edit of the same column in this row.

Is it possible to disable this behaviour? So it may jump to the next row, but not starts the Edit Mode on it?

 

Greetings

Benedikt

Benedikt
Top achievements
Rank 4
Iron
Iron
Iron
 answered on 21 Aug 2020
1 answer
211 views

Hi,

 

I have a grouped GridView, which have many aggregate functions attached. Group headers showing some of the aggregate function results. 

When the user clicks a column header she expects grid to sort by aggregate results by group headers but the grid sorting by the original data source without group. This confuses our users.

 

Is there a way to sort gridview by group header aggregate results ? 

 

Thank you in advance.

Dilyan Traykov
Telerik team
 answered on 21 Aug 2020
1 answer
66 views

Hello,

I use the property Selection & Periodstart to change values in background.
Now I want to find out, what the user selected, but I cant find the difference.

I also tried to change ActualSelectionChanged it also gets triggered by user & background.

Is there any event which only triggers by user?

Regards

Dilyan Traykov
Telerik team
 answered on 20 Aug 2020
5 answers
1.3K+ views

I have a GridViewDataColumn declared as below in XAML. 

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding L3Size, StringFormat='0'}"  UniqueName="L3Size"<br>IsReadOnly="True" <br>SortMemberPath="L3Size" Width="60" CellStyleSelector="{StaticResource L3SizeStyler}" ><br>                        <telerik:GridViewDataColumn.Header><br>                            <TextBlock Text="L3 Sz" TextWrapping="Wrap" Style="{StaticResource TextBlockWhite}" /><br>                        </telerik:GridViewDataColumn.Header><br>                    </telerik:GridViewDataColumn><br>

 

A filter is applied on the grid for L3Size > 0 and it works fine.  L3Size for one of the rows becomes 0 and the value is correctly displayed as 0 on the grid. 

L3Size is set to 0 in the viewmodel. But that row doesnt get filtered out.

Any idea why its happening ?

 

Vladimir Stoyanov
Telerik team
 answered on 20 Aug 2020
2 answers
376 views

Hello,
I want to bind the DataObject.Pasting event of a TextBox with the EventToCommandBehavior to a command of the viewmodel:

<TextBox Grid.Column="3"
         HorizontalContentAlignment="Left" 
         Text="{Binding Offset, UpdateSourceTrigger=PropertyChanged}"
         VerticalContentAlignment="Center">
    <telerik:EventToCommandBehavior.EventBindings>
        <telerik:EventBinding Command="{Binding OffsetPastingCommand}" EventName="DataObject.Pasting" PassEventArgsToCommand="True"/>
    </telerik:EventToCommandBehavior.EventBindings>
</TextBox>

However, in the example above, the message "DataObject.Pasting event cannot be found" appears. What is the right way to bind the pasting event?
Thanks a lot
Christoph

Christoph
Top achievements
Rank 1
 answered on 20 Aug 2020
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
VirtualKeyboard
HighlightTextBlock
Security
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?