Telerik Forums
UI for WPF Forum
1 answer
157 views

We would like to disable the Undo feature of the underlying TextBox in the RadNumericUpDown control.

It interferes with our global Ctrl+Z undo command when the RadNumericUpDown is keyboard focused.

Thanks.

 

Nasko
Telerik team
 answered on 05 Oct 2016
1 answer
117 views

I have problem with using DragAndDropManager for Telerik version 2012.1.326.40. Recently I find out that one of my old projects has problem with drag end drop with some list boxes. It was using RadDragAndDropManager to handle drag and drop. So I switched to DragAndDropManager. However in 2012.1.326 version of controls there is no DragDropPayloadManager. All examples are using this class to pass data so my question is can I implement DragAndDropManager in this version of controls and how to replace DragDropPayloadManager.

Nasko
Telerik team
 answered on 05 Oct 2016
2 answers
252 views

Hello. I try to set ChartAnnotationLabelDefinition.Template in the way where the label of annotation has red color. But I havn't got the required result yet. I wrote the following XAML markup:

<telerik:RadCartesianChart Visibility="{Binding IsAbsoluteBarChartVisible}">
            <!--The definition of an annotation line-->
            <telerik:RadCartesianChart.Annotations>
                <telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Value="{Binding AnnotationValue}" Label="{Binding AnnotationLabel}" Stroke="Red" StrokeThickness="2" DashArray="8 2">
                    <telerik:CartesianGridLineAnnotation.LabelDefinition>
                        <telerik:ChartAnnotationLabelDefinition Location="Inside"  VerticalAlignment="Bottom"  HorizontalAlignment="Center">
                            <!--HERE IS THE TEMPLATE DEFINITION-->
                            <telerik:ChartAnnotationLabelDefinition.Template>
                                <DataTemplate>
                                    <TextBlock Foreground="Red" FontWeight="DemiBold"/>
                                </DataTemplate>
                            </telerik:ChartAnnotationLabelDefinition.Template>
                        </telerik:ChartAnnotationLabelDefinition>
                    </telerik:CartesianGridLineAnnotation.LabelDefinition>
                </telerik:CartesianGridLineAnnotation>
            </telerik:RadCartesianChart.Annotations>
            <!-- X axis-->
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <!-- Y axis-->
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis x:Name="verticalAxis" Title="Децибелы [Дб]" Minimum="{Binding ChartMinimum}" Maximum="{Binding ChartMaximum}" MajorStep="{Binding CurrentStep}"/>
            </telerik:RadCartesianChart.VerticalAxis>
            <!--The chart itself-->
            <telerik:RadCartesianChart.Series>
                <telerik:BarSeries ShowLabels="True" CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding Data}"/>
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>

But when I run my application and navigate to the View where charts are displayed then I see only annotation without label (please see 'AnnotationWithoutLabels.PNG' file attached). When I comment the following part of XAML markup

<telerik:ChartAnnotationLabelDefinition.Template>
    <DataTemplate>
        <TextBlock Foreground="Red" FontWeight="DemiBold"/>
    </DataTemplate>
</telerik:ChartAnnotationLabelDefinition.Template>

then I see annotation with black colored label (please see 'AnnotationWithBlackColoredLabel.PNG' file attached). How do I get a bright red color for the annotation label?

Dmitry
Top achievements
Rank 1
 answered on 05 Oct 2016
1 answer
188 views

If you find yourself binding your RadGridView to objects that are dynamically generated by Castle's DictionaryAdapter.

You might be surprised by the expressions that are generated by the ExpressionEditor involve a mysterious CastleDictionaryAdapterType like 

Expression {Expression<System.Func<CastleDictionaryAdapterType, bool>>}

when you were expecting it to be:

Expression {Expression<System.Func<IDataRecord, bool>>}

where IDataRecord is the interface your run-time instances are generated from by DictionaryAdapter

Despite the fact that CastleDictionaryAdapterType implements your IDataRecord (and a bunch of other things) you won't be able to directly cast between them as your FilterDescriptor requires

The solution is to re-write the expression that ExpressionEditor.Expression property gives you. Here's a simple expression visitor that does that:

public class CastleDictionaryAdapterTypeVisitor<TInput> : ExpressionVisitor
  {
    private ReadOnlyCollection<ParameterExpression> _parameters;
    private ParameterExpression _parameter;
 
    public Expression Modify(Expression expression_)
    {
      return Visit(expression_);
    }
 
    #region Overrides of ExpressionVisitor
    protected override Expression VisitParameter(ParameterExpression node_)
    {
      return _parameter ?? (_parameter = Expression.Parameter(typeof(TInput), node_.Name));
    }
 
    protected override Expression VisitLambda<T>(Expression<T> node_)
    {
      _parameters = VisitAndConvert(node_.Parameters, node_.Name);
      return Expression.Lambda(Visit(node_.Body), _parameters);
    }
 
    protected override Expression VisitMember(MemberExpression node_)
    {
      return node_.Member.DeclaringType?.ToString() == "CastleDictionaryAdapterType"
               ? Expression.Property(Visit(node_.Expression), node_.Member.Name) : base.VisitMember(node_);
    }
    #endregion
  }

 

You can use it like this (I've modified the ExpressionEditor filtering RadGridView Telerik sample) 

private void ExpressionEditor_OnExpressionChanged(object sender_, RadRoutedEventArgs e_)
{
 
  if(this.ExpressionEditor.Expression != null &&
    this.ExpressionEditor.Expression.GetType().ToString().Contains("CastleDictionaryAdapterType"))
  {
    var visitor = new CastleDictionaryAdapterTypeVisitor<ITestDataRecord>();
    var convertedExpression = visitor.Modify(ExpressionEditor.Expression) as Expression<Func<ITestDataRecord, bool>>;
 
    if (convertedExpression != null)
    this._genericFilterDescriptor.FilteringExpression = convertedExpression;
 
    if(!this.RadGridView.FilterDescriptors.Contains(this._genericFilterDescriptor))
      this.RadGridView.FilterDescriptors.Add(this._genericFilterDescriptor);
 
    this.errorMessageBlock.Visibility = Visibility.Collapsed;
  }
  else if(this.ExpressionEditor.Expression == null)
  {
    if(this.RadGridView.FilterDescriptors.Contains(this._genericFilterDescriptor))
      this.RadGridView.FilterDescriptors.Remove(this._genericFilterDescriptor);
 
    this.errorMessageBlock.Visibility = Visibility.Collapsed;
  }
  else
  {
    this.errorMessageBlock.Visibility = Visibility.Visible;
  }
}

What is needed here is to provide a way to signal to the ExpressionEditor the specific type/interface to use, as opposed to letting the control figure it out from its Item property.

 

 

 

 

 

Martin
Telerik team
 answered on 04 Oct 2016
7 answers
1.2K+ views

I have a read-only List<string> property in my business object.

How do I make it show up in the property grid. Do I need to create a custom editor?

Thanks!
Yoan
Telerik team
 answered on 04 Oct 2016
3 answers
163 views

Hi! I have a project with a RadGrid table showing information. I have this snippet of code inside it:

<telerik:GridCalculatedColumn DataFields="Stake,TotalGames" Expression="iif({1} = 0, 0, {0}/{1})"
FilterControlWidth="40px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
UniqueName="AvgBet" DataFormatString="{0:N2}" HeaderText="Avg Bet (Real)" DataType="System.Decimal"
Aggregate="Avg" FooterStyle-HorizontalAlign="Right" />

 

Now, this works with English and Chinese locale settings. However, when we set the locale to ES, the formatting changes (from 0.00 to 0,00), and we believe that the problem is coming from the Expression in the code. We think that it might be that the values were interpreted as string? It works with English and Chinese locale (maybe because of the standard number decimal formatting).

 

We have tried these approaches but to no avail:

1. On binding data (OnNeedDataSource), we modify the locale like this:

 if (dtable.Locale.ToString().Substring(0,2) == "es")
      {
        System.Globalization.CultureInfo myCultureInfo = new System.Globalization.CultureInfo("en-gb");
        dtable.Locale = myCultureInfo;
      }

However, this still shows the same problem. 

 

2. We tried this as well (IsLocalizationLanguageRespected set to true or false): 

<telerik:RadGrid ID="grdSessions" runat="server" GridLines="None" AllowFilteringByColumn="True"
          PageSize="50" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
          GroupHeaderItemStyle-Font-Bold="true" GroupHeaderItemStyle-ForeColor="Black"
          EnableHeaderContextMenu="True" OnNeedDataSource="grdSessions_NeedDataSource"
          Width="98%" ShowFooter="true" IsLocalizationLanguageRespected="false">

We are not sure how to approach this one next. Can you give me suggestions on how to proceed? 

 

Thank you!
Psalm

Konstantin Dikov
Telerik team
 answered on 04 Oct 2016
1 answer
140 views

Hi ,

 what is LookUpPropertyDefinition ?? when Can we use it?Can you provide some document which explains and example.

Regards,

Nagasree.

Stefan
Telerik team
 answered on 04 Oct 2016
1 answer
299 views

Hello

Do you provide source code for Outlook-Inspired Application?

 

Thank you

Yana
Telerik team
 answered on 04 Oct 2016
6 answers
455 views

I'm trying to load a collection (which is an attribute of an object) into a RadComboBox (instead of just having the id / ToString inside a textbox).

I got this working so far with a datatemplate which I apply inside the AutoGeneratingPropertyDefinition Handler.

 

DataTemplate dt = (DataTemplate)this.FindResource("TemplateComboBoxTemplate");                 
e.PropertyDefinition.EditorTemplate = dt;

The template looks like the following:
<DataTemplate x:Key="TemplateComboBoxTemplate">     
    <
telerik:RadComboBox ItemsSource="{Binding Source={StaticResource TemplateComboBoxSource}, Path=Templates}"
                        Margin="0">
        <telerik:RadComboBox.ItemTemplate>
            <DataTemplate>           
                <TextBlock Text="{Binding Title}" />         
            </DataTemplate>       
        </telerik:RadComboBox.ItemTemplate>     
    </telerik:RadComboBox>   
</DataTemplate>

As I said, the above works great, except that I have no idea how to set up a two way binding
so that the RadComboBox actually reflects the property.
Stefan
Telerik team
 answered on 04 Oct 2016
7 answers
333 views
I am using RadCartesianChart to display stacked grouped bar chart shown in the attachment. I searched forums to get an idea and also looked at the demo source code, but I am not able to get it to work. I am using MVVM. Please show me a sample project using MVVM that will be able to do this.

Thanks,
John
Artem
Top achievements
Rank 1
 answered on 03 Oct 2016
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?