Telerik Forums
UI for WPF Forum
11 answers
117 views
Hello

When I expand a row for its rowdetails by clicking the plus-sign in the GridViewToggleRowDetailsColumn the row is expanded but it does not seem to be "officially" selected. The fonts don't get fat for example. Now when I enter into a textbox with my mouse and then press TAB-Key I get an Exception. If I first click on the row and then expand it with the plus-sign I don't have this error. Any suggestions?

Here the Stacktrace:
 System.NullReferenceException  
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.Move(FocusNavigationDirection navigationDirection) 
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.ExecuteMoveCommands(FocusNavigationDirection direction) 
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.MoveNext() 
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.OnMoveNextCommand(Object sender, ExecutedRoutedEventArgs e) 
   bei System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e) 

Oh and in the case that the exception does not occur, Tab still doesn't really work - it jumps to the next row instead of jumping to the next TextBox in rowdetails. I already played around with the TabIndex property but didn't find anything. Any idea for that too?

Thanks
Dimitrina
Telerik team
 answered on 12 Apr 2013
0 answers
157 views
Hi, thanks ins advance for reading this

I've been able to reproduce the Drag&Drop and Grouping examples separately. No luck making them work together.

My 2 collections and filling the source list.
Property ProductosTotal As New CollectionViewSource
Property ProductosPedido As New ObservableCollection(Of Productos)
 
'Called when initializing view
Private Sub LoadProductosTotal()
        Dim prods = operacionesProductos.GetAllProductos()
        If prods IsNot Nothing Then
            ProductosTotal = New CollectionViewSource
            ProductosTotal.Source = prods
        End If
    End Sub

On the Xaml side:
<!--Style-->
<Style x:Key="DraggableListBoxItem" TargetType="telerik:RadListBoxItem">
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
        </Style>
 
<!--SOURCE RADLISTBOX-->
<telerik:RadListBox Grid.Column="0" ItemContainerStyle="{StaticResource DraggableListBoxItem}"
                            ItemsSource="{Binding ProductosTotal.View}" ItemTemplate="{StaticResource ListBoxItemTemplate}">
                            <telerik:RadListBox.GroupStyle >
                                <GroupStyle>
                                    <GroupStyle.HeaderTemplate>
                                        <DataTemplate>
                                            <StackPanel Height="Auto" Background="{telerik:Windows8Resource ResourceKey=AccentBrush}" Margin="0 5 0 5">
                                                <TextBlock Text="{Binding Name}" FontFamily="Segoe UI Light" FontWeight="Bold" FontSize="16"
                                           Margin="10 3 0 0" Foreground="{telerik:Windows8Resource ResourceKey=MainBrush}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </GroupStyle.HeaderTemplate>
                                </GroupStyle>
                            </telerik:RadListBox.GroupStyle>
 
                            <telerik:RadListBox.DragDropBehavior>
                                <Behaviors:ListBoxDragDropBehaviorCopy />
                            </telerik:RadListBox.DragDropBehavior>
                            <telerik:RadListBox.DragVisualProvider>
                                <telerik:ScreenshotDragVisualProvider />
                            </telerik:RadListBox.DragVisualProvider>
                        </telerik:RadListBox>
 
<!--DESTINATION RADLISTBOX-->
 <telerik:RadListBox  Grid.Row="1" ItemsSource="{Binding ProductosPedido}" AllowDrop="True"
                            ItemTemplate="{StaticResource ListBoxItemTemplate}">
                        <telerik:RadListBox.DragDropBehavior >
                            <telerik:ListBoxDragDropBehavior />
                        </telerik:RadListBox.DragDropBehavior>
                    </telerik:RadListBox>

Notice the ListBoxDragDropBehaviorCopy I inherited the ListBoxDragDropBehavior to supress the remove operation because it threw an exception.

I need to copy from the source list, not move, I've tried the DragDropManager but I cant understand completely the documentation.
Could someone point me in the right direction, i feel like is something small what im missing

Thanks again

Vedha
Top achievements
Rank 1
 asked on 12 Apr 2013
0 answers
68 views
Hi,

I have 2 controls: TreeView and TreeListView .
Both controls have same ItemsSource business object (ObservableCollection<TDG_DataTable>).

TreeView  displays all items everytime.
TDG_DataTable has Boolean member "Included".
Depends on Included value, TDG_DataTable item should be visible/hidden in TreeListView

So both controls should have same source.
How I can achieve this.

Many thanks.
Dejan
Dejan Jovanov
Top achievements
Rank 1
 asked on 11 Apr 2013
1 answer
141 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
102 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
103 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
419 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
336 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
136 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
150 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
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?