Telerik Forums
UI for WPF Forum
2 answers
313 views
I am using the Telerik gridview and the RadDataPager quite successfully. However how should you set the page size to cope with an adjustable container window size when the grid size is set to auto? The choice seems to be to set it to a low number to avoid vertical scrolling but have lots of space below the grid when the window is maximised, or accept vertical scrolling with a much large page size.
In an MVVM design, how would you set the page size according to physical grid and window sizes, also taking into account the group panel, for example, which might be shown or not? - or have I missed some existing functionality?

Thanks

jas


jas
Top achievements
Rank 1
 answered on 09 Apr 2010
3 answers
223 views
Hi,

I have a problem in a Grid, editing a new row previously entered. 
The sequence is this :

1. First I insert a new row. 

The code in AddingNewDataItem Event Handler of the Grid is :

        public void EUGruppoGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            if (e.Cancel) return;
            String TipoCurrentItem;
            GridViewDataControl GridViewDataControl = e.OwnerGridViewItemsControl;
            if (GridViewDataControl.CurrentItem != null)
                TipoCurrentItem = ((EUGruppoVO)GridViewDataControl.CurrentItem).Tipo;
            else
                TipoCurrentItem = " ";
            e.NewObject = new EUGruppoVO(0, "", TipoCurrentItem);
        }

        the "EUGruppoVO" Constructor is :

public EUGruppoVO(Int32 id, String descrizione, String tipo)
{
this._id = id;  // in the database the fields is a identity primary key
this._descrizione = descrizione;
this._tipo = tipo;
}

the "EUGruppoVO" implements "INotifyPropertyChanged"
the "EUGruppoItemsSource" is an instance of : "public class EUGruppoVOList : ObservableCollection<EUGruppoVO>"

2. Then I move to another row ( the RowEditEnded Event fire with "e.EditOperationType == GridViewEditOperationType.Insert" )The code in RowEditEnded Event Handler of the Grid is :
public void EUGruppoGrid_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e){if (e.EditAction == GridViewEditAction.Cancel) return;if (e.EditOperationType == GridViewEditOperationType.Insert)_eUGruppoService.Insert((EUGruppoVO)e.NewData);else_eUGruppoService.Update((EUGruppoVO)e.NewData);}

3. Then I move in the row previously entered, strangely the value of the "id" property of the current item has remained zero.I edit the row, when I move to another row the RowEditEnded Event fire again with "e.EditOperationType == GridViewEditOperationType.Update"but the "id" property of (EUGruppoVO)e.NewData is still zero, why ?

An extract of the XAML code is :...<telerikGridView:RadGridView x:Name="EUGruppoGrid" AutoGenerateColumns="False" CanUserFreezeColumns="False" ShowGroupPanel="True" ItemsSource="{Binding EUGruppoItemsSource, Mode=TwoWay}" CurrentItem="{Binding EUGruppoCurrentItem, Mode=TwoWay}" Margin="0,0,0,0"><telerikGridView:RadGridView.Columns><telerikGridView:GridViewComboBoxColumn DataMemberBinding="{Binding Tipo, Mode=TwoWay}" ItemsSource="{Binding TipoEUList, Mode=OneWay}" DisplayMemberPath="Descrizione" SelectedValueMemberPath="Codice" Header="Tipo" IsReadOnly="False" /><telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Descrizione, Mode=TwoWay}" Header="Descrizione" IsReadOnly="False" /><telerikGridView:GridViewDataColumn IsVisible="False" DataMemberBinding="{Binding Id, Mode=OneWay}" Header="Id" IsReadOnly="True" /></telerikGridView:RadGridView.Columns></telerikGridView:RadGridView>...
An extract of the code behind is :...this.EUGruppoGrid.AddingNewDataItem += new EventHandler<Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs>(_tabelleViewModel.Controller.EUGruppoGrid_AddingNewDataItem);this.EUGruppoGrid.RowEditEnded += new EventHandler<Telerik.Windows.Controls.GridViewRowEditEndedEventArgs>(_tabelleViewModel.Controller.EUGruppoGrid_RowEditEnded);...DataContext = _tabelleViewModel

Thanks, Dario.
Stefan Dobrev
Telerik team
 answered on 09 Apr 2010
2 answers
123 views
Hello! I was trying to get advantage from the RadTabControl component in my project and have it bounded to a collection I am going to use. I follow all the steps in the documentation, but in the end the tab names are still the name of the class and not some property string I want to use. I even made a project using your own classes (Person & ViewModel) thinking that something is wrong with my code and I still see "DataInfo.Person" at the name of each tab (DataInfo is my namespace)
I am using exactly your code:

namespace DataInfo { 
    public class Person { 
        public Person( string name, int age ) { 
            this.Name = name; 
            this.Age = age; 
        } 
        public string Name { 
            get
            set
        } 
        public int Age { 
            get
            set
        } 
    } 

namespace DataInfo { 
    public class ViewModel { 
        public ViewModel() { 
            this.Persons = new ObservableCollection<Person>(); 
            this.Persons.Add( new Person( "Ivan", 23 ) ); 
            this.Persons.Add( new Person( "Stefan", 34 ) ); 
            this.Persons.Add( new Person( "Maria", 16 ) ); 
            this.Persons.Add( new Person( "Michael", 78 ) ); 
        } 
        public ObservableCollection<Person> Persons { 
            get
            set
        } 
    } 


<UserControl x:Class="DataInfo.TabControl" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:DataInfo="clr-namespace:DataInfo" 
             xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    <UserControl.Resources> 
        <DataInfo:ViewModel x:Key="DataSource" /> 
        <DataTemplate x:Key="ContentTemplate"
            <Grid> 
                <TextBlock Text="{Binding Age}" /> 
            </Grid> 
        </DataTemplate> 
    </UserControl.Resources> 
    <Grid x:Name="LayoutRoot" 
          Background="White"
        <Controls:RadTabControl x:Name="radTabControl" 
                                Margin="8" 
                                ItemsSource="{Binding Source={StaticResource DataSource}, Path=Persons}" 
                                DisplayMemberPath="Name" 
                                ContentTemplate="{StaticResource ContentTemplate}" /> 
 
    </Grid> 
</UserControl> 

Is there something I've misunderstood?

Thank you!
Roxana











RoxanaC
Top achievements
Rank 1
 answered on 09 Apr 2010
1 answer
169 views
Hi,

I place several Custom Controls on panes. After that I'm not able to show the controls COntext Menu -instead I only get the panes Context Menu. I tried to disable the pane's context menu - but then I do not get any context menu.

How do I solve my problem ?

kind regards

Lorenz
Miroslav Nedyalkov
Telerik team
 answered on 08 Apr 2010
1 answer
124 views
Hi,
I have such a problem:
I've got a RadGridView (WPF). Filtering is enabled for columns. When I want to use vertical scrollbar on the filter (or just trying to drag filter control), grid behaves like it drag the column. This behavior is the same on Telerik demos. How to prevent this?
Yordanka
Telerik team
 answered on 08 Apr 2010
2 answers
212 views

Hello,

I have been working with the radTileView.  It's going to do what I need it to do in most cases. However, when there are only a few items the RadTileViewItems take the full space proportionally.  It doesn't matter if I set the TileState="Minimized" or TileState="Restored" and the RadFluidContentControl ContentChangeMode="Manual" and State="Small". The controls do appear in the proper state, however the border of the control takes the remaining space causing the controls to be spaced evenly in the area. Even if I manually set the maxHeight and maxWidth of the radTileViewItem.

 

Is there a way to cause the tiles to be top left justified and leave blank space to the bottom and right when minimized or restored?

 

The other thing is that when I have a radTileView item maximized and the minimizedItemsPosition="Right" the same kind of spacing issue occurs. I would like them to appear like they do in the "Tile States" BMW section of this link - http://www.telerik.com/products/silverlight/tileview.aspx

 

I have also tried this with the sample code by adjusting the number of BMW tileViewItems and the size of their container.


I would like to use it more like a list box with very small items taking advantage of the eye candy moving them around and the maximize to edit the information in the control.
 

Thank you for your help.

 

Rick

Rick Knicely
Top achievements
Rank 1
 answered on 08 Apr 2010
1 answer
74 views
Hi,
I've just updated my WPF binaries to 2010.1.309.35 from 2009.3.1208.35 and it seems that the ColumnWidthsMode enum is missing could someone please explain to me what has happened to it?

Also, I've seen examples using the telerik:HierarchicalDataTemplate with the treeview control with regards to binding to the individual items CheckState property but can't seem to find that class either. Please help asap as this is rather urgent.

Thanks,
Peter.
Tina Stancheva
Telerik team
 answered on 08 Apr 2010
1 answer
113 views
Hi,
What are general rules for installation Visual Studio 2010 and using Telerik RadControls with it, in case if VS2008 and Telerik RadControls already installed on this machine?
Should Telerik RadControls be reinstalled after installation of VS2010?
Milan
Telerik team
 answered on 08 Apr 2010
17 answers
594 views
Cheers to Telerik,

I've just started using the telerik WPF and started with radgridview only.

Am using a Dataset to populate the Grid.This is not a typed dataset, but a dataset generated programmatically from a SQLServer 2005 DB.Am using VB.net 3.5 as well.To populate the Dataset am using a StoredProcedure

I was able to populate the grid using my dataset.Now I want to make a child for that grid with another dataset and the dataset uses another SP.So how can I attain this.I tried for help but majority is using LINQ.Am not much aware of LINQ.

Please find my code below.( I havent tried with the hierarchy here)

XAML
<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="515" Width="933" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    <Grid> 
         
        <telerik:RadGridView Margin="0,-12,22,163" Name="RGVW" AutoGenerateColumns="False"  ItemsSource="{Binding}" AlternateRowBackground="Bisque"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn  Name="CDNO" UniqueName="CDNO" Header="CDNO"  /> 
                <telerik:GridViewDataColumn Name="Truck" UniqueName="Truck No" Header="Truck No"  /> 
                <telerik:GridViewDataColumn Name="Status" UniqueName="Status" Header="Status"  /> 
                <telerik:GridViewImageColumn Name="Flag" UniqueName="Flag" Header="Truck Flag"  /> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
VBCode (VS2008)
Private Sub Window1_Loaded(ByVal sender As ObjectByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded 
        Dim ds As DataSet 
        Dim dbConn As String = "Data Source=SQLSERVER;Initial Catalog=DB;_
Persist Security Info=True;User ID=!@#;pwd=!@#" 
        ds = DBA.ExecuteDataset(dbConn, "SP_DockForWPF"
        RGVW.DataContext = ds 
    End Sub 


Here the uniquenames am using is the field from the SP.
To connect to the DB am using, the Microsoft.StandardLib.DBAccess dll. (DBA is the instance of this DLL

I got a sample in C# from the following post http://www.telerik.com/ClientsFiles/164971_hierarchywithdataset.zip .Its the one which uses LINQ

Many thanks in advance

Renju


Renju Panicker
Top achievements
Rank 1
 answered on 08 Apr 2010
5 answers
147 views
So the structure of my tree is something like:

RootObject
    ChildObject1
        GrandChildObject1
    ChildObject2
        GrandChildObject2

Problem 1: When I drag and drop GrandChildObject1 to ChildObject2, the collection in ChildObject1 calls its Delete method, and I don't want that, since there's a few steps I need to do before removing GrandChildObject1 from ChildObject1.

Problem 2: When I drop GrandChildObject1 into ChildObject2, there's a few steps I need to do before finally adding GrandChildObject1 to ChildObject2. So doing this, also triggers the Add Method, so I end up having two children of the same item (one added by the TreeView itself, and one I add with my own method in the TreeView.RadTreeView_DragEnded event).

So, is there a way to prevent the TreeView from handling this, and not losing the little Drag&Drop preview when the drag starts? I just want to disable the TreeView from triggering a change in the Collection. I found out it was doing it by setting a breakpoint here:

private void GrandChildren_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) 
    this.NotifyPropertyChanged("GrandChildren"); // breakpoint here

EDIT: The collection of GrandChildren is an ObservableCollection<T>, and I can't change that to BindingList<T> or List<T>

Thanks!
Valentin.Stoychev
Telerik team
 answered on 08 Apr 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
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?