Telerik Forums
UI for WPF Forum
1 answer
224 views
Hi,
   I have used RadExpander in my project.I tried to use Scrollbar for that.but it is not visible.Please go through the code and suggest what is wrong here .Eventhough i have given image height and width greater than expander to get the scrollbar.

 
telerik:RadExpander Name="radTest" Header="Test1 " Height="150" Width="500" IsExpanded="False" HorizontalAlignment="Left" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible">

 <Image Source= "Agent.png" Height=" 300" Width="700">  </Image>

</telerik:RadExpander>

 

Tina Stancheva
Telerik team
 answered on 20 Jun 2013
2 answers
246 views
I am trying to replace RadMaskedTextBox with the appropriate RadMaskedInput-controls.

I now have a RadMaskedNumericInput like this:
<telerik:RadMaskedNumericInput x:Name="_numberOfPages" Margin="2" Grid.Column="4" Grid.Row="2"  MinWidth="60" 
        VerticalAlignment="Center" HorizontalAlignment="Stretch"
        Mask="d" FormatString="D2" TextMode="MaskedText"
        AllowInvalidValues="False"
        MaskedInput:MaskedInputExtensions.Minimum="0"
        SelectionOnFocus="SelectAll"
        ErrorMessage="Invalid number of pages"
        Value="{Binding ProjectListItemViewModel.SettableNumberOfPages, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
        Style="{StaticResource RadMaskedNumericInputStyle}"                                               />

The RadMaskedNumericInputStyle looks like this:
<ControlTemplate TargetType="{x:Type Control}" x:Key="ValidationErrorTemplate">
         <DockPanel LastChildFill="true">
            <Border BorderBrush="{StaticResource ErrorBrush}" BorderThickness="3" Panel.ZIndex="999"
                    Background="White" DockPanel.Dock="right" Margin="-8,0,0,0" Width="16" Height="16" CornerRadius="10"
                    ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                <Rectangle Fill="{StaticResource ErrorBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="3"
                        RenderTransformOrigin="0.5,0.5">
                    <Rectangle.RenderTransform>
                        <RotateTransform Angle="315" />
                    </Rectangle.RenderTransform>
                </Rectangle>
            </Border>
             
            <AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center">
                <Border BorderBrush="{StaticResource ErrorBrush}" BorderThickness="1" />
            </AdornedElementPlaceholder>
        </DockPanel>
    </ControlTemplate>
 
 
    <Style TargetType="{x:Type Controls:RadMaskedNumericInput}" x:Key="RadMaskedNumericInputStyle">
        <Setter Property="FontFamily" Value="Calibri" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="SelectionOnFocus" Value="CaretToEnd" />
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Style.Triggers>...</Style.Triggers>
    </Style>

My problem is that the original red X is still there if I put my mouse over - even if it is a valid input (see attachment).
What I want is the red border and the red sign on the border. What I do not want (ever) is the red sign with the cross in it.

Can you help me? Thx
Inger Marie
Top achievements
Rank 1
 answered on 20 Jun 2013
1 answer
136 views
I'm attempting to bind a floating point single (type is Single in VB.Net) to the value of databar and getting an error that a conversion cannot be made from Single to Double?

I've not experienced this with other controls.

A single is required in this case because the object is serialized and compressed. Using a single saves disk space.

Further, I need to provide the type Object to the Value property because in some cases I'm providing an Int32, whereas other times I am providing a Single. This is done via a datatemplate in a GridView.

It seems that if I provide anything pother than a double, the RadDataBar throws exceptions?

Am I overlooking something?
Tsvetie
Telerik team
 answered on 20 Jun 2013
11 answers
516 views
Hi
I am using a Radsplitbutton and its dropdown contents is a RadCOntextMenu which has subitems. The issue is when I expand the dropdown and mouse over on the item with subitems the submenu item is popped up and now I click outside the control .I see the popped up submenu item is closed but I want the dropdown also to be closed. Any help is much appreciated. Here is the sample code.
My XAML:

 

 

 

<Style x:Key="Group" TargetType="telerik:RadSplitButton">
<Setter Property="controls:ImageContentSetter.Source" Value="/Images/group.ico"/>
<Setter Property="ToolTip" Value="{x:Static Properties:Resources.Group_ToolTip}"/>
<Setter Property="IsToggle" Value="True"/>
<Setter Property="cal:Message.Attach" Value="[Event Click] = [Action ToggleGroupBy()]"/>
<Setter Property="IsChecked" Value="{Binding DocumentGroupingIsSet, Mode=TwoWay, UpdateSourceTrigger=Explicit}"/> <!-- TwoWay/Explicit allows the binding to work as a Get and not Set-->
<Setter Property="DropDownContent" Value="{Binding}"/>
<Setter Property="DropDownContentTemplate">
<Setter.Value>
<DataTemplate>
<telerik:RadContextMenu>
<i:Interaction.Behaviors> <uiExt:CloseDropDownBehavior/> 

</i:Interaction.Behaviors>  

<telerik:RadMenuItem Header="{x:Static Properties:Resources.Group_Header}" cal:Message.Attach="ToggleGroupBySetting('Cluster')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=Cluster, Mode=TwoWay}" >

 

<telerik:RadMenuItem.Icon>

 

<Image Height="24" Width="16" Source="..\..\Images\cluster.png" />
</telerik:RadMenuItem.Icon>
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="{x:Static Properties:Resources.GroupByDocumentFamily_Header}" > <telerik:RadMenuItem.Icon>
<Image Height="24" Width="16" Source="..\..\Images\sort_by_family.png" />
</telerik:RadMenuItem.Icon>
<telerik:RadMenuItem Header="{x:Static Properties:Resources.StandardListSort_Header}" cal:Message.Attach="ToggleGroupBySetting('DocFamilyListOnly')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=DocFamilyListOnly, Mode=TwoWay}" />
<telerik:RadMenuItem Header="{x:Static Properties:Resources.ParentOrChildPrimarySort_Header}" cal:Message.Attach="ToggleGroupBySetting('DocFamilySortParentChild')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=DocFamilySortParentChild, Mode=TwoWay}" />
<telerik:RadMenuItem Header="{x:Static Properties:Resources.ParentPrimarySort_Header}" cal:Message.Attach="ToggleGroupBySetting('DocFamilySortParent')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=DocFamilySortParent, Mode=TwoWay}" />
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="{x:Static Properties:Resources.GroupbyEmailThread_Header}" cal:Message.Attach="ToggleGroupBySetting('EmailThreading')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=EmailThreading, Mode=TwoWay}" >
<telerik:RadMenuItem.Icon>
<Image Height="24" Width="16" Source="..\..\Images\email_threads.png" />
</telerik:RadMenuItem.Icon>
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="{x:Static Properties:Resources.GroupExactDuplicates_Header}" cal:Message.Attach="ToggleGroupBySetting('ExactDuplicates')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=ExactDuplicates, Mode=TwoWay}" >
<telerik:RadMenuItem.Icon>
<Image Height="24" Width="16" Source="..\..\Images\group_exact_duplicates.png" />
</telerik:RadMenuItem.Icon>
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="{x:Static Properties:Resources.GroupNearDuplicates_Header}" cal:Message.Attach="ToggleGroupBySetting('NearDuplicates')" IsCheckable="True" StaysOpenOnClick="False" IsChecked="{Binding DocumentGrouping, Converter={StaticResource GroupedMenuItemsConverter}, ConverterParameter=NearDuplicates, Mode=TwoWay}" >
<telerik:RadMenuItem.Icon>
<Image Height="24" Width="16" Source="..\..\Images\group_near_duplicates.png" />
</telerik:RadMenuItem.Icon>
</telerik:RadMenuItem>
</telerik:RadContextMenu>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>

<

 

 

telerik:RadSplitButton x:Name="Group" Style="{StaticResource Group}" />

 



code for menu item click event:

private void MenuItemOnClick(object sender, RadRoutedEventArgs radRoutedEventArgs)

{
RadMenuItem menuItem = sender as RadMenuItem;
if(menuItem == null)  

Debug.Assert(false, @"Unexpected object type.");

return

if(menuItem.Items.Count > 0)

{
// normally, menu items with child menu items  

// do not generate a 'Click' event however, 

 

// if an item in its sub-menu has StaysOpenOnClick set
// we get a 'Click' event from the parent menu item!
return;

}
if(menuItem.StaysOpenOnClick)
{
// honor 'StaysOpenOnClick' behavior
return;
}
RadDropDownButton dropDownButton = menuItem.ParentOfType<RadDropDownButton>();
if (dropDownButton != null)
{

dropDownButton.IsOpen = false;
}
else
{
RadSplitButton splitButton = menuItem.ParentOfType<RadSplitButton>();
if (splitButton != null)
{

splitButton.IsOpen = false;
}
else
{
Debug.Assert(false, @"Cannot find parent RadDropDownButton or RadSplitButton.");
}

}

}

I want the dropdown to be closed when clicked outside the control when the menu item with submenu is expanded.Please help me to resolve this issue

Thanks
Rakesh




Travis
Top achievements
Rank 1
 answered on 19 Jun 2013
2 answers
362 views
How do I change the line color of a chart series when using a ChartSeriesProvider?

If I'm not using the ChartSeriesProvider, then I do this by setting the "Stroke" property,
as illustrated here.  This works:

<telerik:ScatterLineSeries Name="HeadSeries"
    ItemsSource="{Binding Path=DataPoints}"
    XValueBinding="FlowRate"
    YValueBinding="Head"
    PointTemplate="{StaticResource HeadPointTemplate}"
    Stroke="CornflowerBlue">
</telerik:ScatterLineSeries>

However, if use the ChartSeriesProvider, the following snippet does not change the line color.

<
telerik:ScatterSeriesDescriptor ItemsSourcePath="Item"
   XValuePath="FlowRate"
   YValuePath="Head">
  <telerik:ScatterSeriesDescriptor.Style>
    <Style TargetType="telerik:ScatterLineSeries">
      <Setter Property="PointTemplate" Value="{StaticResource HeadPointTemplate}" />
      <Setter Property="Stroke" Value="CornflowerBlue" />
    </Style>
  </telerik:ScatterSeriesDescriptor.Style>
</telerik:ScatterSeriesDescriptor>




Don
Top achievements
Rank 1
 answered on 19 Jun 2013
6 answers
293 views
Hi
base on this tutorial :http://www.telerik.com/help/wpf/radmap-features-data-binding.html
I Implemented INotifyPropertyChange for MapItem
public class MapItem : INotifyPropertyChanged
{
    #region INotifyPropertyChanged Members
    void OnPropertyChanged(string prop)
    {
        if (this.PropertyChanged != null)
            this.PropertyChanged(this, new PropertyChangedEventArgs(prop));
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
and change their Location with this line of code
private void button1_Click(object sender, RoutedEventArgs e)
      {
          foreach (MapItem item in infLayerMovingObjects.ItemsSource)
          {
              Location loc = item.Location;
              loc.Latitude += 0.001;
              loc.Longitude += 0.001;
              item.Location = loc;
          }
      }

but it does not work ,
how should I have to Refresh LayerInformation ?
why LayerInformation does not notice about change in its obesrvable collection ?
thanks.
SondreB
Top achievements
Rank 1
 answered on 19 Jun 2013
3 answers
255 views

Hi,

I have one problem with Fluid Content Control.
I've read the documentation of RadTileView and i've read the "Fluid Content Control" article
 (http://www.telerik.com/help/silverlight/radtileview-fluid-content-control.html).

My problem is in this code :

private void tivSessions_TileStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    RadTileViewItem item = e.OriginalSource as RadTileViewItem;
    if (item != null)
    

            // THIS DOESN'T WORK
        RadFluidContentControl fluidControl = item.Content as RadFluidContentControl;
            // Can't cast item.Content in RadFluidContentControl.

        if (fluidControl != null)
        {
            switch (item.TileState)
            {
                case TileViewItemState.Maximized:
                    fluidControl.State = FluidContentControlState.Large;
                    break;
                case TileViewItemState.Minimized:
                    fluidControl.State = FluidContentControlState.Small;
                    break;
                case TileViewItemState.Restored:
                    fluidControl.State = FluidContentControlState.Normal;
                    break;
            }
        }
    }
}

item.Content is actually my databind object.
I just can't get the RadFluidContent.

Here is my XAML :

<Window x:Class="PDCBrowser.MainWindow"
        Title="MainWindow" Loaded="Window_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <ComboBox Name="cbbTracks" DisplayMemberPath="TrackId" SelectedValuePath="TrackId"/>
        <Telerik:RadTileView Name="tivSessions" TileStateChanged="tivSessions_TileStateChanged" Grid.Row="1" ItemsSource="{Binding ElementName=cbbTracks, Path=SelectedItem}">
            <Telerik:RadTileView.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding ShortTitle}" TextWrapping="WrapWithOverflow"></TextBlock>
                </DataTemplate>
            </Telerik:RadTileView.ItemTemplate>
            <Telerik:RadTileView.ContentTemplate>
                <DataTemplate>
                    <Telerik:RadFluidContentControl  ContentChangeMode="Manual">
                        <Telerik:RadFluidContentControl.SmallContent>
                            <TextBlock>SMALL</TextBlock>
                        </Telerik:RadFluidContentControl.SmallContent>
                        <Telerik:RadFluidContentControl.Content>
                            <TextBlock>MEDIUM</TextBlock>
                        </Telerik:RadFluidContentControl.Content>
                        <Telerik:RadFluidContentControl.LargeContent>
                            <TextBlock>LARGE</TextBlock>
                        </Telerik:RadFluidContentControl.LargeContent>
                    </Telerik:RadFluidContentControl>
                </DataTemplate>
            </Telerik:RadTileView.ContentTemplate>
        </Telerik:RadTileView>
    </Grid>
</Window>

Any ideas ?
Regards.

Pavel R. Pavlov
Telerik team
 answered on 19 Jun 2013
3 answers
300 views
Hello,
I have quite complex object with joins and sub-queries to display on grid. Currently I'm getting only 1000 records from database to get better performance. I would really like to have benefits from grid filtering, sorting, server side virtualization, and paging to enable in rare cases uses to go through all data. However I didn't find any way or information how to to do that with complex select data. This data is currently collected 100% using Entity Framework. I've looked to use yours entity framework data source but it only allows simple usage - native entities not complex custom joins.

Could you advice me how to achieve that?
Rossen Hristov
Telerik team
 answered on 19 Jun 2013
2 answers
166 views
Hi,
I try to replace all inlineUIContainers in RadDocument by SpanBoxes. I know how to do it at caretposition using Delete as,
DocumentPosition currentPosition = radRichTextBox1.Document.CaretPosition;
radRichTextBox1.Document.Delete(false, currentPosition);
radRichTextBox1.Insert(text);

However I am not sure how to get documentpostion for each inlineUIContainers. I need help on this.

Thanks,
York
Boby
Telerik team
 answered on 19 Jun 2013
1 answer
69 views
Hi telerik,

I'm trying to make the move from 'old school' d'n'd to the new based on latest release. I've tried to follow you example in documentation.
However, no events are activated. The dragged item is moved to new location, completely handled by the treeview (and none of my code discovers it).

Any suggestions on what to do?

Thanks,

Anders

xaml:
<Controls:RadTreeView
           ItemsSource="{Binding Path=WorkspaceViewModel.Children, NotifyOnSourceUpdated=True}"
           Name="treeview"
           IsLineEnabled="True"
           MouseRightButtonDown="TreeviewMouseRightButtonDown"
           IsDragDropEnabled="True"
           SelectionMode="Single"
           MouseLeftButtonDown="TreeviewMouseLeftButtonDown"
           IsEditable="{Binding CommandHandlerViewModel.CanEditSelected}"
           ItemEditTemplate="{StaticResource edittemplate}"
           >
            
           <Controls:RadTreeView.Resources>
               <Style TargetType="Controls:RadTreeView">
                   <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"></Setter>
               </Style>
           </Controls:RadTreeView.Resources>


In the constructor of the usercontrol, holding the treeview:

DragDropManager.AddDragInitializeHandler(treeview, OnDragInitialize);
 
DragDropManager.AddGiveFeedbackHandler(treeview, OnGiveFeedback1);
 
DragDropManager.AddDragDropCompletedHandler(treeview, OnDragCompleted1);
 
DragDropManager.AddDropHandler(treeview, OnDrop1);

None of them are implemented yet -- I'm expecting an exception:
private void OnDragCompleted1(object sender, DragDropCompletedEventArgs e)
{
    throw new NotImplementedException();
}
 
private void OnDrop1(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
    throw new NotImplementedException();
}
 
private void OnGiveFeedback1(object sender, GiveFeedbackEventArgs e)
{
    throw new NotImplementedException();
}
 
private void OnDragInitialize(object sender, DragInitializeEventArgs e)
{
    throw new NotImplementedException();
}
Anders
Top achievements
Rank 1
 answered on 18 Jun 2013
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?