Telerik Forums
UI for WPF Forum
1 answer
153 views
Hi there,

Has anybody else have had issues setting the DisplayDateEnd of the RadDatePicker to a date in the past? Whenever I do it, I get an ArgumentOutOfRangeException : Invalid DisplayDateEnd value. Paramter name: sender.

I'm using ver 2009.2.1002.35

Thank you very much,
Peter

PS - Here is the stack trace :
 at Telerik.Windows.Controls.RadCalendar.OnDisplayDateEndChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\Input_WPF_2009_Q2_SP2\Sources\Development\Controls\Input\Calendar\RadCalendar.cs:line 3042
   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 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.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 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.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.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 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.ContextLayoutManager.UpdateLayout()
   .
   .
   .
Kaloyan
Telerik team
 answered on 10 Dec 2009
3 answers
306 views
Hello,

I need to change visual style of line chart. I want to change size and fill of circle points, lines between points may remain unchanged.

I'm not sure what control I should template, because changing template of whole telerik:Line destroys all the lines between points and also Y positions of points are wrong.

Some example, like in your Demo application (Custom Bar Template) would be great.

Thank you!


Dwight
Telerik team
 answered on 10 Dec 2009
1 answer
192 views
Hi Telerik

In the following xaml I have set up a RadGridView with two columns:

       <t:RadGridView ItemsSource="{Binding Persons}"  ActionOnLostFocus="CommitEdit" AutoGenerateColumns="False" > 
            <t:RadGridView.Columns> 
                <!-- Auto column --> 
                <t:GridViewDataColumn DataMemberBinding="{Binding Path=ID}"  /> 
                <!-- Manual column --> 
                <t:GridViewDataColumn DataMemberBinding="{Binding Name}"
                    <t:GridViewDataColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="{Binding Name}" /> 
                        </DataTemplate> 
                    </t:GridViewDataColumn.CellTemplate> 
                    <t:GridViewDataColumn.CellEditTemplate> 
                        <DataTemplate> 
                            <TextBox Text="{Binding Name,Mode=TwoWay}" /> 
                        </DataTemplate> 
                    </t:GridViewDataColumn.CellEditTemplate> 
                </t:GridViewDataColumn> 
            </t:RadGridView.Columns> 
        </t:RadGridView>       

This xaml was placed in a window with the following code behind:

using System.Collections.ObjectModel; 
using System.Windows; 
 
namespace WpfApplication2 
    /// <summary> 
    /// Interaction logic for MainWindow.xaml 
    /// </summary> 
    public partial class MainWindow : Window 
    { 
        public MainWindow()        { 
            InitializeComponent(); 
            this.DataContext = this
        } 
 
        public ObservableCollection<Employee> Persons 
        { get { return EmployeeService.GetEmployees(); } } 
 
    } 
    public class Employee    { 
        public int ID { getset; } 
        public string Name { getset; } 
    } 
    public class EmployeeService    { 
        public static ObservableCollection<Employee> GetEmployees() 
        { 
            ObservableCollection<Employee> employees = new ObservableCollection<Employee>(); 
            Employee employee = new Employee(); 
            employee.Name = "Maria"
            employee.ID = 24890; 
 
            employees.Add(employee); 
            employee = new Employee(); 
            employee.Name = "Ana"
            employee.ID = 23890; 
 
            employees.Add(employee); 
            employee = new Employee(); 
            employee.Name = "Antonio"
            employee.ID = 24890; 
 
            employees.Add(employee); 
            employee = new Employee(); 
 
            return employees; 
        } 
    } 
 

Now if you run this code you will notice that the two DataGrid columns behave differently when you are updating them. As I understand, when ActionOnLostFocus is set to "CommitEdit" the cell being edited should save its new value when it looses focus. The cells in the first column behave in this fashion, however those in the second column do not - Each reverts to its old value whenever it looses focus.

Why is this? How do I change the behavior of the cells in the second column so that each cell saves its new value when focus is transfered elsewhere?

Cheers

Bob
Nedyalko Nikolov
Telerik team
 answered on 09 Dec 2009
2 answers
260 views
When I update a field in a WPF datagrid that's associated with a dataset the corresponding field in the underlying datatable is also modified after I issue a commitedit.
When I delete a column in the grid the corresponding column in the datatable is still present. Am I responsible for deleting the datatable column or am I doing something wrong?

Jorge Gonzalez
Top achievements
Rank 1
 answered on 09 Dec 2009
4 answers
123 views
Hello,
I have a problem exporting to a text file while grouping the data.

<!-- Window1.xaml --> 
<Window x:Class="WpfTelerikRadGridViewTest.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    Title="Window1" Width="800" Height="600" > 
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition /> 
            <RowDefinition Height="Auto" /> 
        </Grid.RowDefinitions> 
        <telerik:RadGridView Name="radGridView1" ItemsSource="{Binding}" /> 
        <Button Grid.Row="1" Click="ButtonBase_OnClick">Save</Button> 
    </Grid> 
</Window> 


// Window1.xaml.cs  
public partial class Window1  
{  
    public Window1()  
    {  
        InitializeComponent();  
 
        var list = new ObservableCollection<string>();  
 
        list.Add("HELLO1");  
        list.Add("HELLO2");  
        list.Add("HELLO3");  
        list.Add("HELLO4");  
        list.Add("HELLO5");  
 
        DataContext = list;  
    }  
 
    private void ButtonBase_OnClick(object sender, RoutedEventArgs e)  
    {  
        var s = radGridView1.ToText();  
    }  

When i press the save button the variable 's' gets the _correct_ value:
"\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\nHELLO4\r\nHELLO5\r\n"

When i press the save button while grouping the column i get the following value on 's': 
"\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\nHELLO4\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\nHELLO4\r\nHELLO5\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\nHELLO4\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\n\r\nHELLO1\r\n\r\nHELLO1\r\nHELLO2\r\nHELLO3\r\nHELLO4\r\nHELLO5\r\n"

This means that i cant export a grid if the user is grouping. I thought that it would generate a sorted grid. This behavior also applies to ToHtml.
Robert
Top achievements
Rank 1
 answered on 09 Dec 2009
2 answers
152 views
how can i make the Text inside  the GridViewDataColumn.Header wrap?

i think something can be done with the GridViewHeaderCell but i didn't managed to make it work

igal a
Top achievements
Rank 1
 answered on 09 Dec 2009
5 answers
166 views
Hi everybody,

I am trying to set up RadGridView as a multi-column tree-view for a self-referencing scenario. I need to make grid columns to be aligned for all the child and parent rows. So if I drag a column gridline then I would expect the gridline to stay straight across all the rows, both parent and child. We are talking about the same column and I need it to behave like one. How can I do this?
Also, when I set frozen columns then child rows would keep sliding past the freeze line (I guess this is part of the same task: treat parent and child columns with the same name as the same visual column).

The final task is when I can get this 'same column' behavior then I need to be able to sort, filter, etc, i.e. do common grid operations.
(Note: I can sort on different columns in the 'SelfReference' example in the Examples_WPF.CS demo but the result of sorting does make much sense when you expand child rows).

Has anybody been able to address this task before? Could you please share your experience/knowledge?

Regards,
g8r.
Gennady Ralko
Top achievements
Rank 1
 answered on 09 Dec 2009
9 answers
497 views
Hi,

I've embedded a fairly simple example of an issue we have in the greater solution.

The Context:
Using a datatable as the source.
Adding a summary row for Hours (Int32)
Get the error:No method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied arguments.

<Window x:Class="Window1"    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"    
    xmlns:telerikdata="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data" 
    Title="Window1" WindowState="Maximized">  
    <Grid> 
        <telerik:RadGridView      
                        AutoGenerateColumns="False"    
                        HorizontalAlignment="Right"      
                        IsFilteringAllowed="False"    
                        CanUserFreezeColumns="False"      
                        CanUserReorderColumns="False"      
                        IsEnabled="True"    
                        ColumnsWidthMode="Auto"    
                        ShowColumnFooters="True" 
                        CanUserSortColumns="False"                     
                        ShowGroupPanel="False"    
                        ItemsSource="{Binding Tables[Labour.EmployeeLeave]}"    
                        > 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewComboBoxColumn      
                                Header="Employee"      
                                DataMemberBinding="{Binding [EmpNum], Mode=TwoWay}"    
                                SelectedValueMemberPath="EmpNum"    
                                DisplayMemberPath="Fullname"    
                                ItemsSource="{Binding}"      
                                DataContext="{Binding Tables[Labour.Employee]}"/>  
                <telerik:GridViewDataColumn Header="Leave Type" UniqueName="LeaveCode" /> 
                <telerik:GridViewDataColumn Header="Date From" UniqueName="DateFrom" /> 
                <telerik:GridViewDataColumn Header="Date To" UniqueName="DateTo" /> 
                <telerik:GridViewDataColumn   
                    Header="Hours"   
                    DataMemberBinding="{Binding [Hours], Mode=TwoWay}" > 
                    <telerik:GridViewDataColumn.AggregateFunctions> 
                        <telerikdata:SumFunction Caption="Total: " SourceField="Hours" /> 
                    </telerik:GridViewDataColumn.AggregateFunctions> 
                </telerik:GridViewDataColumn> 
                <telerik:GridViewDataColumn Header="Pay In Advance" UniqueName="PayInAdvance"/>  
                <telerik:GridViewDataColumn Header="Comments" UniqueName="Comments" /> 
                <telerik:GridViewDataColumn Header="Total Made" UniqueName="TotalMade" /> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window>    
 

Imports System.Data  
 
Class Window1  
 
    Public Sub New()  
        InitializeComponent()  
        Dim ds As New DataSet  
        Dim dt As New DataTable("Labour.Employee")  
        Me.BuildEmployeesTable(dt)  
        ds.Tables.Add(dt)  
        dt = New DataTable("Labour.EmployeeLeave")  
        Me.BuildEmployeeLeaveTable(dt)  
        ds.Tables.Add(dt)  
        Me.DataContext = ds  
    End Sub 
 
    Private Sub BuildEmployeesTable(ByVal dt As DataTable)  
        dt.Columns.Add("EmpNum"GetType(System.Int32))  
        dt.Columns.Add("Firstname"GetType(System.String))  
        dt.Columns.Add("Surname"GetType(System.String))  
        dt.Columns.Add("Fullname"GetType(System.String), "Firstname+' '+Surname")  
        Me.AdddEmployeesRow(dt, 1, "Joe""Blogs")  
        Me.AdddEmployeesRow(dt, 2, "John""Doe")  
        Me.AdddEmployeesRow(dt, 3, "Mary""May")  
    End Sub 
 
    Private Sub BuildEmployeeLeaveTable(ByVal dt As DataTable)  
        dt.Columns.Add("EmpNum"GetType(System.Int32))  
        dt.Columns.Add("LeaveCode"GetType(System.String))  
        dt.Columns.Add("DateFrom"GetType(System.DateTime))  
        dt.Columns.Add("DateTo"GetType(System.DateTime))  
        dt.Columns.Add("Hours"GetType(System.Int32))  
        dt.Columns.Add("PayInAdvance"GetType(System.Boolean))  
        dt.Columns.Add("Comments"GetType(System.String))  
        dt.Columns.Add("TotalMade"GetType(String), "Comments+Hours")  
        Me.AdddEmployeeLeaveRow(dt, 1, "sss", Now, Now, 55, True"comment")  
        Me.AdddEmployeeLeaveRow(dt, 2, "sss", Now, Now, 22, True"comment")  
        Me.AdddEmployeeLeaveRow(dt, 3, "sss", Now, Now, 33, True"comment")  
    End Sub 
 
    Private Sub AdddEmployeesRow(ByVal dt As DataTable, ByVal id As IntegerByVal fname As StringByVal lname As String)  
        Dim dr As DataRow = dt.NewRow()  
        dr("EmpNum") = id  
        dr("Firstname") = fname  
        dr("Surname") = lname  
        dt.Rows.Add(dr)  
    End Sub 
 
    Private Sub AdddEmployeeLeaveRow(ByVal dt As DataTable, ByVal id As IntegerByVal LeaveCode As StringByVal DateFrom As DateTime, ByVal DateTo As DateTime, ByVal Hours As IntegerByVal PayInAdvance As BooleanByVal Comments As String)  
        Dim dr As DataRow = dt.NewRow()  
        dr("EmpNum") = id  
        dr("LeaveCode") = LeaveCode  
        dr("DateFrom") = DateFrom  
        dr("DateTo") = DateTo  
        dr("Hours") = Hours  
        dr("PayInAdvance") = PayInAdvance  
        dr("Comments") = Comments  
        dt.Rows.Add(dr)  
    End Sub 
 
End Class 
 

The last issue I had with datasets had a fairly simple fix. Hope this is the same.

Regards,
Nic Roche
Dean
Top achievements
Rank 1
 answered on 09 Dec 2009
4 answers
158 views
Hi,

I'm using a RadTreeView with IsDragDropEnabled ="True" and need to limit dragging and dropping for certain items. Tried to attach to 
            RadDragAndDropManager.AddDragQueryHandler(...); 
            RadDragAndDropManager.AddDragInfoHandler(...); 
            RadDragAndDropManager.AddDropQueryHandler(..); 
            RadDragAndDropManager.AddDropInfoHandler(...); 
 
and manipulate with e.QueryResult but it does not take any effect. All the items are allowed to be dragged and dropped anywhere inside the treeview. 

I followed the sample and it does work for the GridView but doesn't on a TreeView.

Thanks,
Ruben.

rubenhak
Top achievements
Rank 1
 answered on 08 Dec 2009
2 answers
163 views
Hi..
1. Do have any examples of Multi Column Combo box in a GridView?
2. How do 'select' or 'set focus' to the combo box so it is visible in a row?
3. How can I pull multiple values from the combo box and populate other columns in the selected Row with the values?

thanks in advance
Jon
Top achievements
Rank 1
 answered on 08 Dec 2009
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?