Telerik Forums
UI for WPF Forum
0 answers
81 views
Hi,

I currently have a viewmodel such that it has a grid full of appointments. I would like to double click and open up my CalendarView with the editappointmentdialog opened for the record that was selected. May I ask how would I do that in an MVVM style? 
Minh
Top achievements
Rank 1
 asked on 31 May 2016
1 answer
184 views

I want to hide the properties which has nested properties inside them. What is best approach to do them? Ihave tries following things

1. setting NestedPropertiesVisibility="Hidden" for radpropertygrid. But it not working.

2. setting visiblility of propertydefinition based on displayname.The code looks like

private void PropertyGrid1_AutoGeneratingPropertyDefinition(object sender, AutoGeneratingPropertyDefinitionEventArgs e)
      {
          if (e.PropertyDefinition.DisplayName == "Mypropertyname")
          {
              e.PropertyDefinition.Visibility = Visibility.Hidden;  
          }
      }

second approach works but I dont want to do on the basis of Displayname.I need to be hidden if any propertydefinition under property has nested property

 

Would you please help me with the same.

 

 

Dilyan Traykov
Telerik team
 answered on 31 May 2016
1 answer
202 views

Hi,

I've been trying to find documentation of just importing a workbook into a radspread sheet. I looked at the sample demos from GitHub and I tried to understand them, but alas, I cannot figure it out. So, if there is a file called "Test.xlsx" on my desktop, how could I import that into my spreadsheet?

 

Thank you for your help.

Tanya
Telerik team
 answered on 31 May 2016
9 answers
294 views
Hello Telerik,

We are developing and application using WPF and the MVVM design pattern.

We have a case where we've created a "dialog" to select a single value using the RadGridView where the result is selected from a nested RadGridView (the nested RadGridView's go only 1 level deep). You can see an example of our dialog in the attached screenshot.

The issue is a selection inconsistency. The issue is as follow:
a) Expand a row to reveal the embedded GridView, select a row from the embedded GridView making note of the specific cell clicked on the select the row.
b) Expand another row to reveal another embedded GridView and select a row from that embedded GridView.
c) Then try to reselect the row in "step a" by click on the exact same cell clicked on when selected the first time ... CANNOT SELECT THE ROW!

It appears that clicking on a row will still "select" the cell even though the GridView SelectionUnit is set to "FullRow". I'm assuming the solution is to prevent the cell selection altogether, but I can seem to find a solution.

Please see code below

Best Regards,
Roland

<tgrid:RadGridView x:Name="radGridView" Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Margin="6,0,6,6" VerticalAlignment="Stretch" IsReadOnly="True" RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False" ScrollMode="Deferred" ItemsSource="{Binding CollectionView.ItemsSource}" DataLoadMode="Asynchronous" IsFilteringAllowed="False" ShowGroupPanel="False" ShowColumnHeaders="True" EnableColumnVirtualization="False" CanUserResizeColumns="False" CanUserDeleteRows="False" AutoGenerateColumns="False" CanUserReorderColumns="False" IsScrolling="False" ShowInsertRow="False" ValidatesOnDataErrors="None" int:RadGridViewAdapter.SortDirection="{Binding CollectionView.SortDirection, Mode=TwoWay}" int:RadGridViewAdapter.SortMember="{Binding CollectionView.SortMember, Mode=TwoWay}" Grid.RowSpan="1" SelectionMode="Single" int:RadGridViewHierarchicalAdapter.HierarchicalAdapterEnabled="True" int:RadGridViewHierarchicalAdapter.HierarchicalSelectedItemsBinding="{Binding SelectedArticles}" int:RadGridViewHierarchicalAdapter.AutoSelectLowerLevel="True" SelectionUnit="FullRow">
<tgrid:RadGridView.Columns>
<tgrid:GridViewDataColumn Header="Title" Width="*" DataMemberBinding="{Binding Title}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="Title" TextTrimming="WordEllipsis" />
<tgrid:GridViewDataColumn Header="Brand" Width="*" DataMemberBinding="{Binding Brand}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="Brand" TextTrimming="WordEllipsis" />
<tgrid:GridViewDataColumn Header="Specification}" Width="*" DataMemberBinding="{Binding Specification}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="Specification" TextTrimming="WordEllipsis" ToolTip="{Binding Specification}" />
<tgrid:GridViewDataColumn Header="GroupKind}" Width="*" DataMemberBinding="{Binding Kind}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="Kind" TextTrimming="WordEllipsis" ToolTip="{Binding Kind}" />
</tgrid:RadGridView.Columns>
<tgrid:RadGridView.ChildTableDefinitions>
<tgrid:GridViewTableDefinition>
<tgrid:GridViewTableDefinition.Relation>
<Data:PropertyRelation ParentPropertyName="Articles" />
</tgrid:GridViewTableDefinition.Relation>
</tgrid:GridViewTableDefinition>
</tgrid:RadGridView.ChildTableDefinitions>
<tgrid:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<tgrid:RadGridView x:Name="radGridViewChild" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True" RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False" ScrollMode="Deferred" ItemsSource="{Binding Articles}" IsFilteringAllowed="False" ShowGroupPanel="False" ShowColumnHeaders="True" EnableColumnVirtualization="False" CanUserResizeColumns="False" CanUserDeleteRows="False" AutoGenerateColumns="False" CanUserReorderColumns="False" IsScrolling="False" ShowInsertRow="False" ValidatesOnDataErrors="None" Grid.RowSpan="1" SelectionMode="Extended" SelectionUnit="FullRow">
<tgrid:RadGridView.Columns>
<tgrid:GridViewDataColumn Header="Number" Width="Auto" DataMemberBinding="{Binding ArticleNumber}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="Number" />
<tgrid:GridViewDataColumn Header="TypeNumber" Width="Auto" DataMemberBinding="{Binding TypeNumber}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="TypeNumber" />
<tgrid:GridViewDataColumn Header="Description" Width="Auto" DataMemberBinding="{Binding ErpDescription}" IsFilterable="False" IsCustomSortingEnabled="False" IsGroupable="False" IsSortable="True" UniqueName="Description" />
</tgrid:RadGridView.Columns>
</tgrid:RadGridView>
</DataTemplate>
</tgrid:RadGridView.HierarchyChildTemplate>
 
<tgrid:RadGridView.ScrollPositionIndicatorTemplate>
<DataTemplate>
<TextBlock Text="{Binding Title}" FontWeight="Bold" />
</DataTemplate>
</tgrid:RadGridView.ScrollPositionIndicatorTemplate>
</tgrid:RadGridView>
Dilyan Traykov
Telerik team
 answered on 31 May 2016
2 answers
124 views

Hi,

I noticed that if you paste a hyperlink containing an anchor such as this into a RichTextBox, everything except the anchor's name will be removed from the href attribute, resulting in links that do not work.

Do you have any advice or tips on a way to work around this?

Thanks

Tanya
Telerik team
 answered on 31 May 2016
7 answers
494 views
Hi,

 

I am using the sample from Telerik Demo to create pie chart, and register to .LayoutUpdate event, at which doing following:

        private void pieChart_LayoutUpdated(object sender, System.EventArgs e)
        {
            var paths = ChildrenOfTypeExtensions.ChildrenOfType<Path>(PieChart.Series[0]).ToList();
            if (paths.Count == 0)
                return;
            PieChart.LayoutUpdated -= pieChart_LayoutUpdated;
            foreach (var path in paths)
            {
                var dataPoint = path.Tag as PieDataPoint;
                if (dataPoint == null)
                    return;
                    path.MouseEnter += uiElement_MouseEnter;
                    path.MouseLeave += uiElement_MouseLeave;
            }
        }
        private void uiElement_MouseEnter(object sender, MouseEventArgs e)
        {
            var bar = (UIElement) sender;
            bar.Opacity = 0.5;
        }
        private void uiElement_MouseLeave(object sender, MouseEventArgs e)
        {
            var bar = (UIElement)sender;
            bar.Opacity = 1;
        }
 

But I wanted more than just highlighting on pie "path", I want the associated label to be highlighted too.

Which at the moment, I am doing something like this:

        <Style x:Key="SlicerNameTextBoxStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{Binding DataItem, Converter={StaticResource SlicerToBrushConverter}}"></Setter>
            <Setter Property="FontWeight" Value="{Binding DataItem, Converter={StaticResource SlicerToNameConverter}}"></Setter>
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{StaticResource MouseOverBrush}"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

                <telerik:PieSeries.LabelDefinitions>
                    <telerik:ChartSeriesLabelDefinition Margin="-4,0,0,0"
                                                        DefaultVisualStyle="{StaticResource SlicerNameTextBoxStyle}">
                        <telerik:ChartSeriesLabelDefinition.Template>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock Text="{Binding DataItem.DisplayName}"
                                               HorizontalAlignment="Center"
                                               Style="{StaticResource SlicerNameTextBoxStyle}"
                                               MouseDown="SlicerPieLabel_OnMouseDown"/>
                                </StackPanel>
                            </DataTemplate>
                        </telerik:ChartSeriesLabelDefinition.Template>
                    </telerik:ChartSeriesLabelDefinition>
                </telerik:PieSeries.LabelDefinitions>

 

As you can see, the problem is that I can't connect the pie slice and label highlight together, and I duplicated the pie selection changed event.

Can you help me to provide a better solution here?

Thanks,

Mingxue

 

Petar Marchev
Telerik team
 answered on 31 May 2016
1 answer
100 views

I have a child RadGridview contained in the row details of a master RadGridView defined through a data template .

Each row of the child RadGridview has an active checkbox bound to a viewmodel.  

If a child checkbox  is checked , as the master RadGridView is scrolled to hide the details of a row and then back again , that checkbox returns unchecked.

The viewmodel still shows the value as checked.

Any help would be appreciated.

 

 

 

Dilyan Traykov
Telerik team
 answered on 30 May 2016
7 answers
93 views
I have a RadGridView which contains several columns. I have Sum function for part of the columns which show decimal number. Now when I drag the columns which do not have Sum function that can show the Count function result, how to archive this? Just add Count function to those columns will show both of the result.
Dilyan Traykov
Telerik team
 answered on 30 May 2016
1 answer
184 views
The documentation for RadSpreadsheet says that it supports PixelBased scrolling. How do I enable this? I tried setting the attached property ScrollViewer.CanContentScroll = False, but it doesn't appear to have worked.
Tanya
Telerik team
 answered on 30 May 2016
1 answer
81 views

RadScheduleView: clipping appointment name in Edit mode.

Hi, I need the appointment name in the schedule control to auto-expand to fit whatever the name of the appointment is. This is most troublesome in Edit mode, I get something like "This is the na..." - the rest of the name is clipped in the scheduler grid.

Please advise with a work-around.

Telerik.Windows.Controls.dll v. 2016.1.217.40

Barry

Yana
Telerik team
 answered on 30 May 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?