Telerik Forums
UI for WinForms Forum
1 answer
142 views
My issues are 2 fold... first, I've created a Custom appointment dialog by implementing the EditAppointmentDialog.  My recurrence button is turned on and I can use that interface to set the recurrence properties.  When I try to save the data during the ApplySettingsToEvent() event, all of my Recurrence propertes in the targetEvent (RecurrencRule, RecurrenceId) are null.  But, in the UI on the radScheduler the recurring appointments show correctly.  How do I retrieve my recurrence information so that I may persist this data?

My second issue is that I also have a custom appointment object that enherits from Telerik.WinControls.UI.Appointment.   In my radScheduler1_AppointmentEditDialogShowing() event I receive an error of "Unable to cast object type of 'Telerik.WinControls.UI.Appointment' to type 'CoachDashboard.CustomAppointment'".  My CustomAppointment class inherits from Telerik.WinControls.UI.Appointment.  Why would I get this error?  The only difference is that this appointment is a recurring appointment now.  It works fine when I don't set any recurrence.

Ivan Todorov
Telerik team
 answered on 17 Apr 2012
1 answer
239 views
Hello,

I would like to have my gridview cell contents wrap. When I set the column WrapText = true there is no padding around the cells and the text hits the border.

I tried setting the cell padding using the CellFormatting event but then the WrapText doesn't happen and the cell uses ellipse.

Can I have both?

Thanks,
Beth

This does not work

void radGridView_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            e.CellElement.Padding = new Padding(3, 3, 5, 3);
            if (e.ColumnIndex != 0)
            {
                e.Column.WrapText = true;
            }
        }
Stefan
Telerik team
 answered on 17 Apr 2012
6 answers
147 views
Hi everyone,
I am using radGrid to exibit information of people! one of the fields is Mobile that is thought to be Numeric and limited digits. So I am using GridviewMaskboxColumn by following code :

GridViewMaskBoxColumn mobileColumn = new GridViewMaskBoxColumn();
            mobileColumn.HeaderText = "Mobile#";
            mobileColumn.MaxLength = 10;
            mobileColumn.FieldName = "MobileNo";
            mobileColumn.MaskType = MaskType.Numeric;
            mobileColumn.Mask = "G";
            grid.Columns.RemoveAt(10);
            grid.MasterTemplate.Columns.Insert(10, mobileColumn);

Everything's fine but The Maxlength doesn't work! I mean when you want to edit MobileNo, you can enter digits more than 10!
Any ideas?!

Thanks
Peter
Telerik team
 answered on 17 Apr 2012
1 answer
145 views
Hi,

I am using a RadPropertyGrid and have set the SelectedObject to be an object with a DateTime property. I would like this DateTime property to be displayed using en-GB culture (formatted as dd/MM/yyyy) but I cannot find a way to change this from the default MM/dd/yyyy.

I assume that I'm missing something fairly obvious! Any help would be much appreciated.

Thanks,

Chris.
Ivan Petrov
Telerik team
 answered on 17 Apr 2012
1 answer
144 views
I am implementing drag and drop operations between 2 radlistboxes based on the demo with the DragDropManager...
The implementation works fine but i run into a problem when there are more items in the list than the visible area...
specifically getting the upperbound of the visualitem
source code from demo is...

int UpperBound = visualReplacedItem.Bounds.Height * this.targetListBox.Items.IndexOf(this.replacedItem);

the problem is the second part (index of) could return a large number when a list contains 200 items causing the feedback form to draw off the visible area...

is there a visualitems index or something i can reference instead to keep the feedback form in the visible area of the RadListBox?

My feel is that even the demo would not work properly if the lists contained enough items to cause scrolling...
Peter
Telerik team
 answered on 17 Apr 2012
5 answers
194 views
What would be the best way to print a RadCalendar?  Ideally, I could throw a read-only version of the calendar I created on a report.

The function of my current sub-project is to print out an on-call schedule each month (to be passed around to various departments, etc.).  The entry form allows the user to double click a day in the calendar and add an assignment ... and that form looks good.  Now I go to print it, and I can't find anything on RadCalendar that allows for printing or easy export to PDF/DOC/image, and I go to Reporting and there is nothing that is easily time-based.

I could create a report kludge of generic textboxes for each possible permutation of the calendar, then do the computations to figure out which box goes in which, then fill it out, but ... geez.  Surely there is a built-in way to do this that I'm missing.

Thoughts?
Peter
Telerik team
 answered on 17 Apr 2012
1 answer
94 views
Hello,
I am trying to do SelfReference and adding relation together in the grid.
I have 2 collection: ProjectTemplate and ProjectTask. Each of these 2 contains selfreference 2 each other and they also have relation between them.Checkout code snipet below.
Note: "ProjectContract" is datacontract containing these 2 collection.
"ProjectContract.TemplateContracts" is ProjectTemplate Collection and"ProjectContract.TaskContracts" is ProjectTask Collection.
radGridView1.MasterTemplate.DataSource = ProjectContract.TemplateContracts;
 radGridView1.MasterTemplate.Templates.Add(new GridViewTemplate() { DataSource = ProjectContract.TaskContracts });
 radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate, "ProjectTemplateId", "ParentProjectTemplateId");
 radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate.Templates[0], "ProjectTaskId", "ParentProjectTaskId");
 var relation = new GridViewRelation(radGridView1.MasterTemplate, radGridView1.MasterTemplate.Templates[0])
     {
     RelationName = "TemplateTask"
     };
relation.ParentColumnNames.Add("ProjectTemplateId");
relation.ChildColumnNames.Add("ParentProjectTemplateId");
radGridView1.Relations.Add(relation);

I am getting somewhat desirable result. I am getting self hierarchy of ProjectTemplate and relation of template and task. But i am unable to get self hierarchy of Project Task.
Please checkout image attached below for more clarification.

Thanks,
Julian Benkov
Telerik team
 answered on 17 Apr 2012
3 answers
353 views
Hello!
I have a problem with RadMultiColumnCombobox.
I'm using Telerik Control Q2 2011 and VS 2010.
I have a form like the below code:

            Form f1 = new Form();
            RadDock rd1 = new RadDock();
            rd1.Dock = DockStyle.Fill;
            DocumentWindow dw1 = new DocumentWindow();
            rd1.AddDocument(dw1);
            DocumentWindow dw2 = new DocumentWindow();
            rd1.AddDocument(dw2);
            RadMultiColumnComboBox cbx1 = new RadMultiColumnComboBox();
            dw1.Controls.Add(cbx1);
            cbx1.DataSource = GetAllCountries(); (I get list items in the database)
            f1.Controls.Add(rd1);
            f1.Show();

When I select one item in cbx1 and do a drag-drop action in dw1, cbx1 will always automatically select the first item.
If anyone has a suggestion, please let me know.

Thanks!

Svett
Telerik team
 answered on 17 Apr 2012
3 answers
89 views
Hi,

I have a text inside a cell, composed of two dates. What I want is to format first date and the second one with different colors and size.

Thanks
Stefan
Telerik team
 answered on 17 Apr 2012
1 answer
590 views
Hi,

I have an RadDropDownList filled with some items using DataSource and bounded functionality.
When I in the SelectedIndexChanged event tries to reset the selectedvalue to the original (the one before i changed), the control simply wont listen to my commands ;) 

This is the code I use in the SelectedIndexChanged event:
void AgreementRadDropDownSelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
    if (_init || _selectedAgreement == (int)AgreementRadDropDown.SelectedValue) return;
 
    if (MessageBox.Show("Do you want to change the agreement?", "Change Agreement", MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.No)
    {
        AgreementRadDropDown.SelectedValue = _selectedAgreement;
        return;
    }
    _selectedAgreement = (int)AgreementRadDropDown.SelectedValue;
}

The rest of the code of the form is here:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Telerik.WinControls.UI;
 
namespace TestDropDownList
{
    public partial class Form1 : Form
    {
        private readonly IList<Agreement> _agreements = new List<Agreement>();
        private int _selectedAgreement;
        private readonly bool _init = false;
 
        public Form1()
        {
            _init = true;
            InitializeComponent();
            AgreementRadDropDown.ItemDataBound += AgreementRadDropDownItemDataBound;
            AgreementRadDropDown.SelectedIndexChanged += AgreementRadDropDownSelectedIndexChanged;
            LoadAgreements();
            _selectedAgreement = 2;
 
            AgreementRadDropDown.SuspendUpdate();
            AgreementRadDropDown.DisplayMember = "Name";
            AgreementRadDropDown.ValueMember = "Id";
            AgreementRadDropDown.DataSource = _agreements;
 
            AgreementRadDropDown.SelectedValue = _selectedAgreement;
            AgreementRadDropDown.ResumeUpdate();
            _init = false;
        }
 
        void AgreementRadDropDownSelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            if (_init || _selectedAgreement == (int)AgreementRadDropDown.SelectedValue) return;
 
            if (MessageBox.Show("Do you want to change the agreement?", "Change Agreement", MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.No)
            {
                AgreementRadDropDown.SelectedValue = _selectedAgreement;
                return;
            }
            _selectedAgreement = (int)AgreementRadDropDown.SelectedValue;
        }
 
        private void LoadAgreements()
        {
            _agreements.Add(new Agreement(1, "Agreement1", Properties.Resources._lock));
            _agreements.Add(new Agreement(2, "Agreement2", Properties.Resources._lock));
            _agreements.Add(new Agreement(3, "Agreement3", Properties.Resources.lock_unlock));
            _agreements.Add(new Agreement(4, "Agreement4", Properties.Resources._lock));
            _agreements.Add(new Agreement(5, "Agreement5", Properties.Resources.lock_unlock));
            _agreements.Add(new Agreement(6, "Agreement6", Properties.Resources._lock));
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
             
        }
 
        static void AgreementRadDropDownItemDataBound(object sender, ListItemDataBoundEventArgs args)
        {
            var item = args.NewItem.DataBoundItem as Agreement;
            if (item != null)
                args.NewItem.Image = item.StatusImage;
        }
    }
 
    public class Agreement
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public Image StatusImage { get; set; }
 
        public Agreement(int id, string name, Image statusImage)
        {
            Id = id;
            Name = name;
            StatusImage = statusImage;
        }
    }
}
namespace TestDropDownList
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
 
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
 
        #region Windows Form Designer generated code
 
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.AgreementRadDropDown = new Telerik.WinControls.UI.RadDropDownList();
            ((System.ComponentModel.ISupportInitialize)(this.AgreementRadDropDown)).BeginInit();
            this.SuspendLayout();
            //
            // AgreementRadDropDown
            //
            this.AgreementRadDropDown.DropDownAnimationEnabled = true;
            this.AgreementRadDropDown.Location = new System.Drawing.Point(48, 37);
            this.AgreementRadDropDown.Name = "AgreementRadDropDown";
            this.AgreementRadDropDown.ShowImageInEditorArea = true;
            this.AgreementRadDropDown.Size = new System.Drawing.Size(222, 20);
            this.AgreementRadDropDown.TabIndex = 0;
            this.AgreementRadDropDown.Text = "radDropDownList1";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(318, 167);
            this.Controls.Add(this.AgreementRadDropDown);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(this.AgreementRadDropDown)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
 
        }
 
        #endregion
 
        private Telerik.WinControls.UI.RadDropDownList AgreementRadDropDown;
    }
}


I use two images in my project.. they are attached here and need to be added to the resource file of the project to make this look like the one i have here :)

What am i doing wrong?

Regards
Svein Thomas
Peter
Telerik team
 answered on 17 Apr 2012
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
Iron
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
Iron
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?