Telerik Forums
UI for WPF Forum
1 answer
144 views
Hi,
I am using the GridView control, and have all my columns and rows generated on the fly, so nothing is known until runtime. By using Row and Column virtualization, I'm able to speed up the load time quite a bit. There's really only 1 problem left I'm seeing. With row virtualization, as you scroll down, it waits until you stop, then loads the appropriate rows. However with column virtualization, it scrolls over and loads the columns as you're scrolling, so you then end up having to let go of the scrollbar, and grab it again to continue scrolling, as more columns are loaded. Can we get the column loading to work similarly to the row loading, and not have them load one by one and causing the scrollbar to act jumpy?

Thanks,
Ryan
Nedyalko Nikolov
Telerik team
 answered on 11 Apr 2013
2 answers
113 views
I am getting an InvalidCastException when there are 2 different classes at the same level of the tree hierarchy. For example, I have an MvDirectory class and an MvFile class. They both implement an int property called Size. They also share a common interface that implements Size. If I have a level of the hierarchy that consists of only MvDirectory instances, the filtering works fine. As soon as I add an instance of MvFile to the same level, I get an exception saying that MvFile cannot be cast to MvDirectory. I'm not sure why it is assuming all nodes at the same level are of the same type. Is there some way of getting it to use the shared interface or am I going to have to populate my tree with instances of the same class? Or am I just missing something?

Thanks,
Joe
Joe
Top achievements
Rank 2
 answered on 11 Apr 2013
1 answer
117 views
Hi there,

I have a connection to a MySQL-database and created my classes via EntityFrameWork.
I bound my GrdiView to one of the tables.

If I add a new object to the table, my GridView is not updated, until I reorder the items.
How can I update my GridView without using codebehind, because I am using MVVM for this project.

Best Regards
Manfred
Pavel Pavlov
Telerik team
 answered on 11 Apr 2013
4 answers
434 views
Hi, I'm coding UI tests and the most common task is to navigate to controls situated in different tabs using automation. The problem is I can't get the content of tabs except the tab selected by default. That is, I change between different tab pages and only the first one's automation tree is visible. The code is something like that below. The default WPF tab control works fine: I can get the content of currently selected tab. So how can this problem be solved? Thanks in advance.

[TestMethod]
public void TestMethod()
{
    // find app window
    var cond = new PropertyCondition(AutomationElement.NameProperty, "MainWindow");
    AutomationElement foundWindow = AutomationElement.RootElement.FindFirst(TreeScope.Children, cond);
 
    // find tab control
    cond = new PropertyCondition(AutomationElement.ControlTypeProperty, System.Windows.Automation.ControlType.Tab);
    AutomationElement foundTab = foundWindow.FindFirst(TreeScope.Subtree, cond);
 
    var tabCtl = (WpfTabList)UITestControlFactory.FromNativeElement(foundTab, "UIA");
 
    foreach (var tab in tabCtl.Tabs)
    {
        var elements = "";
        Mouse.Click(tab);
 
        // do something to controls,
        // for example collect their names
        foreach (var el in Walk(tab.NativeElement as AutomationElement))
        {
            elements += string.Format("Name: '{0}', Type: '{1}'\n", el.Current.Name, el.Current.ControlType.ProgrammaticName);
        }
        MessageBox.Show(elements);
    }
}
 
// Recursively walk an automation tree
private List<AutomationElement> Walk(AutomationElement current)
{
    var res = new List<AutomationElement>();
    if (current != null)
    {
        res.Add(current);
        res.AddRange(Walk(TreeWalker.RawViewWalker.GetFirstChild(current)));
        res.AddRange(Walk(TreeWalker.RawViewWalker.GetNextSibling(current)));
    }
    return res;
}
Tina Stancheva
Telerik team
 answered on 11 Apr 2013
1 answer
370 views
When hovering property grid items, the background changes to whatever the theme uses as background. I believe this is caused by the MouseOver stuff in PropertyGridFieldTemplate:

<Rectangle x:Name="Background_Over"  Grid.ColumnSpan="2"  Fill="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}" Opacity="0.05" HorizontalAlignment="Stretch" Visibility="{Binding IsMouseOver, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Stretch"/>

Is it possible to change this style for my property grid? Our application allows for switching between themes, so it makes sense to base the styles on the current style of the desired type (i.e. BasedOn). Not sure if this is possible if we need to change the entire style.

So, two questions:
1) How do we change the hovering color? (I.e. on mouse over, we want to use the background color of the property grid. Maybe darkening it a bit.)
2) How do we remove the gray area to the left?
Kristoffer
Top achievements
Rank 1
 answered on 11 Apr 2013
3 answers
150 views
I have trouble with some of my map elements, for example MapLine.

When I use this syntax the MapLine is displayed in red and shows a tooltip when mouse is over.

<tel:MapLine
  StrokeThickness="5"
  Stroke="Red"
  Point1="{Binding MyViewModel.Point1}"
  Point2="{Binding MyViewModel.Point2}"
  ToolTip="{Binding MyViewModel.ItemName}" />


When I use this syntax the MapLine is not displayed and there is no tooltip.

<tel:MapLine
  StrokeThickness="5"
  Point1="{Binding MyViewModel.Point1}"
  Point2="{Binding MyViewModel.Point2}">
  <tel:MapLine.Stroke>
    <SolidColorBrush Color="Red" />
  </tel:MapLine.Stroke>
  <tel:MapLine.ToolTip>
    <TextBlock Text="{Binding MyViewModel.ItemName}" />
  </tel:MapLine.ToolTip>
</tel:MapLine>
Andrey
Telerik team
 answered on 11 Apr 2013
1 answer
160 views
When I use binding to set the Location of a MapShape I always get an Error. What am I doing wrong?

<tel:MapRectangle Location="{Binding Location}" />

Exception:
A 'Binding' cannot be set on the 'Location' property of type 'MapRectangle'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
Andrey
Telerik team
 answered on 11 Apr 2013
1 answer
241 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
184 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
143 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
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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?