Telerik Forums
UI for WPF Forum
1 answer
129 views
Hy,

In radbook template i would to add a simply close button with its click event to close the control itself
How i can this? There is any code sample?

Many thanks :)
Tina Stancheva
Telerik team
 answered on 16 Oct 2013
4 answers
359 views
Hi,

I have a  chart which has a linear axis and with a range of -150 to 150. As soon as I zoom the label for 0 is displayed in scientific notation (see attached image). Is there a way I can stop this? I would prefer to not have to set a format string on the axis as I would like the labels to show more decimal places as the user zooms in to view the data in more detail.

Thanks,

Steven
Evgenia
Telerik team
 answered on 16 Oct 2013
1 answer
133 views
Hi,

I have a RadScheduleView and a Listbox in a UserControl that I am dragging appointments between which works great.

My issue is that my application uses a RadDocking control with a RadPane docked on the left with the UserControl inside a RadDocumentPane on the right. When I am dragging an appointment and I move outside of the UserControl and onto the RadPane it is showing that it will accept the Drop of the appointment which it shouldn't. I have tried setting AllowDrop = false on the RadPane but this does not change anything.

Any ideas?

Thanks
Anthony

Vladi
Telerik team
 answered on 16 Oct 2013
1 answer
96 views
Hi, 

I need to implement a custom tool that is very similar to the crop tool in the user experience. I mean the user has to activate the tool, draw a square across the image, resize and move if necessary and then trigger a custom functionality instead of cropping. 

Is it possibile to perform it by overriding the crop tool or it needs to create a new ITool from the scratch? How can I implement that two steps process (Selection/adjustment then action) whithin a custom tool? How can I manage to draw the square like in the crop tool?

Thank you very much for your responses

My warmest regards

Luca 
Petya
Telerik team
 answered on 16 Oct 2013
3 answers
200 views
Hi,
I seem to be unable to get the databinding to work so that, for example, the background colour of a grid cell is set to the colour property of a business object. Please can someone take a look and show me the error of my ways?

ORM version 2013.2.702.1
RadControls for WPF version 2013.2.724.40

In summary, I am getting a list back from the database using a stored procedure mapped to a domain method. I have also added a partial class and a transient property to the result item in my ORM library. This transient property is a System.Windows.Media.Color and the values are stored in an XML file that are merged with the database result by my view model prior to the view being presented.

In my attempt to understand why the colour is not set, I am showing the ToString result in the cell so I know the colour value is present, however, the colour of the cell remains white.

Here's my ORM partial class:
using System;
using System.Linq;
using System.Windows.Media;
 
namespace xyz
{
    public partial class DBLISTitem
    {
        [Telerik.OpenAccess.Transient]
        private Color _patternColour;
        public Color PatternColour
        {
            get
            {
                return _patternColour;
            }
            set
            {
                _patternColour = value;
            }
        }
    }
}

Here's the XAML cut down for brevity:
<UserControl x:Class="..."
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Grid.Resources>
            <telerik:ColorToBrushConverter x:Key="ColorToBrushConverter" />
        </Grid.Resources>
 
        <telerik:RadGridView Name="ocyMapyGrid" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
                             HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="Auto" IsFilteringAllowed="False" CanUserSortColumns="True" CanUserSortGroups="True" 
                             ItemsSource="{Binding DBLIST, Mode=TwoWay}" AutoGenerateColumns="False" ShowGroupPanel="False"
                             ShowInsertRow="False"
                             RowHeight="23" RowIndicatorVisibility="Collapsed" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                             CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="True"
                             >
                <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ColName}" Header="Col1" Width="*" />
                <telerik:GridViewDataColumn Header="Colour" Width="150">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=PatternColour}" Background="{Binding Path=PatternColour, Converter={StaticResource ColorToBrushConverter}}" Margin="0" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</UserControl>

I've attached a sample of the output view.

I've since worked on a very simple test project to try to reproduce the problem but I cannot. The test app works. I changed the cell template in the problem app to match the working test app as follows:
<telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
        <TextBlock Text="{Binding Path=HatchPatternColour}" Margin="0">
            <TextBlock.Background>
                <SolidColorBrush Color="{Binding Path=HatchPatternColour}" />
            </TextBlock.Background>
        </TextBlock>
    </DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
This made no difference. The backgound color remains white.

Further to this, I've increased the trace level to high and get this output for the SolidColorBrush binding:
System.Windows.Data Warning: 54 : Created BindingExpression (hash=20902088) for Binding (hash=2322454)
System.Windows.Data Warning: 56 :   Path: 'HatchPatternColour'
System.Windows.Data Warning: 58 : BindingExpression (hash=20902088): Default mode resolved to OneWay
System.Windows.Data Warning: 59 : BindingExpression (hash=20902088): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 60 : BindingExpression (hash=20902088): Attach to System.Windows.Media.SolidColorBrush.Color (hash=53901065)
System.Windows.Data Warning: 62 : BindingExpression (hash=20902088): Use Framework mentor <null>
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source 
System.Windows.Data Warning: 67 : BindingExpression (hash=20902088): Framework mentor not found
System.Windows.Data Warning: 63 : BindingExpression (hash=20902088): Resolve source deferred
System.Windows.Data Warning: 93 : BindingExpression (hash=20902088): Got InheritanceContextChanged event from SolidColorBrush (hash=53901065)
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source 
System.Windows.Data Warning: 68 : BindingExpression (hash=20902088): Found data context element: TextBlock (hash=15347538) (OK)
System.Windows.Data Warning: 69 : BindingExpression (hash=20902088): DataContext is null
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source 
System.Windows.Data Warning: 68 : BindingExpression (hash=20902088): Found data context element: TextBlock (hash=15347538) (OK)
System.Windows.Data Warning: 76 : BindingExpression (hash=20902088): Activate with root item TopLevelAccountCode (hash=28952916)
System.Windows.Data Warning: 106 : BindingExpression (hash=20902088):   At level 0 - for TopLevelAccountCode.HatchPatternColour found accessor ReflectPropertyDescriptor(HatchPatternColour)
System.Windows.Data Warning: 102 : BindingExpression (hash=20902088): Replace item at level 0 with TopLevelAccountCode (hash=28952916), using accessor ReflectPropertyDescriptor(HatchPatternColour)
System.Windows.Data Warning: 99 : BindingExpression (hash=20902088): GetValue at level 0 from TopLevelAccountCode (hash=28952916) using ReflectPropertyDescriptor(HatchPatternColour): Color (hash=1871599772)
System.Windows.Data Warning: 78 : BindingExpression (hash=20902088): TransferValue - got raw value Color (hash=1871599772)
System.Windows.Data Warning: 87 : BindingExpression (hash=20902088): TransferValue - using final value Color (hash=1871599772)
Doesn't this show that it has found the Color property?

Any suggestions please?

Thanks
Craig

Craig
Top achievements
Rank 1
 answered on 16 Oct 2013
1 answer
357 views
Hello.
I'm a beginner.
I think it's kind of difficult to make program related to Log-in stuff to me.
Do you have a plan to support Wpf Login Control.
Yana
Telerik team
 answered on 16 Oct 2013
1 answer
324 views
Hi,

I have a chart like the one in the attached image, this is the code:

<telerik:RadCartesianChart Name="CartesianChartDemo" Margin="10">
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior PanMode="Both" ZoomMode="Both"/>
            </telerik:RadCartesianChart.Behaviors>
        </telerik:RadCartesianChart>

CartesianChartDemo.VerticalAxis = new LinearAxis();
CartesianChartDemo.HorizontalAxis = new CategoricalAxis();
 
CartesianChartDemo.Grid = new CartesianChartGrid() { MajorLinesVisibility = GridLineVisibility.XY };
 
DataTable dtAlloys = new DataTable("DATA");
 
dtAlloys.Columns.Add(new DataColumn("Name", typeof(string)));
dtAlloys.Columns.Add(new DataColumn("Value1", typeof(double)));
dtAlloys.Columns.Add(new DataColumn("Value2", typeof(double)));
 
dtAlloys.Rows.Add(new object[] { "Value1", 70, 30 });
dtAlloys.Rows.Add(new object[] { "Value2", 15, 85 });
dtAlloys.Rows.Add(new object[] { "Value3", 50, 50 });
 
BarSeries barSer = new BarSeries();
barSer.ShowLabels = true;
barSer.CombineMode = ChartSeriesCombineMode.Stack100;
 
BarSeries barSer2 = new BarSeries();
barSer2.ShowLabels = true;
barSer2.CombineMode = ChartSeriesCombineMode.Stack100;
 
foreach (DataRow drAlloy in dtAlloys.Rows)
{
    barSer.DataPoints.Add(new CategoricalDataPoint() { Category = drAlloy["Name"], Label = string.Format("{0:N}", drAlloy["Value1"]), Value = double.Parse(drAlloy["Value1"].ToString()) });
    barSer2.DataPoints.Add(new CategoricalDataPoint() { Category = drAlloy["Name"], Label = string.Format("{0:N}", drAlloy["Value2"]), Value = double.Parse(drAlloy["Value2"].ToString()) });
    
}
 
CartesianChartDemo.Series.Clear();
CartesianChartDemo.Series.Add(barSer);
CartesianChartDemo.Series.Add(barSer2);

I am trying to use the MouseDown event to do something like show an alert with bar info or open a new window and pass it data from that bar that I am clicking.

How can I obtain the data of the bar that I am clicking?

It is ok to use that event or should I use another one?

Thanks,

Alberto



Petar Kirov
Telerik team
 answered on 16 Oct 2013
1 answer
133 views
I have byte array data in which it contains text and images.
Now i want to show that byte array into table paragraph.
I tired it with InlineImage  by converting byte array to stream but its not working

is there any option to show such a byte array containing of image and text together?

Thanx in advance
Petya
Telerik team
 answered on 15 Oct 2013
5 answers
445 views
I'm trying to implement paste functionality into my GridView, but have run into 2 issues.

First, even if the Grid is set with SelectionUnit="FullRow" SelectionMode="Single", after a paste occurs the top row where the data was pasted remains selected. I can then select another row, ending up with multiple-rows selected. Subsequent pastes start at the top-most selected row, even if it's not the most recently selected row. Therefore, in addition to a very strange display (with multiple rows selected and no apparent way to unselect them), you can never paste data into rows below where you have previously pasted data.

The second issue is that the InsertNewRows value of GridViewClipboardPasteMode no longer appears to be present, such that pasting data when not enough rows exist to accommodate truncates the paste.

For reference, the options I'm using are:

       <telerik:RadGridView Grid.Row="0"  x:Name="HistoricalGridView" AutoGenerateColumns="False" ItemsSource="{Binding Path=HistoricalData}" 
                                 IsFilteringAllowed="False" ShowGroupPanel="False" CanUserSortColumns="False" 
                              ClipboardPasteMode="OverwriteWithEmptyValues,Cells" SelectionUnit="FullRow" SelectionMode="Single" >

Thanks for your help on these.

Louis
Maya
Telerik team
 answered on 15 Oct 2013
1 answer
139 views
Hi,

I have a radTreeView defined with its context menu in resources::

<UserControl.Resources>
    <sampleData:c_treeViewData x:Key="DataSource"/>
    <Style x:Key="ItemContainerStyle" TargetType="telerik:RadTreeViewItem">
        <Setter Property="IsExpanded" Value="True"/>
    </Style>
    <DataTemplate x:Key="ItemEditTemplate">
        <Grid>
 
            <StackPanel Orientation="Horizontal">
                <TextBox Text="{Binding Name, Mode=TwoWay}"/>
            </StackPanel>
 
        </Grid>
    </DataTemplate>
     
    <DataTemplate x:Key="c_proprietyValue">
        <TextBlock Text="{Binding Name}" FontSize="14" TextWrapping="Wrap" Width="200" />
    </DataTemplate>
 
 
    <HierarchicalDataTemplate x:Key="c_proprietyType" ItemTemplate="{StaticResource c_proprietyValue}"
       ItemsSource="{Binding propretyValues}">
        <StackPanel Orientation="Horizontal">
        <Image Source="{Binding Image}" Margin=" 0,0,6,0" Height="20" Width="20" />
        <TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="14">
              <telerik:RadContextMenu.ContextMenu >
                    <telerik:RadContextMenu Name="rcm_context1" Opened="RadContextMenu_Opened">
                    <telerik:RadMenuItem Name="Delete" Header="Delete" />
                    <telerik:RadMenuItem Name="Contraer" Header="Collapse tree" />
                    <telerik:RadMenuItem Name="Expandir" Header="Expand tree" />
                </telerik:RadContextMenu>
              </telerik:RadContextMenu.ContextMenu>
             
        </TextBlock>
        </StackPanel>
    </HierarchicalDataTemplate>
 
    <HierarchicalDataTemplate x:Key="c_block" ItemTemplate="{StaticResource c_proprietyType}"
       ItemsSource="{Binding propretyTypes}" >
        <StackPanel Orientation="Horizontal">
            <Image Source="{Binding Image}" Margin=" 0,0,6,0" Height="20" Width="20" />
             
            <TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="16" HorizontalAlignment="Stretch">
             
    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu Opened="RadContextMenu_Opened">
            <telerik:RadMenuItem Name="Rename" Header="Rename" />
            <telerik:RadMenuItem Name="Delete" Header="Delete" />
            <telerik:RadMenuItem Name="Contraer" Header="Collapse tree" />
            <telerik:RadMenuItem Name="Expandir" Header="Expand tree" />
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
 
            </TextBlock>
 
        </StackPanel>
    </HierarchicalDataTemplate>
 
 
 
</UserControl.Resources>


I want to access the context menu to change the headers of the items depending on the country. 
Can you help me, please? I'm using VB.NET

Thanks

Daniel
Top achievements
Rank 1
 answered on 15 Oct 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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?