Telerik Forums
UI for WPF Forum
8 answers
152 views

Hi,

I am trying to set the orientation of the minimized items in the bottom panel, so instead of being horizontally oriented I want them to be vertically oriented.

(see attached PNG file)

 

I though that the best approach would be to edit a copy of the TileViewPanel template/style and change it but I am unable to create a copy of it neither using Blend nor Visual Studio. 

 

So, is there any easy way to set the orientation of the minimized panel? If not, could you please provide me with a copy of the TileViewPanel template?

 

Thanks in advance.

Martin Ivanov
Telerik team
 answered on 01 Sep 2017
5 answers
342 views
I've managed some fairly complicated controls, using RadDataForm, but now I'm trying something very simple, and it's not working.

The issue: I'm trying to create a user control that contains a RadDataForm that edits one object.  There's no readonly, no newitem, no selection of previous or next, there's one single object that should always be displayed in edit mode.

So, I declare a RadDataForm, and bind CurrentItem, but don't bind ItemsSource, and set AutoEdit="True":
<telerik:RadDataForm
    x:Name="radDataForm"
    CurrentItem="{Binding Path=DataContext.recordData,
                    RelativeSource={RelativeSource AncestorType=UserControl},
                    Converter={StaticResource debugBindingConverter}}"
    EditTemplate="{StaticResource editTemplate}"
    ReadOnlyTemplate="{StaticResource readonlyTemplate}"
    AutoEdit="True"
    AutoGenerateFields="False"
    />

The two templates at this point simply contain labels, declaring "EditItemplate" and "ReadonlyTemplate", so I can see which is being loaded. The code-behind is simple:
public partial class MyUserControl : KorUserControl
{
    public MyUserControl()
    {
        InitializeComponent();
        this.DataContext = new MyUserControlVM();
    }
}
 
public class MyUserControlVM
{
    public RecordData recordData
    { get; set; }
 
    public MyUserControlVM()
    {
        this.recordData = new RecordData();
    }
}
 
public class RecordData : INotifyPropertyChanged, IDataErrorInfo, IEditableObject
{
    public string aTestField
    { get; set; }
         
    #region INotifyPropertyChanged Members
    ...
    #endregion
 
    #region IDataErrorInfo Members
    ...
    #endregion
 
    #region IEditableObject Members
    ...
    #endregion
}

My problem? The form loads the readonly template, instead of the edit template.

Why?
Stefan
Telerik team
 answered on 31 Aug 2017
2 answers
79 views

When using HeaderTextWrapping and FilteringMode.FilterRow the headers does not look consistent. The filter-rows should take up the same height on all columns. This looks the same for several styles.

Solution: The GridViewHeaderRowTemplate contains a Grid named PART_OuterGrid, and it's second RowDefinition should have Auto-height.

Magnus
Top achievements
Rank 1
 answered on 31 Aug 2017
2 answers
74 views

For what it worth, playing around with the reminders example I found that it wouldn't open the appointment for edition when the "Open Item"  button is clicked.

I checked the git repository to see if this is already addressed, but the last update to this files is about 4 years old, so here is the trick:

 

It turns out that at the time where the scheduleview reference is passed to the ReminderViewModel constructor (via the ViewModel class constructor), it is null.

So I added a ScheduleView property to ViewModel as a fachade for the reminder's view model property:

        public RadScheduleView ScheduleView
        {
            get { return reminderViewModel.ScheduleView; }
            set { reminderViewModel.ScheduleView = value; }
        }

and set it again once the IntializeComponent() method is called in the Example window's constructor:

        public Example()
        {
            viewModel = new ViewModel(this.scheduleView);
            this.DataContext = viewModel;
            InitializeComponent();
            viewModel.ScheduleView = this.scheduleView;
        }

And presto! Now it works as expected.

 

Best regards.

Richard
Top achievements
Rank 1
Iron
 answered on 30 Aug 2017
2 answers
214 views

RadRichTextBox control is really a wonderful control, but their are problems when writing in Arabic (right to left). I could override those problems unless for a major problem; where if the user wanted to enclose an Arabic word within brackets, then the direction and position of brackets change, as shown in the attached image.

How to correct this abnormal behavior???!

Any help please !!!

thank you ...

 

①Dr Mostafa
Top achievements
Rank 1
 answered on 30 Aug 2017
1 answer
81 views

I have a case where the event handler that handles AppointmentSaving is invoked twice, but only every other time. It goes like this:

 

1) Find a calendar event

2) Drag the edge of the event to make it wider

3) Find a second event, and drag *that* event wider. AppointmentSaving will be called twice.

4) Repeat every other time. (2, 4, 6, 8, etc. with no end)

 

Here's the XAML setting up the event handler:

 

<i:EventTrigger
    EventName="AppointmentSaving">
    <vp:EventToCommandAction
        PassEventArgsToCommand="True"
        Command="{Binding HandleDowntimeSavingCommand, Mode=OneWay}" />
</i:EventTrigger>

 

Here's the event handler itself:

 

public ICommand HandleDowntimeSavingCommand => DelegateCommand.Create<AppointmentSavingEventArgs>(HandleDowntimeSaving);
internal void HandleDowntimeSaving(AppointmentSavingEventArgs eventArgs)
{
    var downtime = (DowntimeViewModel)eventArgs.Appointment;
    var numExceptionsRemoved = RemovePointlessExceptions(downtime);
    var numExceptionsConverted = ConvertExceptionsToIsolatedDowntimes(downtime);
    if (numExceptionsRemoved > 0 && numExceptionsConverted == 0)
    {
        eventArgs.Cancel = true;
    }
}

 

DelegateCommand.Create is used in literally thousands of places; it's not the source of the bug. If I set a breakpoint on the first line of the event handler, it will be hit twice, but only on every second edit.

Dilyan Traykov
Telerik team
 answered on 30 Aug 2017
5 answers
125 views

Hi! I'm using the implementation from the RowReorder-demo to get drag-n-drop in my RadGridView. It works really good, but I have an issue with copying. When reaching OnDrop the e.Effects are ALWAYS DragDropEffects.All (even when just moving an item).

In OnGiveFeedback the e.Effects is DragDropEffects.Copy (if pressing Ctrl), but it's not in OnDrop. I also checked the OnPreviewDrop method, but it's DragDropEffects.All there also.

Do I have to add something somewhere? In OnDragInitialize the e.AllowedEffects are set to DragDropEffects.All.

Magnus
Top achievements
Rank 1
 answered on 30 Aug 2017
1 answer
121 views

Hi

<telerik:RadScheduleView x:Name="scheduleView"  
                                 GroupDescriptionsSource="{Binding GroupDescriptions}" 
                                 ResourceTypesSource="{Binding Resources}" VisibleRangeChanged="scheduleView_VisibleRangeChanged"
                                 VisibleRangeChangedCommand="{Binding VisibleRangeChanged}" 
                                 VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}"
                                 GroupHeaderContentTemplateSelector="{StaticResource CustomGroupHeaderContentTemplateSelector}">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:DayViewDefinition />
                <telerik:WeekViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>

private void scheduleView_VisibleRangeChanged(object sender, EventArgs e)
        { 
            this.scheduleView.AppointmentsSource = new ObservableCollection<Appointment>();
        }

Kalin
Telerik team
 answered on 30 Aug 2017
3 answers
313 views

I am trying to figure out if it is possible to set the AutoFitColumnWidth or control the width of a column for the PDF output of a WPF Grid?

 

I have the following code for setting up my export options.

public void ExportToPdf(RadGridView grid)
{
    grid.ElementExportingToDocument -= Grid_ElementExportingToDocument;
    grid.ElementExportingToDocument += Grid_ElementExportingToDocument;
     
    var exportOptions = new GridViewDocumentExportOptions
    {
        AutoFitColumnsWidth = false,
        ExcludedColumns = { grid.Columns[9], grid.Columns[10], grid.Columns[11], grid.Columns[12] },
        ShowColumnHeaders = grid.ShowColumnHeaders
    };
 
    var dialog = new SaveFileDialog
    {
        DefaultExt = "pdf",
        FileName = SelectedCollege.CollegeCD + " - Roster.pdf",
        Filter = "Pdf Files|*.pdf"
    };
 
    if (dialog.ShowDialog() == true)
    {
        using (var stream = dialog.OpenFile())
        {
            grid.ExportToPdf(stream, exportOptions);
        }
    }           
}

 

I do not want ALL columns to auto size, because I have columns with single digit values in them and they look terrible squished together. I REALLY would like to set the width manually so the output looks good. 

My Grid columns are all Width="*" on the XAML side. And as you can see I am subscribing to the "ElementExportingToDocument" event and styling the grid to look the way it needs to look as far as foreground and background sizes. 

Are we limited only to the CellSelectionStyle properties when it comes to customizing the export? 

Martin Ivanov
Telerik team
 answered on 29 Aug 2017
1 answer
391 views

I'm just trying to do something that seemingly should be simple... trying to map individual checkboxes in a telerik:GridViewSelectColumn in a telerik:RadGridView to a corresponding Boolean property of an entity mapped for each individual row.

<telerik:RadGridView x:Name="MyGridView" ItemsSource="{Binding MyGridViewItems, Mode=TwoWay}" SelectionMode="Extended" AutoGenerateColumns="False">    
    <telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn Name="MyCheckBoxColumn">
   <telerik:GridViewSelectColumn.CellTemplate>
<DataTemplate>
   <CheckBox Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewDataControl}}, Path=DataContext.IncludeChangedCommand}" CommandParameter="{Binding}" IsChecked="{Binding MyBooleanProperty, Mode=TwoWay}" />
</DataTemplate>
   </telerik:GridViewSelectColumn.CellTemplate>                                            
</telerik:GridViewSelectColumn>

.
.
.

    </telerik:RadGridView.Columns>
</telerik:RadGridView>

 

How do I map MyBooleanProperty in each row/entity to each individual checkbox represented in the Grid?

Dinko | Tech Support Engineer
Telerik team
 answered on 29 Aug 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?