Telerik Forums
UI for WPF Forum
0 answers
163 views
I tried your latest demo 2010.2

The GridView has 8 Rows. Each Row has a RichTextBox as DataTypeColumn.

On the GridView the Virtualization on Columns + Rows is turned on also the Realtime scrolling.

When I drag now the thumb bar of the Scrollbar the DataRows are jumping with a delay. Seems the creating of a datarow when it is getting into the visible area is badly solved. 

What is wrong with my code and how can I improve smoothness of the scrolling ?

Using the so called crap DataGrid from Microsoft the scrolling is superb and the DataGrid is loaded 3 times faster... I just miss the features you offer...

my test code:

<telerik:RadGridView x:Name="dailyGrid" <br>                ItemsSource="{Binding PeriodListViewModel}"<br>                ScrollMode="RealTime"                 <br>                AutoGenerateColumns="False"                 <br>                CanUserDeleteRows="False"<br>                CanUserInsertRows="False"<br>                CanUserReorderColumns="False"<br>                CanUserResizeColumns="False"<br>                CanUserSortColumns="False"<br>                DataLoadMode="Asynchronous"<br>                RowStyle="{StaticResource ResourceKey=RowStyle}" <br>                RowIndicatorVisibility="Collapsed" EnableRowVirtualization="False" EnableColumnVirtualization="False"><br><br>                <telerik:RadGridView.Columns><br>                    <telerik:GridViewDataColumn Header="Content" Width="*"><br>                        <telerik:GridViewDataColumn.CellTemplate><br>                            <DataTemplate><br>                                <Grid HorizontalAlignment="Stretch"><br>                                    <Grid.RowDefinitions><br>                                        <RowDefinition Height="200" /><br>                                    </Grid.RowDefinitions><br>                                    <telerik:RadRichTextBox VerticalScrollBarVisibility="Auto" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"                                                             <br>                                                            IsSpellCheckingEnabled="False" <br>                                                              x:Name="RTFBox" /><br>                                    <telerikProvider:RtfDataProvider                                        <br>                                        Rtf="{Binding Path=Content}"<br>                                        UpdateSourceTrigger="LostFocus" <br>                                        RichTextBox="{Binding ElementName=RTFBox}" /><br>                                </Grid><br>                            </DataTemplate><br>                        </telerik:GridViewDataColumn.CellTemplate><br>                    </telerik:GridViewDataColumn>                                    <br>                </telerik:RadGridView.Columns><br>            </telerik:RadGridView>-->


btw. the DataLoadMode Async or Sync there seems no difference for me. The data is always loaded syncronously because the GridView is only visible when all data is loaded... thats not async!

bernd kopp
Top achievements
Rank 1
 asked on 19 Jul 2011
5 answers
447 views
Hello,

I want get the the Label in gridview's datacolumn celltemplate.
In xaml file , the design is as follows.

 <telerik:RadGridView x:Name="ecbPropertiesGV" AutoGenerateColumns="False"
                                                 ActionOnLostFocus="CancelEdit" CanUserReorderColumns="False"
                                                 RowIndicatorVisibility="Collapsed" IsFilteringAllowed="False"
                                                 CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSelect="False"
                                                 CanUserSortColumns="False" IsReadOnly="True" ShowGroupPanel="False" CanUserResizeColumns="False">
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn Header="Number."  x:Name="numberColumn" HeaderTextAlignment="Center">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                                                <Label x:Name="lblName" Width="170" VerticalAlignment="Center" />
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>
</telerik:RadGridView>

How to find the lblName(Label)  in GridViewDataColumn.
If anyone who knows about this , please reply me.

Best Regards
Mark Richardson
Top achievements
Rank 1
 answered on 19 Jul 2011
8 answers
189 views
Hi,

How can I define Headers style in RadGridView in code

Or

Is there any property which deals with headers styles?

Thanks,
-Narendra

Bob
Top achievements
Rank 3
Iron
Iron
Veteran
 answered on 19 Jul 2011
2 answers
139 views
My application is having an error when I try to write a manual test with the TestManager.

When running the application, the error is not generated only when recording tests.

The stacktrace of the error is this:
System.NullReferenceException: Object reference not set to an instance of an object.     at Telerik.Windows.Controls.RadTabControlAutomationPeer.GetChildrenCore() in f:\113\WPF_Scrum\Current_HotFix\Sources\Development\Controls\Navigation\TabControl\RadTabControlAutomationPeer.cs:line 207     at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()     at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)     at System.Windows.Automation.Peers.ItemsControlAutomationPeer.UpdateChildren()     at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()     at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()     at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()     at System.Windows.Automation.Peers.AutomationPeer.FireAutomationEvents()     at System.Windows.ContextLayoutManager.fireAutomationEvents()     at System.Windows.ContextLayoutManager.UpdateLayout()     at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)     at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()     at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()     at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)     at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)     at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)     at System.Windows.Interop.HwndTarget.OnResize()     at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)     at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)     at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)     at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)     at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


André
Top achievements
Rank 1
 answered on 19 Jul 2011
2 answers
148 views
Good morning,

I would like to use a TreeView  that's can drag and drop in  a GridView

I make the TreeView but when a want to drag and drop i have a probleme the null Exception, after   4 days i can't see the problem.

Let me show you my code to help me please.

I have a class library  LabelData  to make the database and a  data class 
 
this is my table


CREATE TABLE MyTable
(IdTable Int(2),
IdLabel Int(20),
LName char(50)
)
and my  Rows
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (1, 200, 'firstName');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (2, 200, 'lastName');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (3, 200, 'middleName');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (4, 201, 'circuit');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (5, 201, 'series');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (6, 202, 'country');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (7, 202, 'region');
  
INSERT INTO MyTable (IdTable,IdLabel,LName) VALUES (8, 202, 'zipcode');

For make the treeview, I use  IdLabel to make like "categorie"  and i  use LName to make like "product" .

I add a heritance in on my table MyTable   GroupLabel  with the property LName


This is my class  data.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
  
LNamespace LabelData
{
    public class DataProvider
    {
        LabelDataContext dc;
  
        public DataProvider()
        {
            dc = new LabelDataContext();
        }
  
        public IEnumerable<Label> GetLabel()
        {
            return from e in dc.MyTable
                   group e by e.IdLabel into gr
                   select new Label() { IdLabel = gr.Key, LName= gr };
              
        }
  
        public IEnumerable<MyTable> Get_Table()
        {
            return from p in dc.MyTable
                   select p;
  
        }
  
  
      
     }
  
    public class Label
    {
        public int IdLabel { get; set; }
        public IEnumerable<MyTable> LName{ get; set; }
    }
  
    
      
}


And this is my behind code xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Controls.DragDrop;
using Telerik.Windows.Controls;
using System.Collections.ObjectModel;
using LabelData;
using Telerik.Windows.Controls.TreeView;
using System.Collections;
  
using System.Net;
  
using System.Windows.Media.Animation;
  
  
using Telerik.Windows;
  
  
LNamespace LabelMunich
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class WindowTreeView : Window
    {
        public WindowTreeView()
        {
            InitializeComponent();
            ProfilData.DataProvider dataProvider = new ProfilData.DataProvider();
            treeView1.ItemsSource = dataProvider.GetModule();
            radGridView.ItemsSource = dataProvider.Get_Table();
  
            RadDragAndDropManager.AddDropQueryHandler(radGridView, new EventHandler<DragDropQueryEventArgs>(this.RadGridView_OnDropQuery));
            RadDragAndDropManager.AddDropInfoHandler(radGridView, new EventHandler<DragDropEventArgs>(this.RadGridView_OnDropInfo)); 
  
  
        }
        private void RadRibbonButton_Click(object sender, RoutedEventArgs e)
        {
            // FAjout fa = new FAjout();
            formAjout fa = new formAjout();
            fa.Show();
            // this.ShowActivated();
        }
  
        private void radTreeView_PreviewDragEnded(object sender, RadTreeViewDragEndedEventArgs e)
        {
            e.Handled = true;
        }
  
  
        private void RadGridView_OnDropQuery(object sender, DragDropQueryEventArgs e)
        {
            e.QueryResult = (e.Options.Source as RadTreeViewItem).Item is Module;
        }
        private void RadGridView_OnDropInfo(object sender, DragDropEventArgs e)
        {
            if (e.Options.Status == DragStatus.DropComplete)
            {
                (radGridView.ItemsSource as IList<Module>).Add((e.Options.Payload as Collection<Object>)[0] as Module);
            }
        
       
    }
}

And my Xaml document

<Window x:Class="ProfilTandem.WindowTreeView"
        xmlns:northwind="clr-namespace:ProfilData;assembly=LabelData"
        xmlns:local="clr-namespace:LabelMunich"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"    
        xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls" 
        Title="MainWindow" Height="450" Width="585">
    <Window.Resources>
        <DataTemplate x:Key="Team">
            <TextBlock Text="{Binding  Path=LName}"/>
        </DataTemplate>
  
        <HierarchicalDataTemplate DataType="{x:Type northwind:Label}" ItemsSource="{Binding Path=LName}">
            <Border Width="250">
                <Grid>
                    <TextBlock  
                 Text="{Binding Path=IdLabel}" FontSize="14" FontWeight="Bold" Margin="2" >
                    </TextBlock>
                </Grid>
            </Border>
        </HierarchicalDataTemplate>
        <HierarchicalDataTemplate DataType="{x:Type northwind:GroupLabel}">
            <Grid Margin="6">
                <TextBlock Text="{Binding Path=LName}" Padding="2" />
            </Grid>
        </HierarchicalDataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>       
          
        <telerik:RadTreeView IsDragDropEnabled="True" Grid.Column="0" Grid.Row="1"
               SelectionMode="Multiple"      IsEditable="True"  x:Name="treeView1" Margin="0,20,0,245"
                PreviewDragEnded="radTreeView_PreviewDragEnded"
      IsDragTooltipEnabled="False" ItemsSource="{Binding}"/>
  
        <StackPanel Grid.Column="1" Grid.Row="1">
            <telerik:RadGridView x:Name="radGridView"  AutoGenerateColumns="False"
          Width="400" Height="400" HorizontalAlignment="Left" telerikDragDrop:RadDragAndDropManager.AllowDrop="True" 
          DataContext="{Binding}"   ItemsSource="{Binding}">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=IdLabel}"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=LName}"/>
  
                    </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </StackPanel>
  
    </Grid>
</Window>

This is all


When i try to drag items treeview to gridview i have exception on this line 

  (radGridView.ItemsSource as IList<Label>).Add((e.Options.Payload as Collection<Object>)[0] as Label);

The exception System.NullReferenceException was unhandled

Object reference not set to an instance of an object

Thank you for your help
Goldoni
Top achievements
Rank 1
 answered on 19 Jul 2011
1 answer
76 views
Hello,
I'm trying to bind a hierarchical RadGridView to the same DataForm on a window (n levels of children, determined at runtime).
For the first level i do:

_qcv =  new QueryableCollectionView(_entities.Countries.ToList());
radGridView1.ItemsSource = _qcv;
radDataForm1.ItemsSource = _qcv;

Everything works fine, the grid is well syncronized with the dataform.
How can i get acces to the new expanded child grids to do the same? I mean bind the itemsCollections behind those grids to the dataForm and keep them in sync? What events should i use and how should i get the child Collections?
What is the correct aproach for this kind of children/parent/dataform sync?

Thank you.
Pavel Pavlov
Telerik team
 answered on 19 Jul 2011
1 answer
85 views
Hi,
I was trying the Q2 controls, and I found that  when I am navigating my grid with the up and down arrows to select an item, when I try to move to the last item it doesn't activate until I press the left or right arrow. I have the row details activated. Is this intended?
Yordanka
Telerik team
 answered on 19 Jul 2011
2 answers
225 views
When I try to drag a RadNumericUpDown control from the Toolbox over onto a WPF designer-view Window, I'm getting an Error Dialog that says:
Set property 'System.Windows.ResourceDictionary.Source' threw an exception.
"Cannot locate resource 'themes/genericmetro.xaml'."

What is going on here?  I have used this control before in another project and it worked great.

I just today updated to the Q4 2011 update. I'm running VS 2010 Ultimate SP1 on Windows 7 x64 Ult. My application is targeting .NET Framework 4.0.   As my mother always used to ask me.. "What did you break now?!"  lol

Thanks for your help,
James W. Hurst
James
Top achievements
Rank 2
 answered on 19 Jul 2011
2 answers
142 views
Hi,

I have an app with a TabControl. Each item in the TabControl has a RadTreeListView. When I switch between the tabs, the hierarchy in the RadTreeListView gets collapsed. The problem, of course, is that the IsExpanded states is preserved only in the RadTreeListView and TabControl virtualizes its contents, i.e. if there are three tabs, it only creates one RadTreeListView and when the user selects a tab, then only thing that changes is the RadTreeListView's DataContext.

The solution would be to bind each row's IsExpanded property to a property in my ViewModel. But from my reading of other posts in this forum, it appears that binding to a TreeListViewRow's IsExpanded property doesn't work.

How can I preserve the IsExpanded state when I switch between tabs?

Thanks,
    Bob Alexander
Bob
Top achievements
Rank 1
 answered on 19 Jul 2011
1 answer
122 views
I created a user control to display a scatter plot based on some given data. I needed to create dependency properties for the label/max/min of axes, and chart title in order to let the user change the properties while obfuscating the inner workings of the chart. The axes properties worked out fine because they were properties of the ChartArea class. The problem is that the ChartTitle property is a member of the ChartDefaultView class and when I apply the same logic as before with the ChartArea class, it doesn't work. Is there some kind of default value that I need to override or something?

This dependency property for the max value of the X-axis works 100% fine.

        public double XAxisMax
        {
            get { return (double)this.GetValue(XAxisMaxProperty); }
            set { this.SetValue(XAxisMaxProperty, value); }
        }

        public static readonly DependencyProperty XAxisMaxProperty =
            DependencyProperty.Register("XAxisMax", typeof(double), typeof(ScatterChart),
                new UIPropertyMetadata(1.0, new PropertyChangedCallback(XAxisMaxCallback)));

        static void XAxisMaxCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ScatterChart chart = (ScatterChart)obj;
            chart.ChartArea.AxisX.AutoRange = false;
            chart.ChartArea.AxisX.MaxValue = (double)args.NewValue;
        }

The one for the chart title on the other hand does not work.

        public string ChartTitle
        {
            get { return (string)this.GetValue(ChartTitleProperty); }
            set { this.SetValue(ChartTitleProperty, value); }
        }

        public static readonly DependencyProperty ChartTitleProperty =
            DependencyProperty.Register("ChartTitle", typeof(string), typeof(ScatterChart),
                new UIPropertyMetadata(string.Empty, new PropertyChangedCallback(ChartTitleCallback)));

        static void ChartTitleCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ScatterChart chart = (ScatterChart)obj;
            chart.DefaultView.ChartTitle.Content = (string)args.NewValue;
        }

Any idea what might be wrong?
Giuseppe
Telerik team
 answered on 19 Jul 2011
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?