Telerik Forums
UI for WPF Forum
5 answers
155 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
485 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
151 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
137 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
86 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
84 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
119 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
99 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
141 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
135 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
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?