Telerik Forums
UI for WPF Forum
1 answer
88 views
Hi,

I would like to switch between Value and the Percent representation on the chart on the basis of the selection of radio button.
I am sending the data in the form of values in the data set and would like to use some type of content format to achieve this functionality. So that i dont have to code extra for calculating the percentage and sending that to the data set of the RadChart instead.

I am attaching the user interface i have achieved and also the changes for the UI i would like to achieve.

Thanks in advance.
Evgenia
Telerik team
 answered on 28 Mar 2012
2 answers
126 views
I am trying out RadControls for WPF Q1 2012.

When setting up line series for a cartesian chart I set the vertical axis in each series. Some of the series can use the same vertical axis so I assign the same linear axis for the vertical axis in each of those series.
 
Is this the correct way to share a vertical axis between series?

I wonder since if I call Clear() on the chart series after setting things up in this way I get a null reference exception as follows:

System.NullReferenceException was caught
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Chart
  StackTrace:
       at Telerik.Windows.Controls.ChartView.Axis.OnDetached(RadChartBase oldChart) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\Axis.cs:line 582
       at Telerik.Windows.Controls.ChartView.ChartElementPresenter.Detach() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartElementPresenter.cs:line 93
       at Telerik.Windows.Controls.ChartView.RadChartBase.OnPresenterRemoved(ChartElementPresenter presenter) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\RadChartBase.cs:line 520
       at Telerik.Windows.Controls.ChartView.CartesianSeries.OnDetached(RadChartBase oldChart) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Series\CartesianSeries.cs:line 161
       at Telerik.Windows.Controls.ChartView.ChartElementPresenter.Detach() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartElementPresenter.cs:line 93
       at Telerik.Windows.Controls.ChartView.RadChartBase.OnPresenterRemoved(ChartElementPresenter presenter) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\RadChartBase.cs:line 520
       at Telerik.Windows.Controls.ChartView.PresenterCollection`1.ClearItems() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\PresenterCollection.cs:line 61
       at XXX.LineChart.SetUpLineChart() in C:\Workspaces\XXX\LineChart.xaml.cs:line 317

The exception doesn't happen if each series has a unique axis.

If this is the correct way of sharing a vertical axis between series then how do I clear the series without getting an exception?
Terry
Top achievements
Rank 1
 answered on 28 Mar 2012
2 answers
200 views
I have developed a custom control for multiple selection in Rad Combobox. Now i want to show the selected items as comma separated string. Can i manipulate the display member of rad combo box at runtime?
<Window.Resources>
        <DataTemplate x:Key="ItemContDataTemplateKey">
            <Grid x:Name="radCmb" Width="210" HorizontalAlignment="Left">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="20"></ColumnDefinition>
                    <ColumnDefinition  Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <CheckBox x:Name="chkSelct" HorizontalAlignment="Left" DataContext="{Binding}" Grid.Column="0" Unchecked="chkSelct_Unchecked" Checked="chkSelct_Checked"></CheckBox>
                <TextBlock x:Name="txtDropDown" Text="{Binding FullName}" Grid.Column="1"></TextBlock>
            </Grid>
        </DataTemplate>
</Window.Resources>
  
<Telerik:RadComboBox Name="radCmbCompany" HorizontalAlignment="Center" Height="25" Width="250" 
                             SelectedValuePath="Id"
                             IsEditable="True"
                             IsReadOnly="True"
                             ItemTemplate="{StaticResource ItemContDataTemplateKey}" 
                             >
  
        </Telerik:RadComboBox>
  
  
//CODE BEHIND
  
public string DisplayMember { get; set; }
  
public static readonly DependencyProperty SelectedItemsProperty =
        DependencyProperty.Register("SelectedItems", typeof(ObservableCollection<object>), typeof(Window1),
        new FrameworkPropertyMetadata(new ObservableCollection<object>()));
        public ObservableCollection<object> SelectedItems
        {
            get { return (ObservableCollection<object>)base.GetValue(SelectedItemsProperty); }
            set { base.SetValue(SelectedItemsProperty, value); }
        }
  
        public static readonly DependencyProperty SelectedTextProperty =
        DependencyProperty.Register("SelectedText", typeof(string), typeof(Window1),
        new FrameworkPropertyMetadata());
        public string SelectedText
        {
            get { return (string)base.GetValue(SelectedTextProperty); }
            set { base.SetValue(SelectedTextProperty, value); }
        }
private void chkSelct_Checked(object sender, RoutedEventArgs e)
        {
            SetSelectedText(sender);
        }
  
        private void chkSelct_Unchecked(object sender, RoutedEventArgs e)
        {
            SetSelectedText(sender);
        }
  
private void SetSelectedText(object sender)
        {
            CheckBox chkbx = sender as CheckBox;
  
            if (chkbx != null && chkbx.IsChecked.Equals(true))
            {
                this.SelectedItems.Add(chkbx.DataContext);
                string CurrentselectedText = Convert.ToString(chkbx.DataContext.GetType().GetProperty(this.DisplayMember).GetValue(chkbx.DataContext, null));
                if (this.SelectedText != null && this.SelectedText.Length > 0)
                {
                    this.SelectedText += "," + CurrentselectedText;
                }
                else
                {
                    this.SelectedText = CurrentselectedText;
                }
            }
            else if (chkbx != null && chkbx.IsChecked.Equals(false))
            {
                string CurrentselectedText = Convert.ToString(chkbx.DataContext.GetType().GetProperty(this.DisplayPath).GetValue(chkbx.DataContext, null));
                if (this.SelectedText != null && this.SelectedText.Length > 0 && this.SelectedText.IndexOf(',') > 0)
                {
                    if (this.SelectedText.IndexOf(CurrentselectedText) + CurrentselectedText.Length < this.SelectedText.Length && this.SelectedText.Substring(this.SelectedText.IndexOf(CurrentselectedText) + CurrentselectedText.Length, 1) == ",")
                    {
                        this.SelectedText = this.SelectedText.Remove(this.SelectedText.IndexOf(CurrentselectedText), CurrentselectedText.Length + 1);
                    }
                    else
                    {
                        this.SelectedText = this.SelectedText.Remove(this.SelectedText.IndexOf(CurrentselectedText) + 1, CurrentselectedText.Length);
                    }
                }
                else if (this.SelectedText != null && this.SelectedText.Length > 0)
                {
                    this.SelectedText = string.Empty;
                }
            }
        }
gans
Top achievements
Rank 1
 answered on 28 Mar 2012
3 answers
482 views
Hi Telerik:
How can I hide the entire group header column (the bottom level only) as pointed in the screenshot below? I have attached xaml for your reference.

Thanks,
Cheau





        <!-- ScheduleView -->

        <telerik:RadScheduleView x:Name="scheduleView"

                                Grid.Row="2"                                

                                MaxTimeRulerExtent="500"

                                AppointmentsSource="{Binding Tasks, Mode=TwoWay}"

                                ResourceTypesSource="{Binding ScheduleOptionList, Mode=TwoWay}"

                                GroupDescriptionsSource="{Binding GroupCollection, Mode=TwoWay}"

                                CurrentDate="{Binding DefaultDate}"                                              

                                NavigationHeaderVisibility="Collapsed"                               

                                AllowDrop="True"

                                SnapAppointments="True"  

                                MinAppointmentWidth="22"

                                Height="Auto">

 

            <telerik:RadScheduleView.DragDropBehavior>

                <local:ScheduleDragDropBehavior/>

            </telerik:RadScheduleView.DragDropBehavior>

 

            <telerik:RadScheduleView.AppointmentItemContentTemplate>

                <DataTemplate>

                    <StackPanel>

                        <TextBlock Text="{Binding Subject}"  FontWeight="Bold"/>

                        <StackPanel Orientation="Horizontal">

                            <TextBlock Text="{Binding Start, StringFormat={}{0:H:mm}}"/>

                            <TextBlock Text=" - "/>

                            <TextBlock Text="{Binding End, StringFormat={}{0:H:mm}}"/>

                        </StackPanel>

                    </StackPanel>

                </DataTemplate>

            </telerik:RadScheduleView.AppointmentItemContentTemplate>

 

            <telerik:RadScheduleView.ActiveViewDefinition>

                <telerik:DayViewDefinition Orientation="Horizontal" FirstDayOfWeek="Monday" TimerulerMajorTickStringFormat="{}{0:HH}"

                                            MinorTickLength="1h"  MajorTickLength="1h" MinTimeRulerExtent="700" GroupHeaderDateStringFormat="{}{0:MM/dd}" />

               

            </telerik:RadScheduleView.ActiveViewDefinition>                      

 

        </telerik:RadScheduleView>

 

Yana
Telerik team
 answered on 28 Mar 2012
1 answer
92 views
Hi All
How can I get font size from SelectionMiniToolBar in pixels instead of points.
Thanks
Deepak
Boby
Telerik team
 answered on 28 Mar 2012
3 answers
352 views
Part 1: Date format in GridViewDataColumn:
I have a need to display a DateTime in a column with the following format: "MMM dd yyyy h:mm:ss tt". How would I go about doing that? Using the DataFormatString dependency property seemed like the logical choice, but did nothing.


Part 2: How do I filter by date?
On the Telerik webpage under the heading "Filtering and Excel-like Filtering", there is a date time filter. How do I enable that for a GridViewDataColumn that has a DateTime as a backing property type? I've tried all sorts of things, and this is what I'm currently using, but it does nothing - I only am able to use the standard string filter.

<t:GridViewDataColumn DataMemberBinding="{Binding LastSave, Mode=OneWay}" DataType="{x:Type System:DateTime}" Header="Last Save" IsReadOnly="True" IsGroupable="False" />


Part 3: How do I show empty cells for DateTime.Min values?
I also have the need to show an empty cell if the backing value is DateTime.Min. How would I accomplish that?
Iva
Telerik team
 answered on 28 Mar 2012
8 answers
328 views
I have added data item to rad carousel and I just wanted get the zeroth position to be focused by below format

Curent                 --    5    4    3    2    1                     

I want like this         --  3    2    1

Thanks in advance.

Arafath
Vanya Pavlova
Telerik team
 answered on 28 Mar 2012
2 answers
3.0K+ views
Hello,

I am trying to clear the selection in a combobox by setting the bound object on the binding to null. This however does not make the combobox go blank as required.

I know there is a button you can have displayed on the combobox so the user can clear the selection but I need the functionality through the binding.

Is there a way to do this please?

Thanks
Alex
Top achievements
Rank 1
 answered on 28 Mar 2012
3 answers
279 views
When setting the RadExpander.IsTabStop to false the control still responds to tab

<t:RadExpander MaxWidth="350" MinWidth="350" IsTabStop="False" Margin="10" IsExpanded="True" Name="xDrawing"
                    <t:RadExpander.Header> 
                        <StackPanel Orientation="Horizontal"
                            <TextBlock Text="DRAWING:" Width="55" Margin="0,5,20,2"/> 
                            <t:RadButton x:Name="btnAddDwg" IsTabStop="False"  Content="+" Width="25" Height="20" Margin="10,0,0,5" ToolTip="Click to add a new Drawing to the current Job./nAlt D"  Click="btnAddDwg_Click" /> 
                            <t:RadButton x:Name="btnDeleteDwg" Content="-" IsTabStop="False" Width="25" Height="20" Margin="10,0,0,5" ToolTip="Remove Assembly" Click="btnDeleteDwg_Click"/> 
                        </StackPanel> 
                    </t:RadExpander.Header> 
                <StackPanel> 
                    <StackPanel Margin="3,3,3,3" Orientation="Horizontal"
                        <TextBlock Text="Drawing#" Margin="0,2,2,2"/> 
                        <xcd:AutoSelectTextBox x:Name="txtdwgNo" Text="{Binding CurrentDrawing.dwgNo}" AutoSelectBehavior="OnFocus" Width="100" Margin="3,3,3,3" TextChanged="UCase_TextChanged"/> 
                        <TextBlock Text="Date" Margin="20,2,2,2"/> 
                        <xcd:AutoSelectTextBox x:Name="txtDate" Text="{Binding CurrentDrawing.dwgDate}" AutoSelectBehavior="OnFocus" Width="125" Margin="3,3,3,3"  TextChanged="UCase_TextChanged"/> 
                    </StackPanel> 
                    <StackPanel Margin="3,3,3,3" Orientation="Horizontal"
                        <TextBlock Text="Drawn By" Margin="0,2,2,2"/> 
                        <xcd:AutoSelectTextBox x:Name="txtDrawnBy" AutoSelectBehavior="OnFocus" Text="{Binding CurrentDrawing.dwgBy}" Width="200" Margin="3,3,3,3"/> 
                        <TextBlock Text="HOLD" Margin="20,2,2,2"/> 
                        <xcd:CheckBox Name="chkDWGHold" Margin="3,3,3,3" IsChecked="{Binding CurrentDrawing.hold}"/> 
                    </StackPanel> 
                </StackPanel> 
            </t:RadExpander> 

TabStop should still work for internal controls unless IsExpanded = false;
Petar Mladenov
Telerik team
 answered on 28 Mar 2012
0 answers
117 views
Hi,

How to fire an event, when select an item from the RadGridviewComboBox column by using MVVM architecture.

Please guide me, i am new to this telerik controls.


Thanks in Advance..
Surekha
Top achievements
Rank 1
 asked on 28 Mar 2012
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?