Telerik Forums
UI for WPF Forum
1 answer
215 views
Hi

I have one question. How can I highlight an item from ViewModel? I have simple MVVM scenario:

public class FooViewModel : ViewModelBase
    {
        private ObservableCollection<Foo> _fooCollection;
        private Foo _selectedFoo;
        private ICommand _addCommand;
 
        public ObservableCollection<Foo> FooCollection
        {
            get { return _fooCollection; }
            set
            {
                _fooCollection = value;
                OnPropertyChanged("FooCollection");
            }
        }
 
        public Foo SelectedFoo
        {
            get { return _selectedFoo; }
            set
            {
                _selectedFoo = value;
                OnPropertyChanged("SelectedFoo");
            }
        }
 
        public ICommand AddCommand
        {
            get { return _addCommand ?? (_addCommand = new RelayCommand(i=>this.AddCommandMethod())); }
        }
 
        private void AddCommandMethod()
        {
            //Add item to collection
            //Add item to SelectedFoo
        }

In View I bind ItemSource to FooCollection, I am binding the SelectedItem of the RadListBox to SelectedFoo from VM and I have two TextBlocks to display the SelectedFoo. I have one button to Add a new Item to the Collection and setting the SelectedFoo to this new Item from Collection. Everything is fine, the two textblocks shows correct data, but the RadListBox is not highlighting the new Item Added to the collection. The collection rebinds fine because I can see the added item in list, but it is not highlighted. 

Am I doing something wrong?? I tried to set the SelectedValue, SelectedValuePath, SelectedItem. I have google it a lot but no luck.

Thanks Vitalij
Vitalij
Top achievements
Rank 1
 answered on 11 Apr 2013
2 answers
172 views
I am using 2 listboxes with drag and drop enabled, 1 being the "source" and one being the "destination".
I need to manipulate the items in the "destination" RadListBox when a user drops an item from the "source" listbox; after a certain validation.

I wired the "PreviewDrop" event; but fail to see how I can get the datacontext of the element that is being dropped by the user.
(I worked through the properties of the DragEventArgs parameter; but couldn't find the datacontext of the item that is being dropped)

Does anyone know how to determine which item the user is dropping on my "destination" RadListBox ?

Luc Cappaert
Top achievements
Rank 2
 answered on 11 Apr 2013
1 answer
132 views
I'm trying to use LabelFormat in DateTimeCategoricalAxis but an exception occurs when i use H format string. =>it's work with HH for example
I want to use h (just hour with one digit for 1,2,3...), ddd, d (just day for 1,2,3...) and MMM in final testing

Xaml View :
<telerik:RadCartesianChart>
 
           <telerik:RadCartesianChart.HorizontalAxis>
               <telerik:DateTimeCategoricalAxis LabelFitMode="None"
                                                LabelFormat="H"
                                                DateTimeComponent="Hour" />
           </telerik:RadCartesianChart.HorizontalAxis>
 
           <telerik:RadCartesianChart.VerticalAxis>
               <telerik:LinearAxis />
           </telerik:RadCartesianChart.VerticalAxis>
 
           <telerik:LineSeries ItemsSource="{Binding}"
                               CategoryBinding="XValue"
                               ValueBinding="YValue"/>
 
       </telerik:RadCartesianChart>

Data object :
public class ChartData
   {
       public DateTime XValue
       {
           get;
           set;
       }
 
       public Double YValue
       {
           get;
           set;
       }
   }

Code for initialize data :
List<ChartData> datas = new List<ChartData>();
 
           for (int i = 0; i < 23; i++)
           {
               datas.Add(new ChartData
                   {
                       XValue = DateTime.Today.AddHours(i),
                       YValue = i
                   });
           }
 
           DataContext = datas;






LOUGE
Top achievements
Rank 1
 answered on 11 Apr 2013
5 answers
112 views
Hi again. I have the following problem: If in the page's Loaded event I set the focus on one of my RadComboBoxes, even though it becomes the active control and I can browse through the elemnts with the Up and Down keys, it doesn't change the way it looks, so there's no way for the user to know that the control is active.

Now if I, at runtime, use the Tab key to select it, then I get the different style. Is there anything besides (or instead of) the call to the Focus method on the page's Loaded event I should do to get the control to appear different when it's focused?

PS: I'm not setting any specific style to the control, I'm just using whatever default behaviour it's got (usually, an orange border around it shows that it's the active control).

Thanks a lot. You continuous help is very appreciated.
Yana
Telerik team
 answered on 11 Apr 2013
6 answers
194 views
Hi!
I have a simple task to be done! I have to display a chart using <RadChart> (like one in attachment). It is a simple horizontal bar (I guess with two series STOPPED, ACTIVE). 

The chart should display time o X axis and tho series of graph (red for STOPPED, green for ACTIVE). Assumig I can use the DLYChartPoint structure. Or not?!

I have problems displaying the data, so a little help would be appreciate.

Thanks in advice!

My code:
C#:
public class DLYChartPoint : LPDEntityStatus
	{
		#region Private
		string label;
		double value;
	        long uniqueId;
 
		#endregion

	// other class structures
}

------------------------------------------------------------------------------------------
public ObservableCollection<DLYChartPoint> TimeLineChart


WPF:
<telerik:RadChart x:Name="timeLineChart" ItemsSource="{Binding TimeLineChart, Mode=TwoWay}">
    <telerik:RadChart.DefaultView>
        <telerik:ChartDefaultView>
            <telerik:ChartDefaultView.ChartLegend>
                <telerik:ChartLegend Visibility="Collapsed" />
            </telerik:ChartDefaultView.ChartLegend>
        </telerik:ChartDefaultView>
    </telerik:RadChart.DefaultView>
    <telerik:RadChart.SeriesMappings>
		<telerik:SeriesMapping>
			<telerik:SeriesMapping.SeriesDefinition>
                <telerik:HorizontalStackedBarSeriesDefinition ></telerik:HorizontalStackedBarSeriesDefinition>
			</telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.ItemMappings>
                <telerik:ItemMapping DataPointMember="Label" FieldName="Value"></telerik:ItemMapping>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="Value"></telerik:ItemMapping>
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="Label"/>
            </telerik:SeriesMapping.ItemMappings>
		</telerik:SeriesMapping>
	</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
Luka
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
113 views
After upgrading to Q1 2013 SP1 (2013.1.403.40) my RadButtons inside the RadToolBar became huge and I cannot control their size with Height and Width properties. Please take a look at the attached before and after screen shots.

Here is my XAML:

<t:RadToolBar DockPanel.Dock="Top" Margin="0" Width="{Binding ElementName=DockPanelMain, Path=ActualWidth}" 
  IsTabStop="False" GripVisibility="Collapsed" OverflowButtonVisibility="Collapsed">
  <t:RadButton>
    <Image Stretch="None" Source="Images/Image32.png" />
  </t:RadButton>
...
</t:RadToolBar>

I tried removing Width="{Binding ElementName=DockPanelMain, Path=ActualWidth}" but that didn't help. I also tried adding Width="36" Height="36" to RadButton and  Width="32" Height="32" to the Image but that did not help either...

What do I need to do to get my buttons to normal size again?

Thanks...
Dean
Top achievements
Rank 1
 answered on 10 Apr 2013
0 answers
128 views
Is there a way to create a border between only certain columns without using a template for the cells?

I have a GridView in which we want to place a vertical border on some columns.  I can do this by adding a border to the cell template, but this seems to slow down the grid significant.  I do not know why it becomes slower but once I put in a template it gets slow so I wonder if it is possible to add a border without using a template or some other way.
Douglas
Top achievements
Rank 1
 asked on 10 Apr 2013
1 answer
60 views
I need to build a chart that shows only a specific value and tick on Y-axis. 

E.g. I want to show only the Y corresponding to the plt point in the image at the link below. I don't want to show ther others Y values at Y-axis.
Chart example

Does anybody know if it's possible??
Does anybody know how to do that?

Thx in advance!
Petar Kirov
Telerik team
 answered on 10 Apr 2013
1 answer
182 views
Hi Telerik team,
 
Please help me on one issue with Telerik Controls.

When I create a simple Rad Gauge control  in my project  I get a namespace error. The project is done in Visual studio 2008. I dont have much idea about rad Gauge creation. Please explain about this error and how to solve this.
 
The error is "The tag 'RadRadialGauge' does not exist in XML namespace 'http://schemas.telerik.com/2008/xaml/presentation'."
 
 
I mention below  the code that  implemented in the project for the control creation.
----------------------------------------------------------------------------------------------------------
<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
       <telerik:RadRadialGauge x:Name="radialGauge" Width="300" Height="300">
    <telerik:RadialScale Min="1"
                         Max="12">
        <telerik:RadialScale.Indicators>
            <telerik:Needle />
            <telerik:Pinpoint/>
        </telerik:RadialScale.Indicators>
    </telerik:RadialScale>
</telerik:RadRadialGauge>
    </Grid>
</Window>
------------------------------------------------------------------------------------------------------------
Andrey
Telerik team
 answered on 10 Apr 2013
1 answer
72 views
Hi, using latest WPF controls (2013.1.220.40), when I paste in an example directly from the examples demo (First look for the Docking panel), I get the following error:
Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.InternalWindow.PopupWindowHost.PopupHostManagerBase.GetManager(DependencyObject obj) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\PopupWindowHost.cs:line 308
   at Telerik.Windows.Controls.InternalWindow.SinglePopupWindowHost.GetHostManager() in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\SinglePopupWindowHost.cs:line 22
   at Telerik.Windows.Controls.InternalWindow.PopupWindowHost.Open(Boolean isModal) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\PopupWindowHost.cs:line 77
   at Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 891
   at Telerik.Windows.Controls.Docking.ToolWindow.Open() in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\ToolWindow.cs:line 121
   at Telerik.Windows.Controls.RadDocking.OpenInToolWindow(RadSplitContainer container) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 797
   at Telerik.Windows.Controls.RadDocking.InitializeSplitContainer(RadSplitContainer container) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 1325
   at Telerik.Windows.Controls.RadDocking.OnApplyTemplate() in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 180
   at System.Windows.FrameworkElement.ApplyTemplate()
   at Microsoft.Expression.Platform.WPF.WpfViewNodeManager.EnsureElementInDictionary(Object root, ViewNode knownAncestor)

If I change the Initial position of the control to DockLeft (or anything other than floating), the demo works. 

Is there a bug in the latest dlls ?

thanks!
Alek
Telerik team
 answered on 10 Apr 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?