Telerik Forums
UI for WPF Forum
2 answers
548 views
Hi,

We display a context menu when the user right clicks a location within the RadDiagram.  How would we get the position in the diagram where the user clicked?  
This doesn't appear to be as simple as getting the MousePosition of the menu (or combining it with PointFromScreen) as we need to take account of Pan / Zoom / Scrolling.
Gary
Top achievements
Rank 1
 answered on 10 Oct 2013
1 answer
137 views
Hi,
How can I put a link inside slots and display data on a pop up gridview when click. The info for the slot will get populated from db, including its color (Category) , Not sure how to change or assign a color from code behind. The color is coming from db as arg, The user preselect the message to display and the color category at othe window.....

The use of the link and grid inside a slot is to display data related to the message displayed.

Thanks in advance!


CB
Kalin
Telerik team
 answered on 10 Oct 2013
3 answers
148 views
I am trying to save a Word document that has merge fields, but do not want the merging done. It appears that the merging is done before the document is saved so that that when it is reopened, cannot then perform the merge. Am I doing something wrong?
Petya
Telerik team
 answered on 10 Oct 2013
7 answers
1.1K+ views
Hi Guys,
I'm using RadAutocompleteBox from RadControls for WPF Q3 2012 in an MVVM Application.
Here is sample code:
<Controls:AutoCompleteBox
                                WatermarkContent="Select a location..."
                                DisplayMemberPath="Name"
                                TextSearchPath="Name"
                                SelectedItem="{Binding ImpactedLocation, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                ItemsSource="{Binding AvailableImpactedLocations}"
                                IsEnabled="{Binding IsOpened}"
                                MaxDropDownHeight="400"
                                DropDownWidth="400"
                                />
The SelectedItem is bound to an MVVM ViewModel.
My problem is when I want to clear the text displayed in the autocomplete's textbox by setting the ViewModel.ImpactedLocation = null;
 the selectedItem is cleared, but the text displayed is still here.

How can I clear it please? Something's to do with the SearchText? (try to clear it too, but still not working)
Thank's for your help.
Kind regards,
JC



Georgi
Telerik team
 answered on 10 Oct 2013
1 answer
111 views
LinearScale.CustomItems spanning range

Is it possible to have a custom item inside a linear scale span a certain range of values?
When you use the attached property ScaleObject.Value, it centers the item at the specified value. However, I would like to have the left end of the item (e.g. an rectangle or border) at one value and the right end at another.

Thank you.
Andrey
Telerik team
 answered on 10 Oct 2013
1 answer
133 views
Is it possible to have a custom item inside a linear scale span a certain range of values?

When you use the attached property ScaleObject.Value, it centers the item at the specified value. However, I would like to have the left end of the item (e.g. an rectangle or border) at one value and the right end at another.

Thank you.
Andrey
Telerik team
 answered on 10 Oct 2013
0 answers
181 views
Hi I'm using 2013.2.

Currently I'm using 2 RadGridView:
1st MainGridView and 2nd SelectedGridView.

The 1st is the main UI control, and 2nd is just for getting the AggregationResults of the selected rows in the 1st RadGridView.
So basically the 2nd is not on the UI.

I am trying to make the 2nd grid has the same columns with AggregationFunctions as the 1st grid has.
So I hope to have an easy way of Cloning the column dependency object instance from the 1st grid and add them into the 2nd grid, hence, I could easily get the AggregationResults of the selected rows of the 1st grid.

Thanks
ttest
Top achievements
Rank 1
 asked on 10 Oct 2013
2 answers
599 views
Hi, 

I am trying to configure the legend items shown in a RadLegend control associated to a RadPieChart.

This is how I load the data:

<Window
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfApplication1.MainWindow"
        Title="MainWindow" Height="594.024" Width="902.888">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
         
        <telerik:RadPieChart Name="PieChartDemo" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="543" Width="428"/>
 
        <telerik:RadLegend x:Name="PieLegend"
                                   Grid.Column="1" Items="{Binding LegendItems, ElementName=PieChartDemo}"/>
         
    </Grid>
</Window>

public MainWindow()
        {
            InitializeComponent();
            FillPieChart();
        }
 
        void FillPieChart()
        {
            DataTable dtData = new DataTable("DATA");
 
            dtData.Columns.Add(new DataColumn("Name", typeof(string)));
            dtData.Columns.Add(new DataColumn("Value", typeof(double)));
 
            dtData.Rows.Add(new object[] { "Scrap", 5429287.5 });
            dtData.Rows.Add(new object[] { "KWH", 713631 });
            dtData.Rows.Add(new object[] { "Electrode", 327349 });
            dtData.Rows.Add(new object[] { "Alloys", 2372722.3 });
            dtData.Rows.Add(new object[] { "Fluxes", 317157.65 });
            dtData.Rows.Add(new object[] { "Labor", 300084.1 });
 
            PieChartDemo.Palette = ChartPalettes.Arctic;
 
            PieSeries pieSer = new PieSeries();
            pieSer.ShowLabels = true;
 
            foreach (DataRow drCost in dtData.Rows)
            {
                pieSer.DataPoints.Add(new PieDataPoint()
                {
                    Value = double.Parse(drCost["Value"].ToString()),
                    Label = string.Format("{0}\n{1:N} K", drCost["Name"].ToString(), double.Parse(drCost["Value"].ToString()) / 1000.00)
                }
                                    );
            }
 
            pieSer.LabelDefinitions.Add(new ChartSeriesLabelDefinition() { Margin = new Thickness(-5, 0, 0, 0) });
            pieSer.AngleRange = new AngleRange(270, 360);
 
            pieSer.LegendSettings = new DataPointLegendSettings();
 
            PieChartDemo.Series.Clear();
            PieChartDemo.Series.Add(pieSer);
        }


I am creating a PieSeries and adding some PieDataPoint. For each data point I add the value and the label, and I think the RadLegend takes this label to show its items. Am I correct?

In the beginning I wasn't using the RadLegend so I was showing the name and the value in the chart, assigning both values to Label:

pieSer.DataPoints.Add(new PieDataPoint()
               {
                   Value = double.Parse(drCost["Value"].ToString()),
                   Label = string.Format("{0}\n{1:N} K", drCost["Name"].ToString(), double.Parse(drCost["Value"].ToString()) / 1000.00)
               }

And then I added the RadLegend Control and it shows the same values.

How can I configure the RadLegend control to show only the names if I change the Label shown in the RadPieChart to show only the values?




Alberto
Top achievements
Rank 1
 answered on 09 Oct 2013
1 answer
373 views
I have followed the example below and scoured the internet for 2 days trying to get my combobox to work correctly, and I still cannot get it to select the correct item when the form opens. http://www.telerik.com/help/silverlight/raddatafor-edit-lookup-values-with-radcombobox.html

I have two classes (generated by the Openaccess ORM), one of which contains information about musicians (name, id, genre etc) and a second class that contains information about the type of musician (band, festival, performing arts etc). I have successfully added a couple of simple textbox controls to the form that display the artist name and some other basic information, and now I am trying to pick the artist type from a combo box.

I can successfully populate the combobox from the ORM model "ArtistType" class,  but no matter what I do it always opens either with the first item selected (regardless of the actual underlying value) or nothing selected at all. If I break the code in the combobox_Loaded event, I can see the values, but they are never reflected in the combobox.

How can I databind a simple numeric value in a primary table to a list of items in a second table to be displayed as a picklist in a combox?
Dan
Top achievements
Rank 1
 answered on 09 Oct 2013
2 answers
247 views
Some people on here are probably familiar with this blog entry about Merging Telerik's Assemblies into an WPF executable. We actually decided to take a completely different spin and wanted to just merge the Telerik assemblies only leaving all our others untouched (our program as a plug-gable module architecture so we can't merge ALL assemblies). I'm not sure if any one else would be interested in this but I wanted to post it anyway just to get it out there that it is possible. 

MSBuild AfterResolveReferences:
<Target Name="AfterResolveReferences">
  <ItemGroup>
    <EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(%(ReferenceCopyLocalPaths.Filename), 'Telerik')) And '%(ReferenceCopyLocalPaths.Extension)' == '.dll'">
      <LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>
    </EmbeddedResource>
  </ItemGroup>
</Target>

Program.cs:
namespace WpfApplication1
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;
 
    public class Program
    {
        [STAThreadAttribute]
        public static void Main()
        {
            var assemblies = new Dictionary<string, Assembly>();
            var executingAssembly = Assembly.GetExecutingAssembly();
            var resources = executingAssembly.GetManifestResourceNames().Where(n => n.StartsWith("Telerik")).Where(n => n.EndsWith(".dll"));
 
            foreach (string resource in resources)
            {
                using (var stream = executingAssembly.GetManifestResourceStream(resource))
                {
                    if (stream == null)
                        continue;
 
                    var bytes = new byte[stream.Length];
                    stream.Read(bytes, 0, bytes.Length);
                    try
                    {
                        assemblies.Add(resource, Assembly.Load(bytes));
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.Print(string.Format("Failed to load: {0}, Exception: {1}", resource, ex.Message));
                    }
                }
            }
 
            AppDomain.CurrentDomain.AssemblyResolve += (s, e) =>
            {
                var assemblyName = new AssemblyName(e.Name);
 
                var path = string.Format("{0}.dll", assemblyName.Name);
 
                if (assemblies.ContainsKey(path))
                {
                    return assemblies[path];
                }
 
                return null;
            };
 
            App.Main();
        }
    }
}

We also did an additional spin with a PostBuildEvent of deleting the Telerik files after the build.

PostBuildEvent:
  <PropertyGroup>
    <PostBuildEvent>del /F /Q "$(TargetDir)Telerik*"
rmdir /S /Q "$(TargetDir)de"
rmdir /S /Q "$(TargetDir)es"
rmdir /S /Q "$(TargetDir)fr"
rmdir /S /Q "$(TargetDir)it"
rmdir /S /Q "$(TargetDir)nl"
rmdir /S /Q "$(TargetDir)tr"</PostBuildEvent>
  </PropertyGroup>

I hope someone else finds this useful as we did.
Alan
Top achievements
Rank 1
 answered on 09 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?