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

Can I override default editortemplate for properties?

I would like to use TextBox instead of TextBlock on properties, that are readonly (like in VS2012
I'm using autogenerated scenarios.

I guess setting editortemplate explicitly in propertydefinition will override editortemplateselector logic as well, which is not desired behaviour
Daniel
Top achievements
Rank 1
 answered on 27 Feb 2013
1 answer
108 views
Hi, 

I am trying to display company revenue by product using AreaSeries and SeriesMapping. But unfortunately
I don't know how to set CombineMode in SeriesMapping way. Could you please provide an example? 

private
void SetMappings(RadChart chart)
{
    SeriesMapping seriesMapping = new SeriesMapping() { ChartAreaName = "MyChartArea" };
    seriesMapping.SeriesDefinition = new AreaSeriesDefinition();
 
    //=============================================//
    ItemMapping itemMapping = new ItemMapping();
    itemMapping.DataPointMember = DataPointMember.YValue;
    itemMapping.FieldName = "Rev";
 
    ItemMapping itemMapping2 = new ItemMapping();
    itemMapping2.DataPointMember = DataPointMember.XValue;
    itemMapping2.FieldName = "Date";
 
    seriesMapping.ItemMappings.Add(itemMapping);
    seriesMapping.ItemMappings.Add(itemMapping2);
 
    chart.SeriesMappings.Add(seriesMapping);
}

<telerikChart:RadChart x:Name="RadChart1" UseDefaultLayout="False">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
 
            <telerikCharting:ChartTitle Grid.ColumnSpan="2" Content="Chart Title"></telerikCharting:ChartTitle>
 
            <telerikCharting:ChartArea Grid.Row="1" x:Name="MyChartArea" LegendName="MyLegend" Margin="-1,1,1,-1"  />
            <telerikCharting:ChartLegend Grid.Row="1" Grid.Column="1" x:Name="MyLegend"></telerikCharting:ChartLegend>
        </Grid>
    </telerikChart:RadChart>


Thanks!
Evgenia
Telerik team
 answered on 27 Feb 2013
1 answer
137 views
Hello everyone,

as far as I my investigation has led me so far, Telerik controls don't support runtime localization (no mater how I poked them :)). I've read a tutorial on localization http://www.telerik.com/help/wpf/common-localization.html and successfully localized our app if the culture is set at startup time as described.

I have a really strict requirement of supporting language change at runtime because international operators will be using the app at the same time. Our system controls important equipment and total load time of application varies between 5-10 minutes, even on high-end server machines. Figures, reloading an entire app to switch a bunch of strings is not an option.

I'm even open to hacks if necessary to make this work. I've found a little hack on Silverlight forum (http://www.telerik.com/community/forums/silverlight/gridview/change-language-of-localization-of-radgridview-at-runtime.aspx) but it didn't work for RadCartesianChart.

All ideas are welcome. Thanks in advance.
Petar Kirov
Telerik team
 answered on 27 Feb 2013
4 answers
163 views
Hi,
This is my first encounter with Telerik Grid, and i am facing a seemingly simple problem. I have a bound Grid, and I add some GridViewDataColumn which are unbound. Using GridViewDataColumn has it's reasons, as i need to have the option of filtering, grouping and sorting with these.
I am trying to fill these columns in RowLoaded event, as it seems suitable due to row virtualization, but e.Row only offers bound cells. My 3 unbound columns are not accessible.

For each row I also need access to the data item, the row is bound to, because using this I fill these columns.

Is this or similar thing is possible in telerik wpf RadGridView ?                        version 2012, Q2

Exclude the wrapper based or ViewModel based solutions, those are not possible.
Thanks and regards
Syed Saqib Ali
Top achievements
Rank 1
 answered on 27 Feb 2013
4 answers
120 views
Hi

Very odd situation. I have a simple line chart (see code below) which has e.g. 100 data points. I'm using XValue on the X axis and doing ranging myself (AutoRange=false). The X values are integers but I manually override the string values for the TickPoints' Label with the actual strings I need to display for each (in general the strings cannot be determined using a format pattern). In the chart's SizeChanged event I recalculate the Step/LabelStep/MinorTickPointMultiplier etc. values each time so that things are spaced nicely (only the Step part of the calculation is shown below).

Now, if there aren't too many data points then it works perfectly and the Label string values are always shown. 

But once I exceed say 70 data points, then as I resize the form slowly (to check that it's Step calculations look OK all the way) sometimes the Label values are shown (attached image 1) and sometimes the underlying TickPoint.Value number is shown instead (image 2). It seems at some specific points it flips from the one to the other (repeatably). I checked via a breakpoint and the Labels are always getting set. It is, as if the Tick Points are being reset again afterwards.

I just cannot figure out what else is happening behind the scenes....

Here's a small example that demonstrates (just create a WPF form with a chart and attach chart's SizeChanged event)

        private void SetupChart()
        {
            // some data to visualise...
            // NB: need a reasonable number of points, doesn't exhibit at low numbers
            var data = new DataTable();
            data.Columns.Add("x", typeof(int));
            data.Columns.Add("y", typeof(double));
            var date = new DateTime(2012, 1, 1);
            var rnd = new Random();
            for (var i = 0; i < 100; i++)
            {
                var row = data.NewRow();
                row["x"] = date.Year * 12 + date.Month - 1;     // integer value calc'd so that 1st of month is evenly spaced (see UpdateLabels() below)
                row["y"] = 50 + rnd.NextDouble() * 10;
                data.Rows.Add(row);
                date = date.AddMonths(1);
            }
 
            // just set up a basic line chart for testing purposes...          
            chart.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Collapsed;
            chart.DefaultView.ChartArea.EnableAnimations = false;
            chart.DefaultView.ChartArea.AxisY.StripLinesVisibility = System.Windows.Visibility.Collapsed;
            chart.DefaultView.ChartArea.AxisX = new AxisX();
            chart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;
            chart.DefaultView.ChartArea.AxisX.StripLinesVisibility = System.Windows.Visibility.Collapsed;
            chart.DefaultView.ChartArea.AxisX.AutoRange = false;
            chart.DefaultView.ChartArea.AxisX.MinValue = data.Rows.Cast<DataRow>().Min(r => (int)r["x"]);
            chart.DefaultView.ChartArea.AxisX.MaxValue = data.Rows.Cast<DataRow>().Max(r => (int)r["x"]);
            var mapping = new SeriesMapping();
            mapping.ItemsSource = data;
            mapping.ItemMappings.Add(new ItemMapping("x", DataPointMember.XValue) { FieldType = data.Columns["x"].DataType });
            mapping.ItemMappings.Add(new ItemMapping("y", DataPointMember.YValue) { FieldType = data.Columns["y"].DataType });
            mapping.SeriesDefinition = new LineSeriesDefinition();
            chart.SeriesMappings.Add(mapping);
 
            // to force initial ranging calc to occur...
            chart_SizeChanged(null, null);
        }
 
 
 
        /// <summary>
        /// Event handler
        /// </summary>
        private void chart_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (e == null || e.WidthChanged)
            {
                RecalcRange();
                UpdateLabels();
            }
        }
 
 
 
        /// <summary>
        /// Event handler
        /// </summary>
        private void updateLabelsButton_Click(object sender, RoutedEventArgs e)
        {
            // manual force recalculate of the labels
            UpdateLabels();
        }
 
 
 
 
        private void RecalcRange()
        {
#if true
            // pick a reasonable step value...
            var width = chart.DefaultView.ChartArea.ActualWidth;
            var range = chart.DefaultView.ChartArea.AxisX.MaxValue - chart.DefaultView.ChartArea.AxisX.MinValue;
            var step = Math.Max(1, (int)Math.Ceiling(range * chart.DefaultView.ChartArea.AxisX.TicksDistance / width));
            chart.DefaultView.ChartArea.AxisX.Step = step;
#else
            // it happens for certain constants, such as 8 (but not for 9 etc)...
            chart.DefaultView.ChartArea.AxisX.Step = 8;
#endif
        }
 
 
 
        private void UpdateLabels()
        {
            foreach (var tickPoint in chart.DefaultView.ChartArea.AxisX.TickPoints)
            {
                // Reconstitutes the date string for the label from the integer value in x column..
                var dt = new DateTime((int)tickPoint.Value / 12, ((int)tickPoint.Value % 12) + 1, 1);
                tickPoint.Label = dt.ToString("MMM-yy");
            }
        }
Petar Kirov
Telerik team
 answered on 27 Feb 2013
8 answers
171 views
Is it possible to show DataAnnotation validation error on property not shown on the GridView? Maybe at the row level.  I want to show that the selected item cannot be deleted.
Alex Martin
Top achievements
Rank 1
 answered on 27 Feb 2013
1 answer
96 views
I like the sample Menu Customization in with reference WPF Demo however the sample focus only on the display. How would I got about adding Command binding to this sample?  

If I add a Command property of type ICommand to your MenuItemViewModel and can't bind to the newly added property since the MenuItemViewModel is not a Dependency object.  

Any suggestion?
Rosen Vladimirov
Telerik team
 answered on 27 Feb 2013
4 answers
327 views
WPF - V2012.3.1224.40 - VS2010

Hello,

I have programmatically added one table in another:

Table l_Table = new Table();
l_Table.LayoutMode = TableLayoutMode.AutoFit;
ownerSection.Blocks.Add(l_Table);
 
foreach (IFeatureViewModel l_Node in treeViewModel.Nodes)
{
    TableRow l_Row = new TableRow(); l_Table.Rows.Add(l_Row);
 
    Table l_InnerTable = new Table();
    l_InnerTable.LayoutMode = TableLayoutMode.AutoFit;
 
    TableCell l_InnerCell = new TableCell(); l_Row.Cells.Add(l_InnerCell);
    l_InnerCell.Borders = new TableCellBorders(0.5f, BorderStyle.Single, System.Windows.Media.Colors.Red);
    l_InnerCell.Blocks.Add(l_InnerTable);
 
    TableRow l_InnerRow = new TableRow(); l_InnerTable.Rows.Add(l_InnerRow);
 
    ....

The outer table cells have red borders and inner table cells have gray borders (see attached image).

After the inner table there is a vertical space.
How to remove this space ?

Thanks
Stephane

Stéphane
Top achievements
Rank 1
Iron
 answered on 27 Feb 2013
3 answers
65 views
I've noticed that the SDKSamples directory is no longer in the WPF source code drop as of the 2013 Q1 release.  Has that been moved to a separate download?  For some reason, I'm not seeing it anywhere..

Thanks, Dan
Vlad
Telerik team
 answered on 27 Feb 2013
9 answers
234 views

I created custom RadDataFilter , which contains dropdown list. DropDown List is OK. Now here is new requirement, I want to add telerik DateTimePicker.  DateTimePicker Bind successfully, problem is that I can’t get selected date value. Therefore FilterDesripter.value is not set.

For Combobox here is template

<DataTemplate x:Key="ComboBoxEditor">

            <telerik:RadComboBox  SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}"    MinWidth="100" />

        </DataTemplate>

 

But how I’ll set selectedDate Value, here is my Code.

 <DataTemplate x:Key="DateTimeEditor">

      < telerik:DatePicker MinWidth="100" SelectedDate="{Binding Value}"></my:DatePicker>

 </DataTemplate>

Rossen Hristov
Telerik team
 answered on 27 Feb 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
Security
VirtualKeyboard
HighlightTextBlock
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?