Telerik Forums
UI for WinForms Forum
7 answers
107 views

Hello Telerik Team


Small introduction:

I plan to use a RadCalendard on a project for display and edit the public holiday over a year. The list of public holiday is stored in a SQL database (one row is one day) and the data are fetch with EntityFramework. These days are also listed on a listview (with a filter based on the current year displayed on the calendard) for a different point of view. To add a new public holiday, has to doubleclick on the corresponding date in the calendar.

My RadYearCalendar is called YearCalendar

The public holiday are store in an entity called Jourferie with the following properties :

  • ID As Integer
  • Jour As Date
  • Description As String
  • IsPaid As Boolean

The ToString() Function have an override for displaying the date and the description of a Jourferie

My Radlistview is called ListJourFerie

I use a modal forms Add_Jourferie to get the description and the IsPaid properties when a new public holiday is added.

On this project I use Aqua theme (Not the best choice I agree, but my end-users love Appel's Stuff so...)

I appologize for the frenchy comments on my code !

Okay, so what I have done (could help someone else):

  • A multiview calendard which display 12 month from january to december, with a correct year navigation.
  • Fetch the data in my database, populate the special date and my listview.
Private Sub View_Calendrier_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    'We do not want to bind to database in design mode !
    If Not Me.DesignMode Then
        _datactx = New IconEntities(ConnectionManager.GetConnection())
        'Charge les données des jours feriés
        Me.ListJourFerie.DataSource = _datactx.Jourferie.OrderBy(Function(c) c.Jour)
        Me.YearCalendar.SpecialDays.Clear()
        For Each holidayDay As JourFerie In _datactx.Jourferie
            Me.YearCalendar.SpecialDays.Add(New RadCalendarDay(holidayDay.Jour))
        Next
        'Déplace le calendrier sur l'année courante
        Me.YearCalendar.FocusedDate = New Date(Today.Year, 1, 1)
    End If
End Sub
  • Filtering my listview using the period displayed on the calendard
Private Sub YearCalendar_ViewChanged(sender As System.Object, e As System.EventArgs) Handles YearCalendar.ViewChanged
    If Not Me.YearCalendar.IsLoaded Then Exit Sub
    Try
        'Active le filtrage si nécessaire
        If Not Me.ListJourFerie.EnableFiltering Then Me.ListJourFerie.EnableFiltering = True
        'Supprime les filtres actifs
        Me.ListJourFerie.FilterDescriptors.Clear()
        'Filtre la liste afin d'afficher les enregistrements selon l'affichage du calendrier
        Me.ListJourFerie.FilterDescriptors.Add("Jour",
                                               Telerik.WinControls.Data.FilterOperator.IsGreaterThanOrEqualTo,
                                               Me.YearCalendar.DefaultView.Children(0).ViewStartDate)
        Me.ListJourFerie.FilterDescriptors.Add("Jour",
                                               Telerik.WinControls.Data.FilterOperator.IsLessThanOrEqualTo,
                                               Me.YearCalendar.DefaultView.Children(11).ViewEndDate)
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Exclamation, ex.GetType.ToString)
    End Try
End Sub
  • Creation of a new public holiday on doubleclick over a date
    Private Sub YearCalendar_DoubleClick(sender As System.Object, e As Windows.Forms.MouseEventArgs) Handles YearCalendar.MouseDoubleClick
            Dim cell As CalendarCellElement = TryCast(Me.YearCalendar.ElementTree.GetElementAtPoint(e.Location), CalendarCellElement)
      
            If cell IsNot Nothing AndAlso Not cell.VisualState.Contains("Header") Then
                Dim formAddJour As New Add_Jourferie()
                formAddJour.Jour.Text = cell.Date.ToShortDateString
                If formAddJour.ShowDialog() = DialogResult.OK Then
                    Dim newrecord As New JourFerie() With {.Jour = cell.Date,
                                                                   .Description = formAddJour.Description.Text,
                                                                   .IsPaid = formAddJour.IsPaid.Checked}
                    _datactx.Jourferie.AddObject(newrecord)
                    Try
                        _datactx.SaveChanges()
                        Me.YearCalendar.SpecialDays.Add(New RadCalendarDay(newrecord.Jour))
                        Me.ListJourFerie.DataSource = _datactx.Jourferie.OrderBy(Function(c) c.Jour)
                    Catch ex As UpdateException
                        MsgBox(String.Format("{0}{1}{2}", ex.Message, vbNewLine, ex.InnerException.Message), MsgBoxStyle.Exclamation, ex.GetType.ToString())
                        _datactx.Jourferie.DeleteObject(newrecord)
                    End Try
      
                End If
            End If
        End Sub
  • But I need some help for :

     

    • To hidde CellEment (also SpecialDays) in a CalendarTableElement when the day don't belong to the month. The default theme show a different style for theses days, but not Aqua theme. Also some specials days are displaying twice (on two CalendarTableElement) and this make the calendar not very clear. My boss will thinks that's there are too much public holiday and will make a heart attack.
    • The focused date and today should display as other date because these informations are usless (in my case of course) and could hide a public holiday.
    • Adding bold to month name.
    • Change style on the weekend's CellElement
    • Change style on the specialDay's CellElement (I don't really like the dark blue)

     

    By the way... : 

    • Having a fast CalendardDayCollection.AddRange(IEnumerable Of Date) function would be great ! I haven't find something else than than an old "For Each Next Loop" for adding SpecialDays from my datasource. Each date takes 200 ms to add. It's not really fast.
    • The listview do not update when it's databound to a ObjectSet (even with a datasource = Nothing and datasource = ObjectSet !). I have to use ObjectSet.Tolist() for a correct update. I Don't know if it is a correct behavior?

    .

     

    Ivan Petrov
    Telerik team
     answered on 15 Jan 2013
    2 answers
    156 views
    In addition to the options of group by Year, Quarter, Month or Day; I would like to be able to group by week.
    Jos
    Top achievements
    Rank 1
     answered on 15 Jan 2013
    2 answers
    203 views
    Hi,

    I would like to have three split panels in a split container, where I will be able to move the middle split panel as if it was a spliter , i.e. the middle split panel has a fixed size and moving it up or down, changes the size of the top and bottom split panels. The reason that I want to work this way, is that I want to added controllers to the middle split container ,such as drop down combo box.
    How can this be done?

    Thanks
    Meir
    Adiel
    Top achievements
    Rank 1
     answered on 14 Jan 2013
    1 answer
    121 views
    We are trying to make our WinForrm app look better and support touch in Win8. Will the Telerik theme support do this for us? Will it work with normal WinForm controls or do we have to change everything over to Telerik controls?

    Thanks,
    David
    Ivan Petrov
    Telerik team
     answered on 14 Jan 2013
    1 answer
    173 views
    Is it possible to make vertical scrollbar visible in panorama?.. because I have elements bigger than its workspace height.. and it needed vscrollbar.. i cant find a way to make vscrollbar visible..
    Ivan Todorov
    Telerik team
     answered on 14 Jan 2013
    11 answers
    156 views
    Hello,

    I have crated a RadRibbonBar in a RadRibbonForm and changed WindowState property to Maximized but my auto-hide task-bar will not appeared by the mouse. how could I correct it?

    Regards
    Ivan Todorov
    Telerik team
     answered on 14 Jan 2013
    1 answer
    167 views
    Hello Team

    I got a strange problem with winform  gridview  when exported to .csv , it exported the gridview data to .csv with enclosed quotes,

            "1"     "12.01" "22.01" "33.768"        "2.12344"       "5655.34"
            "1"     "13.01" "23.01" "34.768"        "2.12344"       "5656.34"
            "1"     "14.01" "24.01" "35.768"        "2.12344"       "5657.34"
            "1"     "15.01" "25.01" "36.768"        "2.12344"       "5658.34" 


     i observed that in ASP.NET AJAX gridview there is an option called EncloseDataWithQuotes =True/False, with this we can eliminate the enclosed quotes in the csv

    if winforms gridview also have the same property please tell me where i need to set it???, i checked in the below link, but there is no option to set

    http://www.telerik.com/help/winforms/gridview-exporting-data-export-to-csv.html

    due to the quotes in the data, i couldnt import to mySql database, please suggest the way to eliminate the quotes in .csv file
    here is my code to export to .csv

                     ExportToCSV exporter = new ExportToCSV(this.radGridView1);              
                     string fileName = "C:\\ExportedData.csv";              
                    exporter.RunExport(fileName);



    Plamen
    Telerik team
     answered on 14 Jan 2013
    4 answers
    103 views
    Hello Telerik Team,
    I have a radgridview in my winforms application and i have a requirement where user will copy some fields of data from excel and pastes in the gridview, its is working perfect upto 1000 records pasting with a performance speed up to 40 sec, but when tried to paste more than 1000 it is taking time in minutes, after tried of pasting rows  more than 8000 , the form is not responding and application has hanged

    i need the feature exactly how excel interacts with clipboard, but is there any limitation in clip board copy and pasting to radgird ??? i have checked the below possible threads, but couldn't find the answer

    http://www.telerik.com/community/forums/winforms/gridview/paste-from-excel.aspx

    http://www.telerik.com/support/kb/winforms/gridview/copy-pasting-rows-in-and-between-radgridviews-csv-format.aspx

    can you please help
    Sree
    Top achievements
    Rank 1
     answered on 14 Jan 2013
    1 answer
    91 views
    hi,
    i have an application where i am creating gridviews at run time. at a given time, the application can have 1 or x number of girdviews, each being hooked with the UserAddedRow event:
    void myGrid_UserAddedRow(object sender, GridViewRowEventArgs e) { }
    

    how can i, using the "sender" or the "e" parementers of the event handler get a reference to the associated GridView? the sender here is a Telerik.WinControls.UI.GridViewTemplate for which i am not able to find a property which would return the GridView object.

    thanks.
    Jack
    Telerik team
     answered on 11 Jan 2013
    3 answers
    62 views
    Why would dragging an appointment in Month-View reset the times for the Appointment

    While dragging the appointment in the Week-view or the Day-view does not change the times 

    How would I resolve this?
    Ivan Todorov
    Telerik team
     answered on 11 Jan 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?