Telerik Forums
UI for WPF Forum
3 answers
454 views
Hello

I am building a windows application using the MVVM pattern.

My scenario is as following:
I have a window with several viewmodels in it.

(VM1) Viewmodel containing a list of items displayed through it's view with the help of RadGridView. 

(VM2) Viewmodel with a search-like function, given a search criteria it sets the SelectedItem in VM1.

My first problem was that the selecteditem could be out of view. I made a mvvm-exception and added code behind and used ScrollIntoView to solve that problem (works like a charm).

private void SelectionChangedHandler(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)  
{  
   if (this.radGridView.SelectedItem != null)  
   {  
        this.radGridView.ScrollIntoView(radGridView.SelectedItem);  
   }  
My problem now is that when scrolling occurs, the RadGridView gains focus. Is there any way to prevent this?

Best regards and thanks.
Thomas
Hristo
Telerik team
 answered on 08 Feb 2010
1 answer
288 views
Hi,

In my gridviewcolumns I can set a sortmemberpath and a groupmemberpath, what I'm missing is something like a FilterMemberPath.
Is it possible to implement this? This would be very helpful in a lookup value scenario.

Best regards,
Thomas.
Rossen Hristov
Telerik team
 answered on 08 Feb 2010
1 answer
393 views
Is there a way to either set the header to be vertical or to style a column in XAML.  I have a old  vb6 Flexgrid control that I need to replicate and I can do all of it in vb.net code -- but I wanted to style it to be grey(ghostwhite) and set the width and if possible define the static parts all in XAML and then just update the data parts in code
Private Sub BuildGrid(ByRef g As Telerik.Windows.Controls.RadGridView, ByRef d As IBIDData.Client) 
        Dim dt As New DataTable(g.Name) 
        dt.Columns.Add(0) 
        dt.Columns.Add(1) 
        Select Case g.Name 
            Case "grd1" 
                '// This is done after the call - grd1.Columns(0).Width = 80 
                '//                               grd1.Columns(0).Background = System.Windows.Media.Brushes.GhostWhite 
                '//                               grd1.Columns(1).Width = 68 
                dt.Rows.Add(New Object() {"Author", d.FieldStr(0, "Author")}) 
                dt.Rows.Add(New Object() {"Vendor", d.FieldStr(0, "Vendor")}) 
                dt.Rows.Add(New Object() {"Dept", d.FieldStr(0, "DptCode")}) 
                dt.Rows.Add(New Object() {"Publisher", d.FieldStr(0, "Publisher")}) 
                dt.Rows.Add(New Object() {"Pub. Date", d.FieldStr(0, "PubDate")}) 
                dt.Rows.Add(New Object() {"Last Sold", d.FieldStr(0, "LastDateSold")}) 
                dt.Rows.Add(New Object() {"Last Recv", d.FieldStr(0, "LastInvoiceDate")}) 
            Case "grd2" 
                dt.Rows.Add(New Object() {"List", d.FieldStr(0, "ListPrice")}) 
                dt.Rows.Add(New Object() {"Binding", d.FieldStr(0, "BookType")}) 
                dt.Rows.Add(New Object() {"Category 1", d.FieldStr(0, "Cat1")}) 
                dt.Rows.Add(New Object() {"Category 2", d.FieldStr(0, "Cat2")}) 
                dt.Rows.Add(New Object() {"Misc. 1", d.FieldStr(0, "Misc1")}) 
                dt.Rows.Add(New Object() {"Misc. 2", d.FieldStr(0, "Misc2")}) 
                dt.Rows.Add(New Object() {""""}) 
            Case "grd3" 
                dt.Rows.Add(New Object() {"Cost", d.FieldStr(0, "CostPrice")}) 
                dt.Rows.Add(New Object() {"Sell", d.FieldStr(0, "SellPrice")}) 
                dt.Rows.Add(New Object() {"Net", d.FieldStr(0, "NetPrice")}) 
                dt.Rows.Add(New Object() {"Retd YTD", d.FieldStr(0, "YTDReturns")}) 
                dt.Rows.Add(New Object() {"Retd LYR", d.FieldStr(0, "PYRReturns")}) 
                dt.Rows.Add(New Object() {"All Retd", d.FieldStr(0, "AllReturns")}) 
                dt.Rows.Add(New Object() {"All Sales", d.FieldStr(0, "AllSales")}) 
            Case "grd4" 
                dt.Rows.Add(New Object() {"On Hand", d.FieldStr(0, "OnHand")}) 
                dt.Rows.Add(New Object() {"TBO", d.FieldStr(0, "")}) 'fnTBO 
                dt.Rows.Add(New Object() {"On Ord", d.FieldStr(0, "")}) 'fnORD 
                dt.Rows.Add(New Object() {"SPO", d.FieldStr(0, "")}) 'fnSPOSOLD 
                dt.Rows.Add(New Object() {"TBR", d.FieldStr(0, "")}) 'fnTBR 
                dt.Rows.Add(New Object() {"Minimum", d.FieldStr(0, "Minimum")}) 
                dt.Rows.Add(New Object() {"Reorder", d.FieldStr(0, "Reorder")}) 
 
        End Select 
        g.ItemsSource = dt 
    End Sub

<UserControl x:Class="InvGrid" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"   
    Height="Auto" Width="Auto" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    <UserControl.Resources> 
        <ResourceDictionary> 
            <Style TargetType="telerik:GridViewRow" x:Key="RowStyle"
                <Setter Property="MinHeight" Value="18"/> 
                <Setter Property="FontSize" Value="14"/> 
                <Setter Property="Foreground" Value="Black"/> 
            </Style> 
            <ResourceDictionary.MergedDictionaries> 
                <ResourceDictionary Source="Dictionary1.xaml"/> 
            </ResourceDictionary.MergedDictionaries> 
        </ResourceDictionary> 
    </UserControl.Resources> 
    <Grid x:Name="Container"
        <Grid Margin="0,0,0,0" Name="Grid1"
            <Grid.ColumnDefinitions> 
                <ColumnDefinition x:Name="Column1" MinWidth="200"    /> 
                <ColumnDefinition x:Name="Column2" MinWidth="200"  /> 
                <ColumnDefinition x:Name="Column3" MinWidth="200"  /> 
                <ColumnDefinition x:Name="Column4" MinWidth="200" /> 
                <ColumnDefinition x:Name="Column5" MinWidth="200"  /> 
            </Grid.ColumnDefinitions> 
            <telerik:RadGridView Name="grd1" RowStyle="{StaticResource RowStyle}" Background="White" RowIndicatorVisibility="Collapsed"  IsFilteringAllowed="False" Grid.Column="1" Height="198"  Width="200" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSelect="False" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserDeleteRows="False" ShowColumnHeaders="False" ShowGroupPanel="False" FontFamily="Microsoft San Serif" FontSize="13" IsTabStop="False" IsHitTestVisible="False" BorderThickness="1" ShowGroupFooters="False" ScrollMode="RealTime"  MinHeight="26" BorderBrush="Black" Foreground="Black" ClipToBounds="False" /> 
            <telerik:RadGridView Name="grd2" RowStyle="{StaticResource RowStyle}" Background="White" RowIndicatorVisibility="Collapsed"  IsFilteringAllowed="False" Grid.Column="2" Height="158"   Width="150" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSelect="False" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserDeleteRows="False" ShowColumnHeaders="False" ShowGroupPanel="False" FontFamily="Microsoft San Serif" FontSize="13" IsTabStop="False" IsHitTestVisible="False" BorderThickness="1" ShowGroupFooters="False" ScrollMode="RealTime"  MinHeight="26" BorderBrush="Black" /> 
            <telerik:RadGridView Name="grd3" RowStyle="{StaticResource RowStyle}" Background="White" RowIndicatorVisibility="Collapsed"  IsFilteringAllowed="False" Grid.Column="3" Height="198"   Width="150" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSelect="False" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserDeleteRows="False" ShowColumnHeaders="False" ShowGroupPanel="False" FontFamily="Microsoft San Serif" FontSize="13" IsTabStop="False" IsHitTestVisible="False" BorderThickness="1" ShowGroupFooters="False" ScrollMode="RealTime"  MinHeight="26" /> 
            <telerik:RadGridView Name="grd4" RowStyle="{StaticResource RowStyle}" Background="White" RowIndicatorVisibility="Collapsed"  IsFilteringAllowed="False" Grid.Column="4" Height="198"   Width="150" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSelect="False" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserDeleteRows="False" ShowColumnHeaders="False" ShowGroupPanel="False" FontFamily="Microsoft San Serif" FontSize="13" IsTabStop="False" IsHitTestVisible="False" BorderThickness="1" ShowGroupFooters="False" ScrollMode="RealTime"  MinHeight="26" /> 
        </Grid> 
    </Grid> 
</UserControl> 

Milan
Telerik team
 answered on 08 Feb 2010
2 answers
239 views

Hi,

I'd like to implement an MDI-like workspace in xbap application, is there any container for multiple RadWindows?

In my xbap application, I'd like the content-region would hold multiple RadWindows which can be dragged around, minimized, maximized, etc.

For dragging, I'd like it so that the windows themselves cannot be dragged outside of the mdi-window content region.

I'd appreciate any help/sample solution on how to implement this.

My xaml code is as follows:I have try to create MDI RadWindows in container1, but failed.

        <telerik:RadDocking Name="radDocking1" Grid.Column="1" Grid.Row="1" AllowUnsafeMode="True">  
            <telerik:RadDocking.DocumentHost> 
                <telerik:RadSplitContainer InitialPosition="DockedLeft" Name="container1" HorizontalContentAlignment="Left">  
                    <telerik:RadPaneGroup Name="editGroup">  
                    </telerik:RadPaneGroup> 
                </telerik:RadSplitContainer> 
            </telerik:RadDocking.DocumentHost> 
 
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="150,150" InitialPosition="DockedBottom" Height="250">  
                <telerik:RadPaneGroup Name="listGroup">  
                    <telerik:RadDocumentPane Title="Error Message" Name="errorMSGPane">  
                        <telerik:RadDocumentPane.Content> 
                            <TextBlock Name="tberrorMSG" Foreground="Red"</TextBlock> 
                        </telerik:RadDocumentPane.Content> 
                    </telerik:RadDocumentPane>                      
                </telerik:RadPaneGroup> 
            </telerik:RadSplitContainer> 
 
        </telerik:RadDocking> 

xu jundong
Top achievements
Rank 1
 answered on 08 Feb 2010
2 answers
179 views
Hi, I need your help.
While in a RadPaneGroup, I can accomplish this by using " ((RadDocumentPane)radPaneGroup.SelectedItem).Name; " to get it.
but how to get the selected RadDocumentPane when I have dragged it out from a RadPaneGroup?

Thank you!

xu jundong
Top achievements
Rank 1
 answered on 08 Feb 2010
2 answers
102 views
Hi,I have a problem.
While using the RadDocumentPane control, how can I add a minimizeButton or maximizeButton on it?
Is there any minimizeButton or maximizeButton on the RadDocumentPane control?

Thank you!
xu jundong
Top achievements
Rank 1
 answered on 08 Feb 2010
2 answers
81 views
Hello,

It looks like using a filter on one of my grid columns stops RowEditEnded from being invoked properly after the filtering.

I'm binding my grid to an ObservableCollection<> of business objects, and I have everything set up so updating/inserting rows works properly in most cases.  However I've noticed that if I use a column filter and narrow down the rows displayed, for example to only those rows including certain text in that column, that any subsequent edits won't be saved because RowEditEnded no longer gets invoked when I finish editing one of the remaining rows.

Have you seen this behavior before?  Is there something I'm doing wrong, or is this a known issue? 

I can submit a ticket and provide a sample project if necessary.

Thanks for any help you can provide!

Eddie
Eddie
Top achievements
Rank 2
 answered on 05 Feb 2010
2 answers
131 views
Hi.
I am using the following code:
    public partial class Window1 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
            this.Foos = new ObservableCollection<Foo>(new[] 
                        { 
                            new Foo { Name = "1" }, 
                            new Foo { Name = "2" }, 
                        }); 
        } 
 
        private void Window_Loaded(object sender, RoutedEventArgs e) 
        { 
            this.DataContext = this
        } 
 
        public ObservableCollection<Foo> Foos{ getset;} 
    } 
 
    public class Foo : IDataErrorInfo 
    { 
        public string this[string columnName] 
        { 
            get 
            { 
                return "Error"
            } 
        } 
 
        public string Error 
        { 
            get 
            { 
                return "Error!"
            } 
        } 
 
        public string Name { getset; } 
    } 

in combination with this xaml:
<Window x:Class="WpfApplication6.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    Title="Window1" Height="300" Width="300" 
        Loaded="Window_Loaded"
    <telerik:RadGridView ItemsSource="{Binding Path=Foos}" 
                         AutoGenerateColumns="False"
        <telerik:RadGridView.Columns> 
            <telerik:GridViewDataColumn Header="Name 1" 
                                        DataMemberBinding="{Binding Path=Name, ValidatesOnDataErrors=True}" /> 
            <telerik:GridViewColumn Header="Name 2"
                <telerik:GridViewColumn.CellTemplate> 
                    <DataTemplate> 
                        <TextBox Text="{Binding Path=Name, ValidatesOnDataErrors=True}" /> 
                    </DataTemplate> 
                </telerik:GridViewColumn.CellTemplate> 
            </telerik:GridViewColumn> 
        </telerik:RadGridView.Columns>         
    </telerik:RadGridView> 
</Window> 

The second TextBox "Name 2" does show the DataErrors fine. However the GridViewDataColumn ("Name 1") seems unaware of the DataErrorInfos.

Am I missing something or is the GridVioewDataColumn unaware of IDataErrorInfo ?

Nils
Nils
Top achievements
Rank 1
 answered on 05 Feb 2010
1 answer
116 views
Hello,
    I've added some code to my grid's double click event so if a cell is double clicked the column header's caption will be appended with (*). The problem I having occurs when I scroll to the right and than double click the column caption is not modified. If I scroll to right a couple of times and than scroll back to where I double clicked the (*) appears in the column caption.
I am almost certain this is caused by  Column Virtualization. Is their anyway to fix this so the (*) appears after I've double clicked?
Thanks
Vlad
Telerik team
 answered on 05 Feb 2010
9 answers
285 views
Hello, I just installed the demo. It seems to work fine when I click on an item on the tree list but when I click on another item on the tree list, it crashes. It always crashes when I select my second item but the first item loads fine.

Here's a screenshot: http://img291.imageshack.us/img291/7963/crashwi6.jpg
yagimay
Top achievements
Rank 1
 answered on 05 Feb 2010
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?