Telerik Forums
UI for WPF Forum
2 answers
164 views
Hello,
Here is my gridview.
<UserControl x:Class="SilverlightApplication1.MainPage"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView">
    <Grid x:Name="LayoutRoot">
         
        <telerikGrid:RadGridView x:Name="RadGridView1" ItemsSource="{Binding}" AutoGenerateColumns="False">
            <telerikGrid:RadGridView.ChildTableDefinitions>
                <telerikGrid:GridViewTableDefinition/>
            </telerikGrid:RadGridView.ChildTableDefinitions>
             
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}"/>
                <telerikGrid:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
            </telerikGrid:RadGridView.Columns>
             
            <telerikGrid:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerikGrid:RadGridView x:Name="SubGrid" DataLoading="SubGrid_DataLoading"
                                             AutoGenerateColumns="False" ItemsSource="{Binding Items}">
                    </telerikGrid:RadGridView>
                </DataTemplate>
            </telerikGrid:RadGridView.HierarchyChildTemplate>
        </telerikGrid:RadGridView>
    </Grid>
</UserControl>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using Telerik.Windows.Controls;
using System.Collections.ObjectModel;
using Telerik.Windows.Data;
using Telerik.Windows.Controls.GridView;
 
namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
 
            DataContext = from i in Enumerable.Range(0, 10)
                          select new MyObject()
                          {
                              ID = i,
                              Name = String.Format("Name{0}", i)
                          };
        }
 
        public class MyObject
        {
            public int ID { get; set; }
            public string Name { get; set; }
 
            public IEnumerable<MyObject2> Items
            {
                get
                {
                    return from i in Enumerable.Range(0, 10)
                           select new MyObject2()
                           {
                               x = i
                           };
                }
            }
        }
 
        public class MyObject2
        {
            public int x { set; get; }
 
            public IEnumerable<MyObject2> Items
            {
                get
                {
                    return from i in Enumerable.Range(0, 10)
                           select new MyObject2()
                           {
                               x = i
                           };
                }
            }
        }
 
        private void SubGrid_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            var grid = (GridViewDataControl)sender;
 
            var d = new GridViewTableDefinition();
            d.Relation = new PropertyRelation("Items");
            grid.TableDefinition.ChildTableDefinitions.Add(d);
 
            grid.AutoGenerateColumns = false;
            grid.Columns.Add(new GridViewDataColumn() { DataMemberBinding = new Binding("x") });
        }
    }
}

For the firs time it is child one and then it becomes self-hierarchical. Everything is OK, but in the real programm we use WCF service and MyObject and MyObject2 are DataContracts, and we need to call a WCF service in the get-methods of the Items property.
So, I ask you for help: How could I call the WFC method or maybe there is another way to make such hierarchy.
Jokerwolf
Top achievements
Rank 1
 answered on 19 Jul 2010
0 answers
90 views
Hi,

I have an exception with GridView in the part of using in the visual studio extention based on VSPackage described in this thread.
Any ideas about this problem?
Whether correctly I understand, what I cannot to use with the Telerik controls in the Visual Studio extensions based on VSPackage?
ifle
Top achievements
Rank 1
 asked on 18 Jul 2010
5 answers
794 views
I try to hide a row that have a specific status, When I do like the code below. the row is not shown, but there is space left "blank" in the grid where the row should be. I also tested with Height=0

private void radGrid_RowLoaded(object sender, RowLoadedEventArgs e)
{
    GridViewRow row = e.Row as GridViewRow;
    if (row != null)
    {
                 
        MyClass _MyClass = row.DataContext as MyClass;
        if (row != null && _MyClass != null)
        {
            row.IsExpandable = _MyClass.Category.Equals(5);
        }
        else
        {
            row.IsExpandable = false;
        }
 
        if (_MyClass.MediaCategory.Equals(5) && _MyClass.Status.Equals(-1))
        {
           row.Visibility = System.Windows.Visibility.Collapsed;
        }
     }
}

Any suggestions?

/Ken

Pavel Pavlov
Telerik team
 answered on 16 Jul 2010
2 answers
196 views
I am trying to export my WPF chart control to an image but I am getting an exception saying "Object reference not set". I am wondering what I am doing wrong here.
I am trying to export to xps. 
My another requirement is to convert to jpeg.
Can you guys please help me doing this?


SeriesMapping
sm1 = new SeriesMapping();
sm1.SeriesDefinition =
new LineSeriesDefinition();
sm1.LegendLabel =
"Line Series 1";
sm1.CollectionIndex = 0;
ItemMapping im1 = new ItemMapping();
im1.DataPointMember =
DataPointMember.YValue;
sm1.ItemMappings.Add(im1);
SeriesMapping sm2 = new SeriesMapping();
sm2.SeriesDefinition =
new LineSeriesDefinition();
sm2.LegendLabel =
"Line Series 2";
sm2.CollectionIndex = 1;
ItemMapping im2 = new ItemMapping();
im2.DataPointMember =
DataPointMember.YValue;
sm2.ItemMappings.Add(im2);
var itemsSource = new List<double>[] { new List<double> { 9, 2, 3, 4 }, new List<double> { 5, 7, 3, 4 } };
this.RadChart1.SeriesMappings.Add(sm1);
this.RadChart1.SeriesMappings.Add(sm2);
this.RadChart1.ItemsSource = itemsSource;
Microsoft.Win32.
SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.DefaultExt =
".xps";
string fileName = string.Empty; 

if (!((bool)dlg.ShowDialog()))
{
fileName = dlg.FileName;
}
this.RadChart1.ExportToXps(fileName);

Nikolay
Telerik team
 answered on 16 Jul 2010
1 answer
99 views
Dear ,

Please advise me the way to use SrollViewer for minimized items in 2010 Q2 version

Best Regards
Truong Pham
Ripper
Top achievements
Rank 1
 answered on 16 Jul 2010
3 answers
130 views
Ok, i have a RadTreeView with an Item Source of List<ActivityControl> which is a user control that has a text box, a canvas and a text box in it... my problem is that because the text box is within the RadTreeView whenever i try and click and drag to select text it tries to drag and drop the Selected item!?! this is going to be a pain for users to try and edit text if they cant drag to highlight....

i've uploaded a video to give you an idea!

http://www.screencast.com/users/kevinrhynas/folders/Jing/media/8fb40a9e-c5ce-4c6f-83ba-20054a6d466f

Also on a side note... i pressume that it is the header of each RadTreeItem that sets the "preview" in the draggable bit... how can i set this if i've simply set the "itemsource" to be a list.. as opposed to manually adding these items??



Tina Stancheva
Telerik team
 answered on 16 Jul 2010
1 answer
102 views
Dear Team ,
                  Please see the attached image file showing items in the tileView.When i add more items and the items in right side gets so small even i cant see the maximize,minimze buttons . any solution

Kind Regards
Asghar
Ripper
Top achievements
Rank 1
 answered on 16 Jul 2010
1 answer
89 views
Hi

I would like to know if it is planned to provide some support of WPF RadControls for the White framework: http://white.codeplex.com/

Regards
-- 
Laurent Kempé - laurent.kempe@techheadbrothers.com
Jobping - Advertises opportunities for Microsoft professionals
Tech Head Brothers - French .Net portal
Blog - One of the Tech Head Brothers
Microsoft ASP.NET MVP

Veselin Vasilev
Telerik team
 answered on 16 Jul 2010
4 answers
207 views
I don't see a RadTreeListView forum yet, so I'm sticking this here.

I have a list of objects of type SkuForecast.  Each SkuForecast has a list of objects of type SkuForecastArchive which has the same columns as the SkuForecast.
I'm trying to setup the RadTreeListView control to work with them, but I'm getting an InvalidCastException error cannot cast type SkuForecastArchive to type SkuForecast

What am I doing wrong?
                <telerik:RadTreeListView Name="telerikGrid" FrozenColumnCount="10" CanUserResizeColumns="True" IsFilteringAllowed="False"
 AutoGenerateColumns="False" CanUserFreezeColumns="True" 
 ScrollMode="RealTime" EnableColumnVirtualization="False" EnableRowVirtualization="True"
                 RowIndicatorVisibility="Collapsed"
                 HierarchyColumnIndex="2"  
 RowStyle="{DynamicResource GridViewRowStyle1}" 
 ItemsSource="{Binding PagedSource, ElementName=dataPager}"
 EditTriggers="CellClick"
 ShowGroupPanel="False">
...
           
<telerik:RadTreeListView.ChildTableDefinitions>
                        <telerik:TreeListViewTableDefinition ItemsSource="{Binding SkuForecastArchiveData}"/>
                    </telerik:RadTreeListView.ChildTableDefinitions>
...
         
            <telerik:RadTreeListView.Columns>

                  <telerik:GridViewDataColumn DataMemberBinding="{Binding Sku}" Header="Sku"  Width="48"/>
                  <telerik:GridViewDataColumn Name="skuDescColumn" DataMemberBinding="{Binding SkuShortDesc}" Header="Desc" Width="250"/>
                  <telerik:GridViewDataColumn Name="CapacityColumn" DataMemberBinding="{Binding Capacity}" Header="Capacity" Width="53"/>
...


   at Telerik.Windows.Data.FuncExtensions.<>c__DisplayClass1`2.<ToUntypedFunc>b__0(Object item) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Core\Data\Extensions\FuncExtensions.cs:line 19
   at Telerik.Windows.Controls.GridViewBoundColumnBase.GetCellContent(Object item) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewBoundColumnBase.cs:line 796
   at Telerik.Windows.Controls.GridViewBoundColumnBase.CreateCellElement(GridViewCell cell, Object dataItem) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewBoundColumnBase.cs:line 71
   at Telerik.Windows.Controls.GridView.GridViewCell.CreateCellElement(GridViewColumn column, Object dataItem) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 480
   at Telerik.Windows.Controls.GridView.GridViewCell.SetCellElement() in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 450
   at Telerik.Windows.Controls.GridView.GridViewRow.PrepareCell(GridViewCellBase cellBase, GridViewColumn column) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:line 540
   at Telerik.Windows.Controls.GridView.DataCellsPresenter.PrepareContainerForItemOverride(DependencyObject element, Object item) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\DataCellsPresenter.cs:line 257
   at Telerik.Windows.Controls.GridView.DataCellsPresenter.OnItemChanged(Object oldItem, Object newItem) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\DataCellsPresenter.cs:line 328
   at Telerik.Windows.Controls.GridView.DataCellsPresenter.set_Item(Object value) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\DataCellsPresenter.cs:line 296
   at Telerik.Windows.Controls.GridView.GridViewRowItem.OnItemChanged(Object oldItem, Object newItem) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRowItem.cs:line 433
   at Telerik.Windows.Controls.GridView.GridViewRow.OnItemChanged(Object oldItem, Object newItem) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:line 432
   at Telerik.Windows.Controls.RadRowItem.OnItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Core\Data\RadRowItem.cs:line 47
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.RadRowItem.set_Item(Object value) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Core\Data\RadRowItem.cs:line 34
   at Telerik.Windows.Controls.GridView.GridViewRowItem.PrepareRow(Object item, GridViewDataControl owningDataGrid) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRowItem.cs:line 475
   at Telerik.Windows.Controls.GridView.GridViewRow.PrepareRow(Object item, GridViewDataControl owningDataGrid) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:line 414
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PrepareContainerForItemOverride(DependencyObject element, Object item) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 7645
   at Telerik.Windows.Controls.RadTreeListView.PrepareContainerForItemOverride(DependencyObject element, Object item) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\TreeListView\RadTreeListView.cs:line 176
   at Telerik.Windows.Controls.GridView.BaseItemsControl.Telerik.Windows.Controls.GridView.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\BaseItemsControl.cs:line 330
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 261
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 2073
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertRecycledContainer(Int32 childIndex, UIElement container) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 1985
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 2112
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 1217
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   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.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)
David Brenchley
Top achievements
Rank 1
 answered on 15 Jul 2010
0 answers
91 views
Dear Team,
                      I have a requirment to add some text boxes , radio buttons with nice format in radtileviewitem.For this purpose i hv decided to drive radtileviewitme and make lets say myradtileviewitem according to my requirment , further i will add these items programmitically in the tile view . I have seen http://www.telerik.com/community/forums/silverlight/tileview/derived-radtileviewitem-not-displaying-correctly.aspx blog entry which shows that generic.xaml  file is updated but not clear that how the custom radtileviewitem is getting "sometextbox" customization.

Can u give me some example code or help document to make my own radtileviewitem and programmitcally adding in tile view

Kind Regards


Ripper
Top achievements
Rank 1
 asked on 15 Jul 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
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
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?