Telerik Forums
UI for WinForms Forum
4 answers
682 views

Hello,

 

I have a gridview which display workitemdata. The columns are "The client", "The service contract", "The Employee", "The Date", "Hours", "Description", "price hour" and "Value (price hour * hours). The client, service contract and employee are ID value not string.

 

I have made a three level grouping on Client, service contract and Employee.

 

I have added a summary row for displaying the total of Value by group and an Handler on GroupSummaryEvaluate for displaying an human readable string instead of ID.

 

But I'm stuck on these problems:

  1. I want only to display the subtotal (the summaryRow) on the client group level (last level). The showParentGroupSummaries properties work for each level (true) or the first level (false).
  2. The GroupSummaryEvaluate handler change the display string of my group header AND my summaryRow.
  3. What are the options for formatting my summaryRow (like text alignment, font, ...)
  4. The group sort my values on ID (column value) before grouping. Is there a way to sort on the readable string after the grouping. I could use a numeric enumeration based on my string instead of an ID for grouping. Just asking if there is a kick tip about this :-)

I join two picture (GroupSummaryEvaluate active/not active) and some code.

Imports System.Data.Objects
Imports Telerik.WinControls.UI
Imports Telerik.WinControls.Data
 
Public Class View_ValorisationTravail
 
    Private _datactx As IconEntities
    Public ReadOnly Property InnerDataContext As IconEntities
        Get
            Return _datactx
        End Get
    End Property
 
    Private _dataquery As ObjectQuery(Of Travail)
    Public Property DataQuery As ObjectQuery(Of Travail)
        Get
            Return _dataquery
        End Get
        Set(value As ObjectQuery(Of Travail))
            If _dataquery Is Nothing AndAlso value IsNot Nothing Then
                _dataquery = value
                OnDataqueryChanged()
            End If
            If Not _dataquery.Equals(value) Then
                _dataquery = value
                OnDataqueryChanged()
            End If
        End Set
    End Property
 
    Private Sub View_ValorisationTravail_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not Me.DesignMode Then
            _datactx = New IconEntities(GetConnection())
 
            'Temporaire en attendant les filtres
            Me.DataQuery = GenerateDataQuery()
        End If
 
        IntitialiseGroupValorisationTravaux(Me.RadGridView1)
 
        Dim summaryItem As New GridViewSummaryItem("Valeur", "{0:N2} CHF", GridAggregateFunction.Sum)
        Dim summaryItemLabel As New GridViewSummaryItem("CHFparheure", "TOTAL", GridAggregateFunction.Sum)
        Dim summaryRowItem As New GridViewSummaryRowItem()
        summaryRowItem.Add(summaryItem)
        summaryRowItem.Add(summaryItemLabel)
        Me.RadGridView1.SummaryRowsBottom.Add(summaryRowItem)
        Me.RadGridView1.MasterTemplate.ShowParentGroupSummaries = True
    End Sub
 
    Private Sub OnDataqueryChanged()
        Me.RadGridView1.DataSource = DataQuery.Execute(MergeOption.OverwriteChanges).ToList
    End Sub
 
    ''' <summary>
    ''' Generating an ObjectQuery for test purpose
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function GenerateDataQuery() As ObjectQuery(Of Travail)
        Dim query = From c In _datactx.Travail
                    Select c
 
        Return query
    End Function
 
    Private GroupClientDescriptor As GroupDescriptor
    Private GroupPrestationDescriptor As GroupDescriptor
    Private GroupCollaborateurDescriptor As GroupDescriptor
 
    ''' <summary>
    ''' Build the group
    ''' </summary>
    ''' <param name="aGridView"></param>
    ''' <remarks></remarks>
    Private Sub IntitialiseGroupValorisationTravaux(aGridView As RadGridView)
        aGridView.EnableGrouping = True
        aGridView.AutoExpandGroups = True
        aGridView.GroupDescriptors.Clear()
 
        Dim SortClientDescriptor As New SortDescriptor("Client", System.ComponentModel.ListSortDirection.Ascending)
        GroupClientDescriptor = New GroupDescriptor()
        GroupClientDescriptor.GroupNames.AddRange(New Telerik.WinControls.Data.SortDescriptor() {SortClientDescriptor})
 
        Dim SortPrestationDescriptor As New SortDescriptor("Prestation", System.ComponentModel.ListSortDirection.Ascending)
        GroupPrestationDescriptor = New GroupDescriptor()
        GroupPrestationDescriptor.GroupNames.AddRange(New Telerik.WinControls.Data.SortDescriptor() {SortPrestationDescriptor})
 
        Dim SortCollaborateurDescriptor As New SortDescriptor("Collaborateur", System.ComponentModel.ListSortDirection.Ascending)
        GroupCollaborateurDescriptor = New GroupDescriptor()
        GroupCollaborateurDescriptor.GroupNames.AddRange(New Telerik.WinControls.Data.SortDescriptor() {SortCollaborateurDescriptor})
 
        aGridView.GroupDescriptors.AddRange(New Telerik.WinControls.Data.GroupDescriptor() {GroupClientDescriptor, GroupPrestationDescriptor, GroupCollaborateurDescriptor})
    End Sub
 
    Private Sub Travaux_GroupSummaryEvaluate(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GroupSummaryEvaluationEventArgs) Handles RadGridView1.GroupSummaryEvaluate
        If e.Group.GroupDescriptor.Equals(GroupClientDescriptor) Then
            If e.Group.ItemCount > 0 AndAlso e.Group.Item(0).DataBoundItem IsNot Nothing Then
                e.FormatString = CType(e.Group.Item(0).DataBoundItem.Client, Client).Display
            End If
        ElseIf e.Group.GroupDescriptor.Equals(GroupPrestationDescriptor) Then
            If e.Group.ItemCount > 0 AndAlso e.Group.Item(0).DataBoundItem IsNot Nothing Then
                e.FormatString = CType(e.Group.Item(0).DataBoundItem.Prestation, Prestation).Display
            End If
        ElseIf e.Group.GroupDescriptor.Equals(GroupCollaborateurDescriptor) Then
            If e.Group.ItemCount > 0 AndAlso e.Group.Item(0).DataBoundItem IsNot Nothing Then
                e.FormatString = CType(e.Group.Item(0).DataBoundItem.ContratEngagement.Collaborateur, Collaborateur).DisplayName
            End If
        End If
    End Sub
 
End Class
Julian Benkov
Telerik team
 answered on 29 Mar 2013
1 answer
92 views
Hello 
In my website I have lots of pages using Comboox component
Users browsing with IExplorer 10 have revealed that the combo were empty, even if they are correctly bound to sql database
I do not have IE10; with Chrome, Firefox and former versions of IExplorer all is OK.
How can i fix this 'bug'? Is it just a problem of Sitefinity updates?
Is it possible to force a WebApplication to open in IE10 in compatibility mode?
Thanks in advance
Diego
Pavel Benov
Telerik team
 answered on 29 Mar 2013
5 answers
254 views
I am getting this error in my designer file.

            //
            // radPageViewPage_Template
            //
// TODO: Code generation for '' failed because of Exception 'Invalid Primitive Type: System.IntPtr. Consider using CodeObjectCreateExpression.'.
            this.radPageViewPage_Template.Controls.Add(this.radGridView_PlanTemplates);
            this.radPageViewPage_Template.Location = new System.Drawing.Point(10, 37);
            this.radPageViewPage_Template.Name = "radPageViewPage_Template";
            this.radPageViewPage_Template.Size = new System.Drawing.Size(307, 502);
            this.radPageViewPage_Template.Text = "Templates";
Jack
Telerik team
 answered on 28 Mar 2013
9 answers
233 views
Is there a way to change the Navigation text for the Month view to not show the dates but rather the month as in Outlook


Stefan
Telerik team
 answered on 28 Mar 2013
3 answers
138 views
How to set font styles with colors while grouping Grid View Rows??
Jack
Telerik team
 answered on 27 Mar 2013
3 answers
726 views
Hello,

in my DataGridView I have a column for E-Mail adresses. The user clicks on the E-Mail adress and my programm opens a new E-Mail.
When the mouse is over the E-Mail adress I have this CellMouseMove Event to change the Cursor (to Cursor.Hand): 
private void dg_CustomerContact_CellMouseMove(object sender, MouseEventArgs e)
        {
            GridDataCellElement cell = this.dg_CustomerContact.RootElement.ElementTree.GetElementAtPoint(e.Location) as GridDataCellElement;
            if (cell != null && ((GridViewDataColumn)cell.ColumnInfo).Name == "dg_TalkedWith_col_Email")
            {
                originalCursor = this.dg_CustomerContact.Cursor;
                this.dg_CustomerContact.Cursor = Cursors.Hand;
            }
            else
            {
                if (originalCursor != null)
                {
                    this.dg_CustomerContact.Cursor = originalCursor;
                    originalCursor = Cursors.Default;
                }
            }
        }


But when there is no E-Mail adress the cursor should not change to "Cursor.Hand". Any suggestion how to solve this?
Anton
Telerik team
 answered on 27 Mar 2013
5 answers
266 views
Using the custom editor code sample for Telerik winforms found on the Telerik website, I override the BaseInputEditor
to provide my propertyGrid with a trackbar editor.

Now, I implemented the onEditorRequired method as explained to replace the basic edition mode for
any int property.

I'm using the RadPropertyStore mechanism to fill my property grid.

I've no problem with having the value displayed as a number when the editor is not activated, but I'm
not willing to have the value being displayed underneath the track bar as I'm editing the value.

Anyway, I would be looking for having the track bar always displayed even if the property is not being
edited as it will be used for an opacity setting.

Thanks in advance,
Antoine



Anton
Telerik team
 answered on 27 Mar 2013
1 answer
147 views
Hello,

I only want one given resource to be viewed at any point on the scheduler. I have multiple resources, but I cannot seem to find out how to toggle which resource should be viewed. It just shows the first resource I added to the collection, and then at runtime I can't see a way to toggle between those resources:



Also, I forgot to dereference a radscheduler from a navigator, and now I am unable to add a new radschedulenavigator from the toolbox as many exceptions will be thrown:

Julian Benkov
Telerik team
 answered on 27 Mar 2013
1 answer
217 views
Hello,

I am building an application that show a school's courses, and the date they fall on is not relevant. I only need to show them on the correct day of the week that they take place. How can I customize the scheduler to only show one week and that's it (i.e. Mon-Sun) and ignore any specific week of the year.

Also, since the courses will be appointment objects on the scheduler, I am wondering if it is possible to have one appointment show up on two different days. That is to say, some courses take place on Monday AND Wednesday, so when I click on either one to move them, can I make them both respond and move together, acting as one entity?

Thanks for any help and keep up the good work Telerik.


EDIT: I figured out the first part but really could use some help with making two appointments on different days act as one.
Julian Benkov
Telerik team
 answered on 27 Mar 2013
1 answer
142 views
The attached picture is a ribbon bar chunk in an application we purchased.  I would like to copy that style on one of my ribbon bar chunks.  I haven't found out how to make the separator and the smaller button elements.  How can I do that?

Thank you,
Gary
Anton
Telerik team
 answered on 27 Mar 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?