Telerik Forums
UI for WPF Forum
2 answers
131 views
Hi all. I was wondering if it's possible to show the list of items in a RadComboBox by using a RadGridView. In other words, that when the user expands the RadComboBox, the items inside get shown in a RadGridView (with headers). I need this because I got a lot of info to show for each element (item) of the RadComboBox.

Thanks.

Hugo Aristizabal.
Hugo Aristizabal
Top achievements
Rank 2
 answered on 04 Feb 2010
1 answer
119 views
Hello

I have the setup as described below. I use the trial version binaries 2009.3.1314.35.
If you run this example and try to insert a new row by pressing the 'insert'-Key, then you result in an ArgumentException:
{"Property with specified name:  cannot be found on type: WpfApplication1.SimpleObject\r\nParameter name: propertyName"}.

The problem seems to be the 'SimpleObject'-Class. If you remove, or comment out, the ICustomTypeDescriptor interface from the class declaration then everything works ok.

Do you know this problem? Is there a solution or a work around?

Best regards,
Franziska

xaml:
<telerik:RadGridView x:Name="gridView"  
                                     ShowGroupPanel="False" IsFilteringAllowed="False" AutoGenerateColumns="False" 
                                     ItemsSource="{Binding PmodCollection}"  
                                     AddingNewDataItem="gridView_AddingNewDataItem" > 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Header="Test" DataMemberBinding="{Binding Test}" /> 
                <telerik:GridViewComboBoxColumn UniqueName="columnDescriptor" Header="Descriptor" 
                                                        DataMemberBinding="{Binding SimpleObject}" DisplayMemberPath="Descriptor" 
                                                        ItemsSource="{Binding SimpleObjChoiceList}"/> 
            </telerik:RadGridView.Columns> 
</telerik:RadGridView> 
Code behind:
public partial class Window1 : Window 
        public Window1() 
        { 
            InitializeComponent(); 
 
            this.DataContext = new DataContext(); 
        } 
 
        private void gridView_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e) 
        { 
            e.NewObject = new SimpleObjectPMod(); 
        } 
DataContext:
class DataContext 
        private List<SimpleObject> simpleObjs; 
        private ObservableCollection<SimpleObjectPMod> pmodCollection; 
 
        public DataContext() 
        { 
            simpleObjs = new List<SimpleObject>(); 
            simpleObjs.Add(new SimpleObject() { Descriptor = "bla" }); 
            simpleObjs.Add(new SimpleObject() { Descriptor = "fasel" }); 
 
            pmodCollection = new ObservableCollection<SimpleObjectPMod>(); 
        } 
 
        public List<SimpleObject> SimpleObjChoiceList 
        { 
            get { return simpleObjs; } 
        } 
 
        public ObservableCollection<SimpleObjectPMod> PmodCollection 
        { 
            get { return pmodCollection; } 
        } 
PMod:
class SimpleObjectPMod 
        public string Test 
        { 
            get; set; 
        } 
 
        public SimpleObject SimpleObject 
        { 
            get; set; 
        } 
Simple Object:
class SimpleObject : ICustomTypeDescriptor
{
        public string Descriptor
        {
            get; set;
        }

        #region Implementation of ICustomTypeDescriptor
        public AttributeCollection GetAttributes()
        {
            return TypeDescriptor.GetAttributes(this, true);
        }
        public string GetClassName()
        {
            return TypeDescriptor.GetClassName(this, true);
        }
        public string GetComponentName()
        {
            return TypeDescriptor.GetComponentName(this, true);
        }
        public TypeConverter GetConverter()
        {
            return TypeDescriptor.GetConverter(this, true);
        }
        public EventDescriptor GetDefaultEvent()
        {
            return TypeDescriptor.GetDefaultEvent(this, true);
        }
        public PropertyDescriptor GetDefaultProperty()
        {
            return TypeDescriptor.GetDefaultProperty(this, true);
        }
        public object GetEditor(Type editorBaseType)
        {
            return TypeDescriptor.GetEditor(this, editorBaseType, true);
        }
        public EventDescriptorCollection GetEvents()
        {
            return TypeDescriptor.GetEvents(this, true);
        }
        public EventDescriptorCollection GetEvents(Attribute[] attributes)
        {
            return TypeDescriptor.GetEvents(this, attributes, true);
        }
        public PropertyDescriptorCollection GetProperties()
        {
            return GetProperties(null);
        }
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            return TypeDescriptor.GetProperties(this, attributes, true);
        }
        public object GetPropertyOwner(PropertyDescriptor pd)
        {
            return this;
        }
        #endregion
}
Nedyalko Nikolov
Telerik team
 answered on 04 Feb 2010
1 answer
107 views
Hi,

I am using the DatePicker as an usercontrol and in the Constructor of the Cntrol I am setting the following dates.

dateCtrl.DisplayDateStart = Convert.ToDateTime("01/01/2003", System.Globalization.CultureInfo.CurrentCulture);                        dateCtrl.DisplayDateEnd = Convert.ToDateTime("18/01/2010", System.Globalization.CultureInfo.CurrentCulture); 
dateCtrl.SelectableDateEnd = Convert.ToDateTime("18/01/2010", System.Globalization.CultureInfo.CurrentCulture);                        
dateCtrl.SelectedDate = Convert.ToDateTime("18/01/2010", System.Globalization.CultureInfo.CurrentCulture);

and while loading the control it throws the following exception:

System.ArgumentOutOfRangeException was unhandled
  Message="Invalid DisplayDateEnd value.\r\nParameter name: sender"
  Source="Telerik.Windows.Controls.Input"
  ParamName="sender"
  StackTrace:
       at Telerik.Windows.Controls.RadCalendar.OnDisplayDateEndChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
       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, OperationType operationType)
       at System.Windows.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot)
       at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
       at System.Windows.StyleHelper.LoadOptimizedTemplateContent(DependencyObject container, ParserContext parserContext, OptimizedTemplateContent optimizedTemplateContent, FrameworkTemplate frameworkTemplate, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
       at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
       at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
       at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at ITV.MSS.Shell.App.Main() in E:\MediaSales\MediaSalesSuite\Dev\Shell\ITV.MSS.Shell.Shell\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       at System.Activator.CreateInstance(ActivationContext activationContext)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:



If I Comment the following lines Or Set the DisplayDateEnd to DateTime.Now() then it works fine.

dateCtrl.DisplayDateStart = Convert.ToDateTime("01/01/2003", System.Globalization.CultureInfo.CurrentCulture);                       
//dateCtrl.DisplayDateEnd = Convert.ToDateTime("18/01/2010", System.Globalization.CultureInfo.CurrentCulture); 
dateCtrl.SelectableDateEnd = Convert.ToDateTime("18/01/2010", System.Globalization.CultureInfo.CurrentCulture);                        
dateCtrl.SelectedDate = Convert.ToDateTime("18/01/2010", System.Globalization.CultureInfo.CurrentCulture);

Please let me know what can be the possible cause of this exception.

Thanks,
Anjan
Konstantina
Telerik team
 answered on 04 Feb 2010
1 answer
113 views
HI,

I'm trying to style my RadGridView row based upon a style as detailed in the example at the following address:-

http://blogs.telerik.com/blogs/posts/09-02-03/how_to_use_custom_row_layouts_in_radgridview_for_wpf.aspx

However, my application refuses to compile as it does not recognize the ColumnName property used in the GridViewCell tag.

I've looked at the GridViewCell object in the object browser and cannot see the property there either. Has this been replaced with some other method of referencing the column from within a style?

Many thanks,
Peter.
Vlad
Telerik team
 answered on 04 Feb 2010
4 answers
100 views
Hi there,

Has anyone attempted to use the Telerik Radcontrols with the techniques and patterns presented in the Microsoft Composite Application Library? I'm interested in using the docking manager, ribbon control and chart controls from Radcontrols in a dual-deployed WPF/Silverlight app, but am very interested in employing the techniques presented in CAL to give a nicely decoupled, super maintainable distributed system. 

Any thoughts on this?
Thanks,
Andrew
Valentin.Stoychev
Telerik team
 answered on 04 Feb 2010
1 answer
75 views
We would like to use the GridView control in our application to display and edit the information for Tasks associated with Projects for a Customer. Each task may have subtasks that are associated with it (for example, "Task A" has subtasks "Task A1" and "Task A2". There are fields to be loaded into the GridView that would need to be maintained at the Main Task level ("Task A") and there are fields that need to be maintained at the Sub Task Level ("Task A1" or "Task A2"). However, when we group the data in the GridView by Main Task, the Sub Tab rows are expandable but the Main Task level doesn't display any of the data associated with the Data record. It shows as a seperate line in the Sub Task area. Is it possible to have the Main Task level retain the columns and the ability to edit it while also having the Sub Task rows be expandable beneath it?

Any information would be greatly appreciated.

Thanks.

TWBS
Pavel Pavlov
Telerik team
 answered on 04 Feb 2010
8 answers
332 views
I have the following problem:

I open big window with a radgrid. and when i resize the window (reduce the width) the grid's margins is outside the window.
It happens with all grids. I tried to "play" with width, max width etc but it doesn't help

See attached file.

This is the code for opening the window

        private int resolutionWidth = 1920;
        private int resolutionHeight = 1200;

            var mainWindow = new TaskbarRadWindow
            {
                Content = contect,
                Header = title,
                WindowState = WindowState.Normal,
                Width = resolutionWidth,
                Height = resolutionHeight,
                MaxWidth = resolutionWidth,
                MaxHeight = resolutionHeight,
            };

Thanks,
Ofer
ofer alper
Top achievements
Rank 1
 answered on 04 Feb 2010
1 answer
215 views
My intention is to use the 'DisplayValueHolder.DisplayValue' for the filter list user interface and 'DisplayHolder.ID' for creating a query which will return the filtered data.

        public class DisplayValueHolder
        {
             public string ID{get;set;}
             public string Value{get;set;}
        }

Is it possible to use the GridView's 'DistinctValuesLoading' event to return a collection of objects like DisplayValueHolder  which contains different values for display and the data?

Nikhil

Rossen Hristov
Telerik team
 answered on 04 Feb 2010
1 answer
147 views

Using a radial gauge that has a scale of 0 to 12, and a radialrange of 10 to 12. I get the following problems. The needle is not pointing to the right tick...is always off...like 4 will point to almost 4.5. Also the radialrange is off as well, it start around 10.3 instead of 10.

Anybody has seen this kind of issue? This is with 2009 Q3 SP1


<

 

telerik:RadGauge Width="150" Height="150" Margin="628.459,0,575.115,71.681" Name="radGauge1" VerticalAlignment="Bottom" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

 

 

 

<telerik:RadialGauge>

 

     

<telerik:RadialScale Name="radialScale" Min="0" Max="12">

 

         

<telerik:IndicatorList>

 

            

<telerik:Needle x:Name="needle" Value="4"/>

 

         

</telerik:IndicatorList>

 

 

         <telerik:RangeList>

 

             

<telerik:RadialRange Min="10"

 

                             

Max="12.0"

 

                             

Location="OverCenter"

 

                             

StartWidth="0.1"

 

                             

EndWidth="0.1"

 

                             

Background="Red"

 

                             

BorderBrush="Red"

 

                             

StrokeThickness="1"

 

                             

TickBackground="White"/>

 

 

         </telerik:RangeList>

 

     

</telerik:RadialScale>

 

 

</telerik:RadialGauge>
</telerik:RadGauge>

 

 

 

 

 

Ves
Telerik team
 answered on 04 Feb 2010
1 answer
143 views
This should be an easy thing to solve, yet I can't find any info about it. How do I set the distance or padding between items in the RadCarousel (not RadCarouselPanel)?
Vlad
Telerik team
 answered on 04 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?