Telerik Forums
UI for WPF Forum
1 answer
768 views

Dear Team,

how i can show/load Dashboard.xaml page in RadNavigationView.Content on click of Dashboard View Item

 

<telerik:RadNavigationView x:Name="navigationView"
                                   PaneHeader="RadNavigationView"
                                   SelectedIndex="0"
                                   DisplayMode="Expanded"
                                   AutoChangeDisplayMode="False">
            <telerik:RadNavigationView.Items>
                <telerik:RadNavigationViewItem Content="Dashbard" Icon="&#xe303;" IconTemplate="{StaticResource IconTemplate}"  Click="RadNavigationViewItem_Click" />
                <telerik:RadNavigationViewItem Content="a" Icon="&#xe301;" IconTemplate="{StaticResource IconTemplate}"  />
                <telerik:RadNavigationViewItem Content="B" Icon="&#xe132;" IconTemplate="{StaticResource IconTemplate}"  />
                <telerik:RadNavigationViewItem Content="c" Icon="&#xe906;" IconTemplate="{StaticResource IconTemplate}"  />
            </telerik:RadNavigationView.Items>
            <telerik:RadNavigationView.PaneFooter>
                <telerik:RadNavigationViewItem Content="About" Icon="&#xe401;" 
                                               IconTemplate="{StaticResource IconTemplate}" 
                                               CommandParameter="{Binding ElementName=navigationView}"  />
            </telerik:RadNavigationView.PaneFooter>
            <telerik:RadNavigationView.Content>
                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                   
                </StackPanel>
            </telerik:RadNavigationView.Content>
        </telerik:RadNavigationView>


Stenly
Telerik team
 answered on 14 Feb 2022
1 answer
148 views

Hello,

I have a cartesian chart with line series based on data like this for every chart point

public class ChartEntry
{
    public int Number;
    public DateTime TimeStamp;
    public double Value1;
    public double Value2;
}

My series use Value1/2 for ValueBinding and Number for CategoryBinding. Horizontal axis is of type CategoricalAxis.

I want to add a (toggle)button to switch the horizontal axis from Number to TimeStamp (and back) during runtime.

Means, that I have to change CategoryBinding of series to TimeStamp and horizontal axis to type DateTimeContinuousAxis.

 

At the moment I have no clue how to do that. Any ideas? 

 

Thanks and regards

Stenly
Telerik team
 answered on 14 Feb 2022
1 answer
159 views

I am trying to update themes in a WPF application at run time.   The application is using the no XAML dlls.  The theme is being updated by replacing the resource dictionaries according to Theme change instructions.

When the resource dictionaries are replaced the theme updates for the entire application but all the tabs in the dock disappear.  New tab can be added to the Items Observable collection and they will appear in the dock.

 

        <telerik:RadDocking x:Name="Dock" 
                            AllowDragReorder="True"
                            PanesSource="{Binding Items, UpdateSourceTrigger=PropertyChanged}"
                            CloseButtonPosition="InPane">
            <telerik:RadDocking.DockingPanesFactory >
                <telerik:DockingPanesFactory />
            </telerik:RadDocking.DockingPanesFactory>
        </telerik:RadDocking>


Stenly
Telerik team
 answered on 11 Feb 2022
2 answers
129 views

Hello,

I need a way to Drag & Drop an Item from the Context Menu and then GridView Columns to reordered based on the Context Menu Items ordering. This is for a WPF application.

As I understood this is not supported, I am writing here in any case I just didn't find the solution.

 

Thank you !!

Marios
Top achievements
Rank 1
Iron
 answered on 10 Feb 2022
1 answer
197 views

Hi,

I have a list of RadExpander, inside every Radexpander there is a Radgridview. When  I expand, expander height grow over the size of window and a scroll bar appears in expander control itself.
I would like that expander doesn't grow over the window and the scroll bar appears in the gridview. I could achieve this behaviour setting maxheight in gridview, but I don't want to limit the height of grid.In first attachment the situation when maxheight is not set, in the second with maxheight set, I would achieve the second situation but without setting maxheight.

Thank you

Luigi

 

Below it is the xaml as appears in LiveVisualTree: I think that the real one it is too much complex to understand the situation quickly.


<Grid x:Uid="Grid_1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<t:RadDocking x:Name="radDocking1"
                            RetainPaneSizeMode="DockingAndFloating"
                            CanAutoHideAreaExceedScreen="True"
                            Grid.Row="1" Margin="0 0 0 10"                            
                            BorderThickness="0"
CloseButtonPosition="InPane"
                            Padding="0"
  Close="radDocking1_Close"
  PaneStateChange="radDocking1_PaneStateChange">
<t:RadSplitContainer 
MinWidth="310"
MaxWidth="600" t:DockingPanel.InitialSize="260,150"
                    Name="RightContainer" InitialPosition="DockedRight">
<t:RadPaneGroup >
<t:RadPane>
<t:RadPanelBar 
HorizontalContentAlignment="Stretch"
ExpandMode="Multiple" Name="PanelBarCursor"
t:StyleManager.Theme="Office_Blue"
ScrollViewer.VerticalScrollBarVisibility="Visible">
<t:RadPanelBarItem 
VerticalAlignment="Top"
HorizontalContentAlignment="Left"
Header="{DynamicResource CursoriAssociati}">
<StackPanel>
<t:RadListBox ItemsSource="{Binding TabCursori.Cursori}" 
  SelectionMode="Single"
  Loaded="RadListBox_Loaded"
  SelectedItem="{Binding TabCursori.SelectedCursor}">
<t:RadExpander t:AnimationManager.IsAnimationEnabled="false" IsExpanded="{Binding IsExpanded, Mode=TwoWay}">
<t:RadExpander.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<t:RadGridView 
MaxHeight="250"
ItemsSource="{Binding PositionsY}"
CanUserDeleteRows="False"
CanUserInsertRows="False"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
ShowColumnHeaders="False"
ShowColumnFooters="False"
ShowGroupPanel="False"
ShowScrollPositionIndicator="False"
ShowSearchPanel="False"
SelectedItem="{Binding 
RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=t:RadDocking},
Path=DataContext.TabCursori.PositionHilight}"
   IsReadOnly="True">
<t:RadGridView.Resources>
<Style TargetType="t:GridViewRow">
<Setter Property="SelectedBackground" Value="Bisque"/>
</Style>
</t:RadGridView.Resources>
<t:RadGridView.Columns>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterName}" Width="100"/>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterValue, StringFormat=N1}" Width="80"/>
</t:RadGridView.Columns>
</t:RadGridView>
<!--<TextBlock Text="{Binding Internal.PositionY, StringFormat={}{0:F4}}"
   Visibility="{Binding PositionYVisibility, Converter={StaticResource BoolToVis}}"/>-->
</Grid>
</t:RadExpander.Content>
</t:RadExpander>
</t:RadPanelBarItem >
</t:RadPanelBar>
</t:RadPane>
</t:RadSplitContainer >
</t:RadDocking>
</grid>
Martin Ivanov
Telerik team
 answered on 10 Feb 2022
0 answers
93 views
I've been struck with a dilemma. A certain RadWindow contains a RadTabControl, that has a Tab with RadCartesianCharts and a WebBrowser on it. I discovered that the web browser wasn't able to show when we changed all Windows into RadWindows, and the solution would be to use the RadWindowInteropHelper to set the transparency to false. This solved the WebBrowser's issue and now it displays, but suddenly the colored bars on the charts don't appear, so it seems the transparency was necessary for them. I'm not sure if there's a way for me to have both appear or if I'll need to make changes to how the application should work. 
Evan
Top achievements
Rank 1
 asked on 09 Feb 2022
1 answer
110 views

I have this working for properties of the GroupHeaderRow. How do I change the text of the header row?

 Property="Header" Value = "{}{0} test" and  Property="Content" Value = "{}{0} test"  dont seems to do anything.

 public class GroupRowStyleSelector : StyleSelector
    {
        public override Style SelectStyle(object item, DependencyObject container)
        {
            var group = item as QueryableCollectionViewGroup;   
            if (group.count > 1)
            {               
                return BigGroupStyle;
            }
            else
            {
                return SmallGroupStyle;
            }
        }

        public Style BigGroupStyle { get; set; }
        public Style SmallGroupStyle { get; set; }     
    }
<Window.Resources>
        <local:GroupRowStyleSelector x:Key="GroupRowStyleSelector">
            <local:GroupRowStyleSelector.BigGroupStyle>
                <Style TargetType="telerik:GroupHeaderRow">
                     <Setter Property="Background" Value="Red" />
                </Style>
            </local:GroupRowStyleSelector.BigGroupStyle>
            <local:GroupRowStyleSelector.SmallGroupStyle>
                <Style TargetType="telerik:GroupHeaderRow">
                <Setter Property="Background" Value="Yellow" />
                </Style>
            </local:GroupRowStyleSelector.SmallGroupStyle>
        </local:GroupRowStyleSelector>
    </Window.Resources>


Dilyan Traykov
Telerik team
 answered on 09 Feb 2022
2 answers
183 views

Hi Telerik team,

I would like to have the foreground of the series labels same as the series color.

Below picture is the expected result:

 

Would you please help me how to obtain this?

Many thanks,

Minh Tuan.

minh
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 09 Feb 2022
0 answers
120 views

I followed the instructions in this post to group based on data.

I modified the Github example AlternationRowStyleSelector  I changed the Club.cs code slightly to create a more manageable dataset for this example.

I used reflection to inspect the data in a property on the model.  For this example I looked at the data in the "Est." column.  I want to change the style when the value changes. 

Here is the modified code from AlternationRowStyle.cs

    public Style RowStyle { get; set; }
    public Style AltRowStyle { get; set; }
    public string PropertyName { get; set; }

    public override Style SelectStyle(object item, DependencyObject container)
    {
      var items = ((GridViewRow)container).GridViewDataControl.Items;

      Type t = item.GetType();
      PropertyInfo[] props = t.GetProperties();
      var currentItemValue = props.First(n => n.Name == PropertyName)?.GetValue(item, null);
      int currentItemIndex = items.IndexOf(item);
      if (currentItemIndex > 0)
      {
        var previousItem = items[currentItemIndex - 1];
        var previousItemValue = props.First(n => n.Name == PropertyName)?.GetValue(previousItem, null);
        if (currentItemValue.Equals(previousItemValue))
        {
          return RowStyle;
        }
        else
        {
          return AltRowStyle;
        }
      }

      return RowStyle;

Modified section of MainWindow.xaml

    <my:AlternationRowStyle x:Key="myRowStyle" PropertyName="Established" >
      <my:AlternationRowStyle.AltRowStyle>
        <Style TargetType="telerik:GridViewRow">
          <Setter Property="Background" Value="Gray"/>
        </Style>
      </my:AlternationRowStyle.AltRowStyle>
    </my:AlternationRowStyle>


As you can see the AltRowStyle is being activated when the value of a row is different from the one above it.  This isn't quite what I want.  I want to change styles when the value changes.  Specifically the seventh line above should be white not gray.   I tried a different approach where I used a boolean in the style selector and toggled it.  This works as desired.

Modified StyleSelector SelectStyle method.

    public override Style SelectStyle(object item, DependencyObject container)
    {
      var items = ((GridViewRow)container).GridViewDataControl.Items;

      Type t = item.GetType();
      PropertyInfo[] props = t.GetProperties();
      var currentItemValue = props.First(n => n.Name == PropertyName)?.GetValue(item, null);
      int currentItemIndex = items.IndexOf(item);
      if (currentItemIndex > 0)
      {
        var previousItem = items[currentItemIndex - 1];
        var previousItemValue = props.First(n => n.Name == PropertyName)?.GetValue(previousItem, null);
        if (!currentItemValue.Equals(previousItemValue))
        {
          altRowToggle = !altRowToggle;
        }
      }

      return altRowToggle ? this.AltRowStyle : this.RowStyle;
    }

If you make the window smaller so that you have to scroll, then scroll up and down a couple times to force it to redraw the items and run the style selector, it can get off track.

I realize the scrolling behavior is caused by my using a boolean in an attempt to keep track of the style to use.  When shrinking the grid, it re-evaluates the style selector based on the visible rows and determines which style to use but the toggle is in a state from the previous evaluation.

Is there a better way to achieve the desired result?

 

Thanks,

Chris

Chris
Top achievements
Rank 1
 asked on 08 Feb 2022
1 answer
172 views

Hello,

In the ListBoxDragDropBehavior documentation, it is said:
The ListBoxDragDropBehavior supports copying the dragged items if the Control key is pressed. For that purpose the CopyDraggedItems method should be overridden

But the behavior supports copying the dragged items without changing anything!

This is a problem because, in my case, I need to avoid the copying of the dragged items in all cases.
How can I do it?

Martin Ivanov
Telerik team
 answered on 08 Feb 2022
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?