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

in the RadControls WPF Demo Q3 2011 SP1, the cursor cycles through all enabled fields on a RadDataForm by
pressing the Tab key. That's the expected behavior, but in Version 2012.1.402.40 the cursor cycles through all
enabled fields and their corresponding labels.

Is this correct and the expected behavior or is it possible to configure the TabStop behavior
for the label property?

I looked around for a solution and found the thread label-customization-in-dataformxfield
which guided me to the property LabelStyle.

I copied the posted code an set the property IsTabStop to false, but the XAML didn't compile because of
'TextBlock' TargetType does not match type of element 'ContentControl'.
I set the TargetType to ContentControl and it works as expected.

<telerik:RadDataForm.LabelStyle>
     <Style TargetType="ContentControl">
         <Setter Property="IsTabStop" Value="False" />
     </Style>
</telerik:RadDataForm.LabelStyle>

kind regards,
Hubert
Dimitrina
Telerik team
 answered on 17 Apr 2012
1 answer
181 views
Hello Telerik,

I am unable to Edit the Template of the RadWindow using Expression Blend. I wanted to style the RadWindow Border to White, Customize the Minimize, Maximize and Close Buttons as well as give Shadow Effect to the Border. Can you please give the RadWindow Style & Template?

Thanks,
Neha
Dani
Telerik team
 answered on 17 Apr 2012
2 answers
624 views
Some weeks ago I implemented a CustomGridViewToggleRowDetailsColumn class.  Basically, my data model has objects called Reads which can have zero or more Alarms associated with them.  I've written code which populates an array in the Read view model object with all of the Alarms that are associated with that particular Read.  The class hides the toggle button for the row details if the item in the row doesn't have any rows in that array.  There's another boolean property on the Read view model object called HasAlarms which is true if the Alarms array isn't empty.

In order to improve performance, I need to rework the data access code so it no longer retrieves all of the Alarms assocated with a Read at the time it retrieves the Reads that match the search criteria.  Instead, I am setting the HasAlarms property to true if there are any Alarms for that Read and leaving the array null. I want the row details toggle button to be hidden if HasAlarms is false (easily done with existing code).  Then, when the user clicks on the toggle button, I want to check to see if the Alarms for that Read were retrieved yet, and if not, go get them.

The problem is that I'm getting an error when the Xaml for the RadGridView is being parsed because it doesn't like something about my code.  The error I'm getting is:

System.Windows.Markup.XamlParseException occurred
  Message='Failed to create a 'Click' from the text 'ExpandAlarms_Click'.' Line number '416' and line position '9'.
  Source=PresentationFramework
  LineNumber=416
  LinePosition=9
  StackTrace:
       at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at CarSystem.CustomControls.Searcher.InitializeComponent() in d:\ElsagTFS\EOC4\Client UI\CustomControls\Searcher.xaml:line 1
       at CarSystem.CustomControls.Searcher..ctor() in D:\ElsagTFS\EOC4\Client UI\CustomControls\Searcher.xaml.cs:line 431
  InnerException: System.ArgumentException
       Message=Error binding to target method.
       Source=mscorlib
       StackTrace:
            at System.Delegate.CreateDelegate(Type type, Object target, String method, Boolean ignoreCase, Boolean throwOnBindFailure)
            at System.Xaml.Schema.SafeReflectionInvoker.CreateDelegate(Type delegateType, Object target, String methodName)
            at System.Xaml.EventConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value)
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
            at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
            at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter`1 typeConverter, Object value, XamlMember property, String targetName, IAddLineInfo lineInfo)
       InnerException:

Here's the code for my class.  Please help me fix this problem.

    class CustomGridViewToggleRowDetailsColumn : GridViewBoundColumnBase {
  
        public static RoutedEvent ClickEvent =
            EventManager.RegisterRoutedEvent( "Click", RoutingStrategy.Bubble, typeof( ToggleRowDetailsColumnRoutedEventHandler ), typeof( CustomGridViewToggleRowDetailsColumn ) );
  
        public GridViewCell Cell { get; set; }
  
        public event RoutedEventHandler Click {
            add { AddHandler( ClickEvent, value ); }
            remove { RemoveHandler( ClickEvent, value ); }
        }
  
        public override object Header {
            get { return null; }
            set { base.Header = value; }
        }
        public GridViewToggleButton ToggleButton { get; set; }
  
        private Binding toggleButtonVisibility;
        public Binding ToggleButtonVisibility {
            get { return toggleButtonVisibility; }
            set { toggleButtonVisibility = value; }
        }
  
        public CustomGridViewToggleRowDetailsColumn() {
            // Set the EditTriggers property to None
            this.EditTriggers = GridViewEditTriggers.None;
        }
  
        public override bool CanFilter() {
            return false;
        }
  
        public override bool CanGroup() {
            return false;
        }
  
        public override bool CanSort() {
            return false;
        }
  
        public override FrameworkElement CreateCellElement( GridViewCell cell, object dataItem ) {
            Cell = cell;
  
            ToggleButton = new GridViewToggleButton { 
                Margin = new System.Windows.Thickness( 3 )
            };
  
            ToggleButton.Click += new RoutedEventHandler( ToggleButton_Click );
  
            if ( this.DataMemberBinding != null ) {
                ToggleButton.SetBinding( GridViewToggleButton.IsCheckedProperty, this.DataMemberBinding );
            }
  
            if ( ToggleButtonVisibility != null ) {
                ToggleButton.SetBinding( GridViewToggleButton.VisibilityProperty, ToggleButtonVisibility );
            }
  
            GridViewRow row = cell.ParentRow as GridViewRow;
  
            row.SetBinding( GridViewRow.DetailsVisibilityProperty, new Binding( "IsChecked" ) { 
                Source = ToggleButton, 
                Converter = new BooleanToVisibilityConverter(), 
                Mode = BindingMode.TwoWay 
            } );
  
            return ToggleButton;
        }
  
        void ToggleButton_Click( object sender, RoutedEventArgs e ) {
            RoutedEventArgs newEventArgs = new ToggleRowDetailsColumnRoutedEventArgs( ClickEvent, Cell );
            RaiseEvent( newEventArgs );
        }
    }
  
    public class ToggleRowDetailsColumnRoutedEventArgs : RoutedEventArgs {
  
        public GridViewCell Cell { get; set; }
  
        public GridViewRow Row {
            get { return Cell.ParentRow as GridViewRow; }
        }
  
        public ToggleRowDetailsColumnRoutedEventArgs( RoutedEvent routedEvent, GridViewCell cell )
            : base( routedEvent ) {
            Cell = cell;
        }
    }
  
    public delegate void ToggleRowDetailsColumnRoutedEventHandler( object sender, ToggleRowDetailsColumnRoutedEventArgs e );
}

Tony
Tony
Top achievements
Rank 1
 answered on 16 Apr 2012
2 answers
305 views
I have a RadDataForm, with a DataFormDataField, that is bound to a Decimal property.

I'm trying to get validation working, and I'm having some issues:

  1. When I have a validation error, and the DataFormDataField does not have its Label property set, the error is displayed using the name of the field, instead of the [Display(Name="xxx")] annotation.
  2. When I enter invalid characters (non-numeric), my Decimal property's setter is never called, instead the form displays a "Value 'xxx' could not be converted" error. I need to display a more meaningful message.
  3. I have a listener on the RadDataForm's ValidatingItem event - but that event is not called when I move focus from one field to another (which is when the above error messages appear.)
  4. I need to some level of validation on each keystroke. If the field can only hold 12 characters, an attempt to type a 13th should do nothing. If the user is typing in a field that can only hold numeric values, typing non-numeric characters should do nothing - the keyboard event should be swallowed, and the character should not appear in the field.  At a minimum, letters would be filtered, it'd be better if we could look at the new character and the existing content, and decide whether the new character can be applied without invalidating the field.  (If the field is bound to a decimal, it should allow numbers, and one decimal point. A second decimal point should be swallowed.)
Jeff
Top achievements
Rank 1
 answered on 16 Apr 2012
0 answers
127 views
Hi,
I would like to change the +/- symbol on a GridViewToggleRowDetailsColumn so i have created below ControlTemplate
<ControlTemplate x:Key="GridViewToggleButtonTemplate" TargetType="telerik:GridViewToggleButton">
                   <Border Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                       <Border Width="80" Height="20"
                   Background="{TemplateBinding Background}"
                   BorderBrush="{TemplateBinding BorderBrush}"               
                   BorderThickness="{TemplateBinding BorderThickness}"
                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                           <Grid x:Name="myGrid">
                               <TextBlock Text="Details" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                           </Grid>
                       </Border>
                   </Border>
                   <ControlTemplate.Triggers>
                       <Trigger Property="IsChecked" Value="True">
                           <Setter TargetName="myGrid" Property="Background" Value="Red" />
                       </Trigger>
                   </ControlTemplate.Triggers>
  
               </ControlTemplate>
  
               <Style TargetType="telerik:GridViewToggleButton" x:Key="toggleButtonStyle">
                   <Setter Property="Template" Value="{StaticResource GridViewToggleButtonTemplate}" />
               </Style>

And applied this style in telerik:RadGridView.Columns as below
<telerik:GridViewToggleRowDetailsColumn ToggleButtonStyle="{StaticResource toggleButtonStyle}" />

But this doesn't work so please let know how do i fix this problem.
Thanks in advance.
Pravin
Top achievements
Rank 1
 asked on 16 Apr 2012
1 answer
201 views
I am using the RadGridView
And I am having few doubts (WPF thing )
1) I am making the Autogenerated columns as True then the data gets populated auomatically. But what is the thing if I have the Property in the binding collection of type BOOLEAN and I want that to be shown as CheckBox, Can this be achieved with Autogenerated columns as True.

2) I am using the printing functionality for the gridview, incase I have a dropdown in the column and how do i get the selected dropdown item from that column and print it.

3) Also how do I print images from a grid view

4) And Finally I want to do some error handling for the data in the RadGridView, I dont find any where in ur site like demo kind for the error handling thing.
Dimitrina
Telerik team
 answered on 16 Apr 2012
1 answer
60 views
I can set color to the chart axis lines for a 2D chart by setting the AxisElementBrush of the chart control just like this:

mChartControl.AxisElementBrush = new SolidColorBrush(value);

This does not work with 3D charts. How can I get the grid lines to change colors when the chart is 3D? Why is it that I am running into so many problems to get a 3D chart to act the same as a 2D chart? dll version 2011.2.920.40 Thanks, James
Sia
Telerik team
 answered on 16 Apr 2012
0 answers
109 views
Hi. I have a small problem with RadDocking that I'm hoping there is some functionality to solve. We are using the Save/Load Layout methodology for capturing the state of our RadPanes and other controls. This provides a chunk of XML that we save out and load in as required. Unlike the PersistenceManager methodology though, there seems to be no way to prevent certain properties from being added to the XML chunk that's generated when SaveLayout is called on a RadDocking control. When developers change the header of a RadPane, for instance, the change is overwritten when the XML is passed to LoadLayout (even when the RadPane's SerializationTag is changed, which is very strange). I'm wondering if there's some way of preventing the Header property from appearing in the XML, or if we need to take steps to remove it ourselves. It's either this or ignore all of the XML, and leave the controls to assume their default configuration, overwriting the XML.

Many thanks,
- Chris M.
ChrisM
Top achievements
Rank 1
 asked on 16 Apr 2012
5 answers
94 views
Hi,

We are using RadGridView, RadPanelBar, RadDataFilter, RadBusyIndicator in our application.  We need to be 508 compliant and we were under the impression that Telerik controls were compatible.  When I use Jaws e-reader, navigation panel is not read by the e-reader.  DataFilter's dropdowns are not read, either.  If a user selects a column or filteroperator, they have no idea what they chose.
GridView's headers are skipped when tabbing through and goes into the data rows.  Add new item bar is also skipped.

Is there a property or maybe a setting we need to apply to get RadControls reader ready?

Thanks,
Dimitrina
Telerik team
 answered on 16 Apr 2012
0 answers
97 views
Hi,

i'm using the radCombobox like this:

<telerik:RadComboBox Grid.Row="0" Grid.Column="1" Margin="3" telerik:StyleManager.Theme="Summer" Name="SpracheCCB" DisplayMemberPath="Name" SelectionChanged="SpracheCCB_SelectionChanged"  />

I want set the selectedItem in the codebehind like this:

this.SpracheCCB.SelectedItem = SETTINGS.aktsprache;  
or
this.SpracheCCB.SelectedItem = 1;

SETTINGS.aktsprache = "german"

But it empty every time?!?!?
Is there a "simple" Example?

thanks
regards
rene
ITA
Top achievements
Rank 1
 asked on 16 Apr 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?