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

<Style x:Key="GridViewToggleButtonStyle1" TargetType="{x:Type telerik:GridViewToggleButton}">
<Setter Property="ArrowTemplate">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:GridViewToggleButton}">
<Border Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Height="9">
<Grid>
<Path x:Name="plus" Data="M0.5,0.5L6.5,3.5 0.5,6.5z" Fill="White" Height="9" Margin="{TemplateBinding Padding}" Stretch="Fill" Stroke="#FF9D9D9D" StrokeThickness="{TemplateBinding BorderThickness}" Width="6"/>
<Path x:Name="minus" Data="M6.5,0.5L6.5,6.5 0.5,6.5z" Fill="#FF595959" Height="7" Margin="{TemplateBinding Padding}" Opacity="0" Stretch="Fill" Stroke="Black" StrokeThickness="{TemplateBinding BorderThickness}" Width="7"/>
</Grid>
</Border>

<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding ElementName=LayoutRootGrid,Path=DataContext.ClickCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Border>
<ControlTemplate.Triggers>
<Trigger SourceName="plus" Property="Opacity" Value="1">
<Setter Property="Background" Value="Red"/>
</Trigger>
<Trigger SourceName="plus" Property="Opacity" Value="0">
<Setter Property="Background" Value="Yellow"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

Here is the point
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding ElementName=LayoutRootGrid,Path=DataContext.ClickCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>-->

it should work but not working

I want to execute ViewModel's ClickCommand when users expand and collapse. Take a look at the attached file
Weera
Top achievements
Rank 1
 answered on 09 Jan 2015
1 answer
248 views
Hi,
  I am facing one issue with the telerik RadDatePicker in my WPF application. I have formatted the display date with DataFormat(MM/dd/yy) so that it display two digit
year like 01/02/20.

Now when I entered 01/02/20 into the textbox(RadWatermarkTextBox) of RadDatePicker the dropdown showing 2nd Jan 2020. But when I entered 01/02/55, the dropdown is showing 2nd Jan 1955.
I am not sure why it is inconsistent when I select two differnet date. I have to validate the date entered so that user can select date with in specific range.

I can not even update the SelectedDate/DisplayDate of the DatePicker from C# code.
Could you please help me how to establish the logic to validate the date with 2 digit year.
Also let me knwo how to update the SelectedDate/DisplayDate of the radDatePicker.

Regards
Satya
Kalin
Telerik team
 answered on 09 Jan 2015
2 answers
87 views
I am using 2014.2.729.45 RadOutlookBar as a navigation tool in my wpf app.  there are 8 menu items.  I have set active items count = 5. and my selected index is bound to my view model.

If increase, via the app when running, my active items count to 8 (showing all options), and I click on ANY outlookBarItem, then the correct menu appears.

Interestingly, if I say keep the active items count to 5 and I have 3 items in the small bar across the bottom I get very strange behavior.  so my description let's say there is Item1 thru Item 8.

Item1 thru Item5 are showing
Item6 to Item8 are in the bottom bar, small icon section.

If I click on icon for Item6, the viewmodel registers Item6 clicked.
If I click on icon for Item7, the viewmodel registers Item7 clicked, and then Item6 click. - so item 6 appears
If I click on icon for Item8, the viewmodel registers Item8 clicked, and then Item7 click, then item6. - so item6 appears

so you can never get to item7 and item8 to show, unless you make all items active.


<telerik:RadOutlookBar Grid.Row="0"
                             Grid.Column="0"
                             VerticalContentAlignment="Center"
                             ActiveItemsCount="5"
                             Background="{StaticResource ColorUnityWhite}"
                             IsMinimizable="False"
                             IsVerticalResizerVisible="False"
                             MinimizedButtonContent="Menu"
                             MinimizedWidth="40"
                             SelectedIndex="{Binding CurrentMenuIndex,
                                                     Mode=TwoWay,
                                                     UpdateSourceTrigger=PropertyChanged}"
                             >

this what an Item looks like:

<!--  home  -->
            <telerik:RadOutlookBarItem Height="40"
                                      BorderBrush="{x:Null}"
                                      Header="Home"
                                      SmallIcon="/Ppdg.Unity.Client.UI;component/Assets/Images/homeVerySmall.gif"
                                      Visibility="{Binding Path=CanAccessHome,
                                                           Mode=OneWay,
                                                           Converter={StaticResource Bvc}}"
                                      >
                <telerik:RadOutlookBarItem.HeaderTemplate>
                    <DataTemplate>
                        <Grid>
                            <telerik:RadDockPanel>
                                <Image Width="32"
                                      Height="32"
                                      Source="/Ppdg.Unity.Client.UI;component/Assets/Images/homeMedium.gif"
                                      ToolTip="Home"
                                      telerik:RadDockPanel.Dock="Left"
                                      />
                                <TextBlock Margin="6 6 0 0"
                                          Style="{StaticResource MainMenuTextBlockStyle}"
                                          Text="Home"
                                          />
                            </telerik:RadDockPanel>
                        </Grid>
                    </DataTemplate>
                </telerik:RadOutlookBarItem.HeaderTemplate>
            </telerik:RadOutlookBarItem>

Robert
Top achievements
Rank 1
 answered on 08 Jan 2015
2 answers
130 views
Hello,

While trying to implement the OutlookBar as a container in Prism tutorial (http://docs.telerik.com/devtools/wpf/controls/radoutlookbar/how-to/How_to_Use_RadOutlookBar_as_a_Container_in_Prism_Application.html), the headers do not appear as the tutorial shows. 

I am following the first guide where it adds a header by adding a member, ItemHeader, to the view.  The OutlookBar is set with the DisplayProperty = "ItemHeader", but upon execution, the application does not show the header.  If the horizontal bar is dragged down, the items are minimized and can be read.  So, it appears that the header is set, but is not being displayed properly while not minimized.

I'm assuming this is a simple binding error, but I'm not sure how to proceed.
Paul
Top achievements
Rank 1
 answered on 08 Jan 2015
4 answers
143 views
Hi.

I have a custom appointment with some additional properties. When I change these properties I update appointments End time and Subject, but I see the changes only after I click on OK button. Calling OnPropertyChanged brings no effect. How can I update the UI in the edit dialog, so users can see the changes?
tarnegur
Top achievements
Rank 1
 answered on 08 Jan 2015
10 answers
206 views
I have a DocumentHost with some Panes bound to a PaneGroup. Everything works well, except when I want to Drag a Pane for Docking it, as soon as I grabbed the tab and want to drag it, an error message "System.ArgumentException was unhandled / Message: This pane cannot be removed from parent, because it doesn't have one!" appears. What is my mistake here?
Thanks for your support :)
Best regards

<!-- Tabs -->
<telerik:RadDocking.DocumentHost>
    <telerik:RadSplitContainer Margin="0,-3,0,0" BorderThickness="1">
        <telerik:RadPaneGroup TabStripPlacement="Top"
                              ItemsSource="{Binding Tabs}"
                              Background="#FFF0F0F0"
                              BorderThickness="1"
                              BorderBrush="#FF868686">
            <telerik:RadPaneGroup.ItemContainerStyle>
                <Style TargetType="telerik:RadPane">
                    <Setter Property="BorderThickness" Value="0" />
                    <Setter Property="CanUserClose" Value="False" />
                    <Setter Property="CanFloat" Value="True" />
                    <Setter Property="CanUserPin" Value="False" />
                    <Setter Property="ContextMenuTemplate" Value="{x:Null}" />
                </Style>
            </telerik:RadPaneGroup.ItemContainerStyle>
            <telerik:RadPaneGroup.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                        <StackPanel.Resources>
                            <Style TargetType="{x:Type Ellipse}">
                                <Setter Property="Width" Value="3"/>
                                <Setter Property="Height" Value="3"/>
                                <Setter Property="Fill" Value="Red"/>
                                <Setter Property="Margin" Value="3,0,3,0"/>
                            </Style>
                        </StackPanel.Resources>
                        <TextBlock Text="{Binding Title}" />
                        <Ellipse Visibility="{Binding IsDirty, Converter={StaticResource BooleanToVisibilityConverter}}" />
                        <Button Command="{Binding CloseCommand}"
                        Width="12" Height="12" Margin="4,0,0,0" ToolTipService.ToolTip="Close Tab">
                            <Button.Content>
                                <Path Data="M0,0 L6,6 M6, 0 L0,6" Stroke="Black" StrokeThickness="0.5" />
                            </Button.Content>
                        </Button>
                    </StackPanel>
                </DataTemplate>
            </telerik:RadPaneGroup.ItemTemplate>
            <telerik:RadPaneGroup.ContentTemplate>
                <DataTemplate>
                    <Views:ClientDetails
                    DataContext="{Binding}" IsDirty="{Binding IsDirty,Mode=TwoWay}" />
                </DataTemplate>
            </telerik:RadPaneGroup.ContentTemplate>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
</telerik:RadDocking.DocumentHost>
Nasko
Telerik team
 answered on 08 Jan 2015
3 answers
605 views

Hi,

 

I cannot figure out the syntax to bind an ADO.NET DataTable to a Rad Combobox. Can you please help me by posting some source code on how to accomplish the following task:

 

 I have a DataTable fo countries that has an id column and a name column. I want to show the country name in the combo box but when an item is selected in the combo box, I want to return the id. This is a very common task in asp.net and win forms but I cannot figure out how to do this task using the rad combo box.

 

How would I accomplish something like this using the rad combo box?

 

DataTable dt = GetCountries();

This.cboCountries.DataText = “Country”;

This.cboCountries.DataValue = “id”;

This.cboCountries.DataSource = dt;

This.cboCountries.DataBind();

 

// get the selected id in the combo box

Int id = this.cboCountries.SelectedValue;

 

Can you please post the correct syntax to accomplish this task using the rad combo box.

 

Thanks for the help!

 

Bill

Kalin
Telerik team
 answered on 08 Jan 2015
4 answers
401 views
Here's what I'm trying to accomplish: I have an app that needs to show the user's current location on a map (determined using an attached GPS puck.  The library I'm using provides me the latitude, longitude and accuracy (in meters).  I will also want to place other pins on the map (lat, long only).  I want to display a dot on the map that represents the lat/long, with a circle around it, the width of which displays the accuracy of the reading.

So, I will have an observable collection of objects that have lat, long and accuracy.  I've been trying to follow this page in the documentation:

http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/data-binding.html

but this is pixel-based sizing.  I want the ellipse I draw to be a certain height/width determined by a distance on the map.  I have the radius in meters, but I also have a function that will convert it in to a value that represents the degrees of latitude/longitude, which works in the EllipseData object.  However, since I'm databinding, the EllipseData object can't be used in the items template (not a Dependency object) and even still, the properties for width and height can't be bound as they aren't dependency properties.

How can I specify a width/height of a data-bound ellipse in the information or visualization layers in meters (or degrees)?  A related question that may be the solution is this: how can I determine the scale of the currently displayed map view-port?  I could certainly use a value converter or attached property or something to figure out the pixel width from there (though I'd prefer a simpler way).

Thanks in advance!

Adam
Petar Mladenov
Telerik team
 answered on 08 Jan 2015
1 answer
183 views
I dont find missing values property for Scatterlineseries. Is it there only for HTML? My requirement is to interpolate the missing points in scatterlineseries and after interpolation is there a way to get the interpolated value.

Thanks & Regards,
Sandeep Kumar Vidiyala
Petar Marchev
Telerik team
 answered on 08 Jan 2015
3 answers
796 views
Hello,

I'm using xaml, view model and validation rule in C#

The RadDatePicker has default validation for any invalid date. 

In my xaml, I have my own validation rule for RadDatePicker and RadTimePicker with this Style of my ControlTemplate to display the error. (please see the xaml code below the for the Control Template Style and my validation rule)

We allow the user to put nothing or empty string in the DatePicker unless we set it to mandatory that will use our validation rule to output a customized error style and message.In our validation rule, if we want to raise the error, it will use this code "return new ValidationResult(false, ErrorMessage);" However, since the default validation of RadDatePicker or RadTimePicker, it still set show the default error even the validation rule switches off the validation with this line  "return new ValidationResult(true, null);"

 Is there way I can disable the default behaviour and implement the custom behaviour I have?

Thanks.

Jason

====  Style of my ControlTemplate ==========

<ControlTemplate x:Key="validationTemplate">
                <DockPanel>
                    <TextBlock Foreground="Red" FontSize="20">!</TextBlock>
                    <AdornedElementPlaceholder/>
                </DockPanel>
            </ControlTemplate>
            <Style x:Key="radDatePicker" TargetType="{x:Type telerik:RadDatePicker}">
                <Style.Triggers>
                    <Trigger Property="Validation.HasError" Value="true">
                        <Setter Property="ToolTip"
              Value="{Binding RelativeSource={x:Static RelativeSource.Self},
                              Path=(Validation.Errors)[0].ErrorContent}"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="radTimePicker" TargetType="{x:Type telerik:RadTimePicker}">
                <Style.Triggers>
                    <Trigger Property="Validation.HasError" Value="true">
                        <Setter Property="ToolTip"
              Value="{Binding RelativeSource={x:Static RelativeSource.Self},
                              Path=(Validation.Errors)[0].ErrorContent}"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
  
=================================================

==== xaml code to my validation rule ==========

 <telerik:RadDatePicker.SelectedDate>
                        <Binding Path="CommercialStartDateSelectedDate"
                                     UpdateSourceTrigger="PropertyChanged"
                                     Mode="TwoWay"
                                     >
                            <Binding.ValidationRules>
                    <common:MandatoryValidationRule
                                   
                                            ValidatesOnTargetUpdated="False"
                                            FieldName="CommercialStartDate" InstanceId="{common:DataResourceBinding DataResource={StaticResource commercialLayoutDesignInstanceId}}" IsMandatory="{common:DataResourceBinding DataResource={StaticResource commercialStartDateIsMandatory}}" ErrorMessage="{x:Static local:Globalization.CommercialStartDateMandatoryErrorMessage}" >
                    </common:MandatoryValidationRule>

                    <common:RecommendedValidationRule
                                            ValidatesOnTargetUpdated="False"
                                            IsRecommended="{common:DataResourceBinding DataResource={StaticResource commercialStartDateIsRecommended}}" ErrorMessage="{x:Static local:Globalization.CommercialStartDateRecommendedErrorMessage}" >
                    </common:RecommendedValidationRule>
                </Binding.ValidationRules>


Thanks,
Kalin
Telerik team
 answered on 08 Jan 2015
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?