Telerik Forums
UI for WPF Forum
9 answers
469 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
135 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
126 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
1 answer
76 views
Hi

I have noticed that there is a difference between Q2 and Q3 on selecting a row;

In the Q2 release, the row becomes selected

  • when the user clicks the leftmost bar which does not have any data
  • when the user clicks on one of the cells in that row

 

In the Q3 release, the row only becomes selected when the user clicks on one of the cells in that row.

This means that the user can no longer drag data from the leftmost column which is probably the most intuitive way to do it. Is there any way to recreate this behavior in Q3?
Milan
Telerik team
 answered on 08 Dec 2009
1 answer
76 views
I have a column of a datagrid called "product" that can include only two values: "new" or "old".

How can I implement a function that count only the rows where product is "new"?

Please help me!

Thanks
Stefan Dobrev
Telerik team
 answered on 08 Dec 2009
1 answer
104 views
Hello,

we are using a RadTreeView with Columns and we see a very strange behaviour. 
Some of the items of the tree view are initially expande by setting IsExpanded to true in their Constructor (we use a TreeViewModel). When a values of the properties binded to the treeView changes, it works fine for all items, except for the  ones that were initially expanded. No data update is performed. It seems as if the bindings were lost.
If we remove the IsExpanded in the constructor, the binding seems to be ok, but we need to expand some of the items initially.

What can we do?

Best regards,
Jerma
Kiril Stanoev
Telerik team
 answered on 08 Dec 2009
1 answer
81 views
Hi,

Our application has a Telerik Tree and Grid. We allow drag and drop between the Tree and Grid and within the tree. When we drag and drop into the tree and node over which it moves gets auto expanded. How can we prevent this?

We saw a solution for a similar problem on the ASP .NET forum.
http://www.telerik.com/community/forums/aspnet-ajax/treeview/prevent-auto-expand-of-nodes-during-drag-and-drop.aspx


Is there one for WPF?

Thanks,
-Sunandini
Kiril Stanoev
Telerik team
 answered on 08 Dec 2009
3 answers
128 views
The documentation shipped with the RadControls for WPF Q3 2009, shows an image depicting the Group Aggregates right aligned.

ms-help://telerik.windows.controls/telerik.windows.controls.gridview/gridview-grouping-aggregates.html

No where in the documentation can I find how this is accomplised.
Could this be clarified?  If this can be done, how?
Pavel Pavlov
Telerik team
 answered on 07 Dec 2009
2 answers
126 views
How do I hide the negative values line (the y-axis zero) introduced with the Q3.2009 version?

Thanks
Greg
Gregory Greg
Top achievements
Rank 1
 answered on 07 Dec 2009
1 answer
84 views
Hello,

I'm working on styling the RadGridView items to go with our color theme. I'm having trouble finding the right item to style the popup for the filter. I'm looking to change the popup corner radius, background, foreground and scroll bars. I tried using the FilterControl template. it worked but the combobox's and DistinctValuesList aren't populated with anything. Not sure what I'm doing wrong.

Thanks much
~Boots
Kalin Milanov
Telerik team
 answered on 07 Dec 2009
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?