Telerik Forums
UI for WPF Forum
1 answer
424 views
Hello
I have a Hierarchy grid
I add a MouseDoubleClick event both to my
parent and child grids
the problem is
when I double click the child
the event raise twice, once to the child and then to the parent.
Milan
Telerik team
 answered on 10 Dec 2009
1 answer
133 views
I have in my .xaml the following code:

<telerik:RadGridView x:Name="radGridView1" IsReadOnly="True" Grid.Column="1" Grid.Row="1" Margin="0,0,0,5" Grid.RowSpan="3"
    <telerik:RadGridView.Columns> 
                
    <telerik:GridViewDataColumn Header="Mesa" DataMemberBinding="{Binding mesa}"
        <telerik:GridViewColumn.AggregateFunctions> 
            <telerik:CountFunction Caption="# Registros encontrados: " /> 
        </telerik:GridViewColumn.AggregateFunctions>      
    </telerik:GridViewDataColumn> 
    <telerik:GridViewDataColumn x:Name="efectivo" Header="efectivo" DataMemberBinding="{Binding efectivo}"
        <telerik:GridViewColumn.AggregateFunctions> 
            <telerik:SumFunction Caption="Total: " /> 
        </telerik:GridViewColumn.AggregateFunctions> 
    </telerik:GridViewDataColumn> 

    .
    .
    .
    .

the count function works but the sum function doesn't, it says in spanish something like "There isn't a 'Sum' method in the 'System.Linq.Enumerable' type, compatible with the specified arguments."
The ItemSource that i'm binding is an Arraylist that contains objects of an object type that i created.


ArrayList listaMesas = Oper_SoftCount.consultarFecha(dt); 
this.radGridView1.ItemsSource = listaMesas


and the other problem is that the columns that have the aggregate functions, duplicate.

<telerik:GridViewDataColumn Header="Mesa" DataMemberBinding="{Binding mesa}">
                    <telerik:GridViewColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="# Registros encontrados: " />
                    </telerik:GridViewColumn.AggregateFunctions>     
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn x:Name="efectivo" Header="efectivo" DataMemberBinding="{Binding efectivo}">
                    <telerik:GridViewColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="Total: " />
                    </telerik:GridViewColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
Rossen Hristov
Telerik team
 answered on 10 Dec 2009
2 answers
149 views
Hello

The SelectedItem property of the treeview does not always contain what I would expect.
Examples:
  1. Cancel Selection
    The ItemsSource property is bound to a collection containing A and B objects. I want that only the A object are selectable. The B objects are just for information. I use the following code:
    void radTreeView_PreviewSelected(object sender, Telerik.Windows.RadRoutedEventArgs e) 
      // get a reference to the item that will be selected   
      RadTreeViewItem itemToSelect = e.OriginalSource as RadTreeViewItem;   
     
      // check item that will be selected   
      if (itemToSelect != null && itemToSelect.Item is B) 
      { 
        e.Handled = true
      } 
    However, the SelectedItem property contains the B object afterwards. I would expect the SelectedItem property to be null.
  2. Remove the selected item from the bound collection
    If I remove the currently selected item from the bound collection, then the node has disappeard as I expected, but the SelectedItem property still contains the removed object. I would expect, that the SelectedItem property always contains objects that are also in the ItemsCollection or null otherwise.

How should I handle these use cases? Binding to another property?

Best regards,
Franziska
Franziska
Top achievements
Rank 1
 answered on 10 Dec 2009
0 answers
69 views
Our latest Q3 2009 SP1 release (version 2009.3.1208) uses WCF RIA Services Beta for Visual Studio 2008 SP1. In other words, you should install this WCF RIA Services to be able to load our demos locally.

Please use the URL above to go to the download page of WCF RIA Services Beta for Visual Studio 2008 SP1.
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 10 Dec 2009
1 answer
143 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
291 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
183 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
243 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
109 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
139 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
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?