Telerik Forums
UI for WPF Forum
2 answers
235 views
While I know it is possible to add custom buttons ta a RadPane header, is it possible to add functionality such as 'minimize' to it? Specifically when it is NOT floating?

For example, I have a RadPanelBar with 4 panels stacked vertically. I want a button in each RadPane header that will effectively 'minimize' the RadPane to just the header. Obviously I'd like the opposite effect too. It doesn't appear that there are any sizing methods to do this  as just changing the heights has odd results... especially when multiple RadPanes are 'minimized'.
Joe Biggert
Top achievements
Rank 1
 answered on 15 Feb 2012
1 answer
452 views
Hi - I have this split button with 3 menu items. When I click on one of the menu items, I'm expecting the dropdown to close. I tried creating a template which sets StaysOpenOnClick="False", also tried setting it to false directly on each menu item but the dropdown continues to stay open. I've also tried handling the Click event to close the button. Nothing seems to work. Any ideas?

Here is the style I tried: 
<Style TargetType="telerik:RadMenuItem">
    <Setter Property="Header" Value="{Binding RelativeSource={RelativeSource Self}, Path=Command.DisplayName, Mode=OneWay}" />
    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Command.Description, Mode=OneWay}" />
    <Setter Property="StaysOpenOnClick" Value="False" />
 </Style>

Here is the click handler I tried:

        private void RadMenuItem_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadMenuItem item = e.Source as RadMenuItem;

            RadDropDownButton btn = item.ParentOfType<RadDropDownButton>();

            if (btn != null)
            {
                btn.IsOpen = false;
            }
        }

Here is the SplitButton:
<telerik:RadSplitButton Command="{Binding Path=ThisButtonComman}"
                                    ToolTip="Default action."
                                    Content="Click this button"
                                    Height="25"
                                    Margin="10,5,0,5"
                                    AutomationProperties.AutomationId="SweetSplitButton"
                                    AutomationProperties.Name="Sweet split button.">
        <telerik:RadSplitButton.DropDownContent>
          <telerik:RadMenu telerik:StyleManager.Theme="Summer" Background="Transparent" Orientation="Vertical">
            <telerik:RadMenuItem Command="{Binding Path=Command1}"
                                       AutomationProperties.AutomationId="Id1"
                                       AutomationProperties.Name="Name1." />
            <telerik:RadMenuItem Command="{Binding Path=Command1}"
                                       AutomationProperties.AutomationId="Id2"
                                       AutomationProperties.Name="Name2." />
            <telerik:RadMenuItem Command="{Binding Path=Command3}"
                                       AutomationProperties.AutomationId="Id3"
                                       AutomationProperties.Name="Name3." />            
          </telerik:RadMenu>
        </telerik:RadSplitButton.DropDownContent>
      </telerik:RadSplitButton>

Thanks,
Chris
Zarko
Telerik team
 answered on 15 Feb 2012
2 answers
161 views
I have a GridView that's grouped. When the groups are collapsed, I want to have the number of items selected in each group show up in the "collapsed header" for that group. I've poked around, but it doesn't look like it's possible.

Any thoughts?
Michael Eaton
Top achievements
Rank 1
 answered on 15 Feb 2012
1 answer
76 views
When my page is loaded, I create a handful of custom appointments and bind them to my radScheduleView.  If I try to drag them around or resize them, it works as anticipated (there is a blank 'ghost' order that gets moved around as I am dragging or resizing the load that tells me the start and end times of the order if I were to drop it).  However, it only works once per order.

Immediately after performing one drag or resize, whenever I try to do another, there is no 'ghost' order.  The drag operation or resize operation is still performed (and the ghost image shows up if you try to drag it to a different resource), but if I try to move it around in its current resource, no 'ghost' order shows up.  Obviously this isn't that big of a deal, but I'm certain the users of this page will find it a touch obnoxious.

My guess is I need to do something (or am doing something wrong) in the copy or copyfrom functions that I override from the AppointmentBase class (I have also tried inheriting from just the appointment class and not overriding those functions, but that didn't work either).  During the drop function after a drag or a resize, those functions are called and a new Appointment is created.  If there is something different about the newly created Appointment, that would explain the change in the dragdrop functionality.  If anyone could offer any guidance, it would be truly appreciated.  Thanks!
Konstantina
Telerik team
 answered on 15 Feb 2012
1 answer
496 views
Hi, i'm trying to edit the Live data example you provide so that it is capable of displaying multiple series (the number is variable from 1 to a rasonable N, say 15).
Each series has the same format and is mapped this way:
MyCustomObject.DateTime -> XAxis
MyCustomObect.Value -> YAxis
I define the SeriesMapping in codeBehind as i said the number of series is variable.

I edited the ExampleViewModel.cs so that i have a List of Queue (1 Queue for each series i want to display). 
The problem is that the chart doen't get populated at all.

Here is my sample code:

MyChart.xaml
<UserControl.DataContext>
        <db:TimeChartViewModel />
    </UserControl.DataContext>
  
    <UserControl.Resources>
        <Style x:Key="YAxisTitleStyle" TargetType="telerik:AxisTitle">
            <Setter Property="Padding" Value="0, 0, 0, 0" />
            <Setter Property="Margin" Value="0, 0, 0, 0" />
        </Style>
  
        <Style x:Key="AdditionalYAxisTitleStyle" TargetType="telerik:AxisTitle">
            <Setter Property="Padding" Value="0, 0, 0, 0" />
            <Setter Property="Margin" Value="0, 3, 0, 0" />
        </Style>
    </UserControl.Resources>
  
    <Grid>
        <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True">
            <telerik:RadChart x:Name="RadTimeChart" ItemsSource="{Binding Data}">
                <telerik:RadChart.DefaultView>
                    <telerik:ChartDefaultView ChartLegendPosition="Bottom">
                        <telerik:ChartDefaultView.ChartArea>
                            <telerik:ChartArea LegendName="ChartLegend1"
                                               NoDataString="Loading..."
                                               EnableAnimations="False"
                                               Padding="5, 10, 0, 5">
                                <telerik:ChartArea.AxisX>
                                    <telerik:AxisX DefaultLabelFormat="#VAL{H:mm:ss}" LabelRotationAngle="45" LabelStep="2"
                                                   LayoutMode="Normal" Title="Time" AutoRange="False"
                                                   MinValue="{Binding AxisXMinValue}"
                                                   MaxValue="{Binding AxisXMaxValue}"
                                                   Step="{Binding AxisXStep}" />
                                </telerik:ChartArea.AxisX>
                                <telerik:ChartArea.AxisY>
                                    <telerik:AxisY DefaultLabelFormat="#VAL" Title="Power [W]"
                                                   AutoRange="False" MinValue="0" MaxValue="3000" Step="500">
                                        <telerik:AxisY.AxisStyles>
                                            <telerik:AxisStyles TitleStyle="{StaticResource YAxisTitleStyle}"/>
                                        </telerik:AxisY.AxisStyles>
                                    </telerik:AxisY>
                                </telerik:ChartArea.AxisY>
                            </telerik:ChartArea>
                        </telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartDefaultView.ChartLegend>
                            <telerik:ChartLegend x:Name="ChartLegend1" Padding="0, 10, 0, 5"/>
                        </telerik:ChartDefaultView.ChartLegend>
                    </telerik:ChartDefaultView>
                </telerik:RadChart.DefaultView>
            </telerik:RadChart>
        </Border>
    </Grid>




ExampleModelView.cs
       #region Fields
  
        private const int queueCapacity = 30;
        private List<Queue<MeasurementData>> tcMeasurementData = new List<Queue<MeasurementData>>(queueCapacity);
        private DateTime nowTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
        private DispatcherTimer timer1;
        private List<Queue<MeasurementData>> _data;
        private double _axisXMinValue;
        private double _axisXMaxValue;
        private double _axisXStep;
        private LEAF.Devices.Common.TimeChartHistory device;
  
        #endregion
  
        #region Properties
  
        public LEAF.Devices.Common.TimeChartHistory Device
        {
            get { return this.device; }
            set { this.device = value; }
        }
  
        public List<Queue<MeasurementData>> Data
        {
            get { return this._data; }
            set
            {
                if (this._data != value)
                {
                    this._data = value;
                    this.OnPropertyChanged("Data");
                }
            }
        }
  
        public double AxisXMinValue
        {
            get { return this._axisXMinValue; }
            set
            {
                if (this._axisXMinValue != value)
                {
                    this._axisXMinValue = value;
                    this.OnPropertyChanged("AxisXMinValue");
                }
            }
        }
  
        public double AxisXMaxValue
        {
            get { return this._axisXMaxValue; }
            set
            {
                if (this._axisXMaxValue != value)
                {
                    this._axisXMaxValue = value;
                    this.OnPropertyChanged("AxisXMaxValue");
                }
            }
        }
  
        public double AxisXStep
        {
            get { return this._axisXStep; }
            set
            {
                if (this._axisXStep != value)
                {
                    this._axisXStep = value;
                    this.OnPropertyChanged("AxisXStep");
                }
            }
        }
  
        #endregion
  
  
        #region Constructor
  
        public TimeChartViewModel()
        {
            this.SetUpTimer();
        }
  
        #endregion
  
  
        #region Methods
  
        public void StartTimer()
        {
            if (timer1 != null)
                timer1.Start();
        }
  
        public void StopTimer()
        {
            if (timer1 != null)
                timer1.Stop();
        }
  
        private void SetUpTimer()
        {
            timer1 = new DispatcherTimer();
            timer1.Interval = TimeSpan.FromMilliseconds(500);
            timer1.Tick += OnTimerTick;
        }
  
        private void OnTimerTick(object sender, EventArgs e)
        {
            this.nowTime = this.nowTime.AddMilliseconds(500);
  
            this.UpdateData(this.nowTime);
            this.SetUpAxisXRange(this.nowTime);
  
            this.Data = null;
            this.Data = this.tcMeasurementData;
        }
  
        private void SetUpAxisXRange(DateTime now)
        {
            this.AxisXMinValue = now.AddSeconds(-14.5).ToOADate();
            this.AxisXMaxValue = now.ToOADate();
            this.AxisXStep = 1.0 / 24.0 / 3600.0 / 2.0;
        }
  
        private void UpdateData(DateTime now)
        {
            int i = 0;
  
        //This lines update data for each series... I'm pretty sure it is correct
            foreach (ChannelKeyValueConfiguration channelKeyValue in this.Device.Configuration.ChannelConfigurations)
            {
                IChannel channel = this.Device.Channels[channelKeyValue.Name];
  
                Queue<MeasurementData> seriesData = this.tcMeasurementData[i];
                if (seriesData.Count >= queueCapacity) seriesData.Dequeue();
                MeasurementData lastMeasure = new MeasurementData(channel.Measure.Value, now);
                seriesData.Enqueue(lastMeasure);
                i++;
            }
  
        }
  
        public void AddMeasureDataSeries(Queue<MeasurementData> series)
        {
            this.tcMeasurementData.Add(series);
        }
  
        #endregion


Please tell me how do i bind chart's itemsource to a List of Queue instead of a simple collection.
Thanks
Nikolay
Telerik team
 answered on 15 Feb 2012
3 answers
136 views
Please find the attached file.

In the attachment, there are 2 cases:
1 Left
While opening any item from the left tab it opens the Item in Tab region i.e Center region. And set the Tab as active.
In which the Background of the Tab Title changes to Blue. and when we select the bottom region tab, the title of the bottom region get blue.
2 Right
But in the Right Image
When we select the left Item, it set the background of all the tabs to Black.
But according to the normal behavior it should retain the state. Ie.. the last selected tab background should be blue in color.

Please provide solution

Regards,
Irfan Shaikh
Konstantina
Telerik team
 answered on 15 Feb 2012
1 answer
109 views
Hi,
     The first time the datepicker is displayed it takes the default style. Second time and there after the control is rendered according to the style. the style is defined in App.xaml.

Please let me know how to tackle this problem

Boyan
Telerik team
 answered on 15 Feb 2012
3 answers
319 views
I am adding tabs to my tab control in the code behind.

Can you please provide an example of how to set the tab's image from the code behind?

Thank you
Petar Mladenov
Telerik team
 answered on 15 Feb 2012
5 answers
281 views
Hello,

I'm evaluating different WPF grids for a current software project in our company. By reading your documentations, forum threads and trying your demos, I couldn't find out if your GridView control could meet our special requirements:

- multiple grouping (could be fixed groups, not necassary for user to change grouping at runtime)
- different formulas/expressions per cell not just per column
- formulas/expressions related to other cells in other columns and rows, i.e. formula in cell A1: "B1 + C3"
- possibility for user to change the formulas (maybe with your expression editor?)

Could you tell me if this is somehow possible and give me an example?
Maya
Telerik team
 answered on 15 Feb 2012
3 answers
383 views
I have a RadGridView with a RadDataForm inside the RowDetails. When I expand a row and then scroll my mouse wheel through the grid results, the scrolling halts when my mouse array is over the RadDataForm....as if the DataForm is grabbing the scroll focus (but there are no scrollbars on the DataForm).

How can I prevent this? Thanks.

Here is my main xaml code:

<telerik:RadGridView Grid.Row="1" IsReadOnly="True" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" IsFilteringAllowed="False" ItemsSource="{Binding Results}" AutoGenerateColumns="False">
            <telerik:RadGridView.Style>
            </telerik:RadGridView.Style>
            <telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn />
                <telerik:GridViewSelectColumn IsVisible="{Binding DataContext.IsMultiSelect, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PatientSearchView}}}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Width="*" />
................
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                    <telerik:RadTabControl Height="400" HorizontalAlignment="Stretch" Margin="8,8,20,8" VerticalAlignment="Center">                
                        <telerik:RadTabItem Header="Details" HorizontalContentAlignment="Stretch" HorizontalAlignment="Left">
                            <local:DetailsView DataContext="{Binding Details}" />
                        </telerik:RadTabItem>
...............
                    </telerik:RadTabControl>
 
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>
        </telerik:RadGridView>

And then this is my DetailsView

<s:View ....>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border BorderBrush="Black" BorderThickness=".5" Grid.Row="0" Height="90" Width="90" Margin="10,0,0,0" HorizontalAlignment="Left" >
            <Image Source="{Binding Details.Photo}" />
        </Border>
        <telerik:RadDataForm AutoGenerateFields="True" CurrentItem="{Binding Details}" CommandButtonsVisibility="Commit,Cancel,Edit" Grid.Row="1" ScrollViewer.CanContentScroll="False">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="EditEnded">
                    <i:InvokeCommandAction Command="{Binding Save}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </telerik:RadDataForm>
    </Grid>
</s:View>
Dimitrina
Telerik team
 answered on 15 Feb 2012
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?