Telerik Forums
UI for WinForms Forum
1 answer
80 views
Hi Telrik Member:
 
I created “Appointments_CollectionChanged” function to instead “AppointmentResized“ event before Updated Telerik. 

Reference paper: http://www.telerik.com/forums/appointmentresized-event
 
After updated telerik dll on 25/06/2014, “AppointmentResizeEnd” event will be fired  when user resized the appointment. 

But it still be fired “AppointmentResizeEnd” event when the user just selected the appointment. 

Is it a wrong behavior?

customerID:QD1612651
Ivan Todorov
Telerik team
 answered on 26 Jun 2014
2 answers
266 views
Hi there,

i want to add some Control fields to my RadGroupBox.

The Admin can change the fields in a form which a regular user can see.

These fields are saved in a database. 

So i added a empty RadGroupBox to my control with the following changed settings:

AutoSize = True
Visible = False

I found an example in the forum but that didn't work for me:

Using dataContext = New DataContext()
            Dim fields = dataContext.tblDynamicFields.Where(Function(x) x.PageID = 1 And x.Active = True)
            If fields.Count > 0 Then
                Me.DynamicFieldGroupBox.Visible = True
            Else
                Return
            End If

            For Each field In fields
                Dim label = New RadLabel
                label.Text = field.Name
                Me.DynamicFieldGroupBox.Controls.Add(label)
                Me.DynamicFieldGroupBox.Controls.Add(New RadTextBox)
            Next
End Using

I currently have 3 Fields in my table, and they are all loaded from the datacontext.

The visibility is fine. The GroupBox is shown, but the Elements i have added are all stacked together. I have attached a picture showing my problem



Thanks a lot

Dk
Top achievements
Rank 1
 answered on 26 Jun 2014
1 answer
288 views
Hi,

I want to use multiple CollapsiblePanel on a form, all of them are loaded collapsed. The ExpandDirection is "down". If I open the first one I want to second (and also the others) to move down, starting below the first CollapsiblePanel. What is the best way to do this? Either witch CollapsiblePanel is open, the folowing have to start below of opened one.

Thanks!

Oliver
Stefan
Telerik team
 answered on 26 Jun 2014
1 answer
65 views
What does Tools > Generate Repository... do?

In a typical Windows UX, the user should expect a dialog to come up after an ellipses in the menu.  Clicking that menu item does nothing that I can see. 

This is just mostly for my own curiosity.  The "view help" menu item is broken, so I couldn't find information about it there (I reported the help issue to the feedback portal), and there is literally no information at all on Google about it:

https://www.google.com/?q=%22Visual+Style+Builder%22+%22Generate+Repository%22#q=%22Visual+Style+Builder%22+%22Generate+Repository%22

Thanks
Stefan
Telerik team
 answered on 26 Jun 2014
1 answer
166 views
I have a RadScheduler with a datasource initated like this:

private void InitiateBookingDataSource()
        {
            if (_appointmentBookings == null) _appointmentBookings = new BindingList<Booking>();
 
            var dataSource = new SchedulerBindingDataSource();
            var mappingInfo = new AppointmentMappingInfo
                                  {
                                      Start = "StartTime",
                                      End = "EndTime",
                                      Summary = "BookingSubject",
                                      Description = "BookingDescription",
                                      BackgroundId = "BackgroundId",
                                      AllDay = "AllDay",
                                      RecurrenceRule = "RecurrenceRule",
                                      Exceptions = "Exceptions",
                                      MasterEventId = "MasterEventId",
                                      Visible = "Visible"
                                  };
 
            mappingInfo.Mappings.Add(new SchedulerMapping("CaseId", "CaseId"));
            mappingInfo.Mappings.Add(new SchedulerMapping("PratId", "PratId"));
            mappingInfo.Mappings.Add(new SchedulerMapping("BoothId", "BoothId"));
            mappingInfo.Mappings.Add(new SchedulerMapping("CaseDesc", "CaseDesc"));
            mappingInfo.Mappings.Add(new SchedulerMapping("BoothDesc", "BoothDesc"));
 
            dataSource.EventProvider.Mapping = mappingInfo;
            dataSource.EventProvider.DataSource = _appointmentBookings;
            dataSource.EventProvider.AppointmentFactory = rsBookings.AppointmentFactory;
 
            rsBookings.DataSource = dataSource;
        }

The appointments are initiated and updated by calling the method below. The problem is that it takes "forever" if the number of appointments exceeds approx 50. Is there a way to speed it up? I have tried async await, but as I am new to that procedure I haven't been able to implement it successfully.

Regards, Jill-Connie Lorentsen
private void InitiateAppointments(IEnumerable<Booking> bookings)
       {
           try
           {
               if (_appointmentBookings == null) _appointmentBookings = new BindingList<Booking>();
                
               rsBookings.Appointments.Clear();
               _appointmentBookings.Clear();
                
               foreach (var booking in bookings)
               {
                   var appointment = booking;
                   appointment.BackgroundId = _booths.Find(b => b.BoothId == booking.BoothId).BackgroundId;
                   appointment.Exceptions.ForEach(b => b.BackgroundId = _booths.Find(x => x.BoothId == b.BoothId).BackgroundId);
                   _appointmentBookings.Add(appointment);
               }
             
           }
           catch (Exception ex)
           {
              MessageBox.Show(ex.Message);
           }            
       }
George
Telerik team
 answered on 26 Jun 2014
3 answers
117 views
Hi,

I'm creating a GridView like MS Excel.
If the user reach the last row and press arrow down it will add new row.
And also i want to apply this add new row on Scrolling.
I'd appreciate if you can help.
Thanks.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Jun 2014
3 answers
269 views
I am trying to set the RadDropDownButton font color by programming by setting  this.btnActionOfDeviceTask.ForeColor,but the font color does change at all, is there the way to set the font color?
            // 
            // btnActionOfDeviceTask
            // 
            this.btnActionOfDeviceTask.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnActionOfDeviceTask.Items.AddRange(new Telerik.WinControls.RadItem[] { 
            this.btnEnableDeviceofTask,
            this.btnDisableDeviceOfTask}
            );
            this.btnActionOfDeviceTask.Location = new System.Drawing.Point(310, 7);
            this.btnActionOfDeviceTask.Name = "btnActionOfDeviceTask";
            this.btnActionOfDeviceTask.Text = "Edit task state";
            this.btnActionOfDeviceTask.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Regular);
            this.btnActionOfDeviceTask.ForeColor = System.Drawing.Color.FromArgb(21, 66, 139);
            this.btnActionOfDeviceTask.BackColor = System.Drawing.Color.Transparent; 
            this.btnActionOfDeviceTask.Size = new System.Drawing.Size(136, 24);
            this.btnActionOfDeviceTask.TabIndex = 77;
            this.btnActionOfDeviceTask.Enabled = false;
Stefan
Telerik team
 answered on 25 Jun 2014
7 answers
1.5K+ views
Hi,

I'm using Version 2011.1.11.419, and have been tasked to do some performance tuning I noticed that the Cellformatting event gets called a bit more often than I would like, especially at form loading.  I found that if I place the code to set the datasource for the radGridView in the load event of the form, that it gets called much more frequently than if placed in the forms constructor.

In the code snippets below, I'm creating a simple grid with 5 columns and 2 rows - all of type GridTextBoxColumn.  When assigning the datasource in the constructor, it generates 25 calls to the CellFormatting event. If I move the datasource assignment to the form load event, it generates 35 calls. The problem is even more pronounced when I call the radGridView.LoadLayout function.  If placed in the constructor,  it still calls the CellFormatting event 25 times, but when I move both the datasource and LoadLayout calls to the form load event, CellFormatting gets called a whopping 90 times!  Note that the xml file that I'm using is nothing crazy - simply the output from saving the contents of this grid in Visual Studio using the radGridView property builder.

I've tried to use  radGridView.BeginInit, and radGridView.SuspendLayout to decrease the number of calls while the grid is being set up, but neither seem to have any effect.  Should I resign myself to moving radGridView code to the forms constructor, or is there a way to accomplish this in the form load event?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
using Telerik.WinControls.UI;
 
 
namespace RadGridTest
{
    public partial class Form1 : Form
    {
 
        private Telerik.WinControls.UI.RadGridView radGridView1;
        private int execCount = 0;
        private int beginTime;
        private int endTime;
        private BindingList<MyData> list;
 
        public Form1()
        {
           beginTime = Environment.TickCount;
           InitializeComponent();
 
           list = new BindingList<MyData>(); ;
           for (int i = 0; i <= 1; i++)
           {
               list.Add(new MyData(100, i, i));
           }
           //radGridView1.DataSource = list;
           //radGridView1.LoadLayout("gridFormat.xml");
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            // These commented lines cause much additional overhead in calling the CellFormatting function
            // from the form_load event rather than the constructor.
 
            radGridView1.DataSource = list;
            radGridView1.LoadLayout("gridFormat.xml");
 
 
            endTime = Environment.TickCount;
            MessageBox.Show("Load Time: " + (endTime - beginTime).ToString() + Environment.NewLine +
                            "gridformat calls: " + execCount.ToString());
        }
 
        void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
        {
            execCount++;
            if (e.CellElement.ColumnInfo is GridViewDataColumn)
            {
                GridViewDataColumn dataCol = e.CellElement.ColumnInfo as GridViewDataColumn;
                if (e.CellElement.Text != "")
                switch (dataCol.FieldName)
                {
                    case "B": e.CellElement.Text = Convert.ToDecimal(e.CellElement.Value).ToString("C");
                        break;
                    case "D":
                    case "E":
                        if (Convert.ToDecimal(e.CellElement.Value) % 2 == 0)
                            e.CellElement.Text = Convert.ToDecimal(e.CellElement.Value).ToString("#,##0.0000");
                        else
                            e.CellElement.Text = Convert.ToDecimal(e.CellElement.Value).ToString("#,##0.00");
                        break;
                }
            }
        }
 
    }
 
    public class MyData
    {
        public string A { get; set; }
        public int B { get; set; }
        public string C { get; set; }
        public int D { get; set; }
        public int E { get; set; }
 
        public MyData(int b, int d, int e)
        {
            A = "Money";
            B = b;
            C = "Float";
            D = d;
            E = e;
        }
    }
}
  
 
 
// radGridView designer settings below
        #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()
        {
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn5 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            this.radGridView1 = new Telerik.WinControls.UI.RadGridView();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).BeginInit();
            this.SuspendLayout();
            //
            // radGridView1
            //
            this.radGridView1.BackColor = System.Drawing.SystemColors.Control;
            this.radGridView1.Cursor = System.Windows.Forms.Cursors.Default;
            this.radGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.radGridView1.Font = new System.Drawing.Font("Segoe UI", 8.25F);
            this.radGridView1.ForeColor = System.Drawing.SystemColors.ControlText;
            this.radGridView1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.radGridView1.Location = new System.Drawing.Point(0, 0);
            //
            // radGridView1
            //
            this.radGridView1.MasterTemplate.AutoGenerateColumns = false;
            gridViewTextBoxColumn1.FieldName = "A";
            gridViewTextBoxColumn1.FormatInfo = new System.Globalization.CultureInfo("");
            gridViewTextBoxColumn1.FormatString = "";
            gridViewTextBoxColumn1.HeaderText = "column1";
            gridViewTextBoxColumn1.Name = "column1";
            gridViewTextBoxColumn1.Width = 76;
            gridViewTextBoxColumn2.FieldName = "B";
            gridViewTextBoxColumn2.FormatInfo = new System.Globalization.CultureInfo("");
            gridViewTextBoxColumn2.FormatString = "";
            gridViewTextBoxColumn2.HeaderText = "column2";
            gridViewTextBoxColumn2.Name = "column2";
            gridViewTextBoxColumn2.Width = 81;
            gridViewTextBoxColumn3.FieldName = "C";
            gridViewTextBoxColumn3.FormatInfo = new System.Globalization.CultureInfo("");
            gridViewTextBoxColumn3.FormatString = "";
            gridViewTextBoxColumn3.HeaderText = "column3";
            gridViewTextBoxColumn3.Name = "column3";
            gridViewTextBoxColumn3.Width = 82;
            gridViewTextBoxColumn4.FieldName = "D";
            gridViewTextBoxColumn4.FormatInfo = new System.Globalization.CultureInfo("");
            gridViewTextBoxColumn4.FormatString = "";
            gridViewTextBoxColumn4.HeaderText = "column4";
            gridViewTextBoxColumn4.Name = "column4";
            gridViewTextBoxColumn4.Width = 90;
            gridViewTextBoxColumn5.FieldName = "E";
            gridViewTextBoxColumn5.FormatInfo = new System.Globalization.CultureInfo("");
            gridViewTextBoxColumn5.FormatString = "";
            gridViewTextBoxColumn5.HeaderText = "column5";
            gridViewTextBoxColumn5.Name = "ProgressBar";
            gridViewTextBoxColumn5.Width = 88;
            this.radGridView1.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
            gridViewTextBoxColumn1,
            gridViewTextBoxColumn2,
            gridViewTextBoxColumn3,
            gridViewTextBoxColumn4,
            gridViewTextBoxColumn5});
            this.radGridView1.Name = "radGridView1";
            this.radGridView1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 1);
            this.radGridView1.ReadOnly = true;
            this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.No;
            //
            //
            //
            this.radGridView1.RootElement.Padding = new System.Windows.Forms.Padding(0, 0, 0, 1);
            this.radGridView1.ShowGroupPanel = false;
            this.radGridView1.Size = new System.Drawing.Size(599, 416);
            this.radGridView1.TabIndex = 0;
            this.radGridView1.Text = "radGridView1";
            this.radGridView1.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.radGridView1_CellFormatting);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(599, 416);
            this.Controls.Add(this.radGridView1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit();
            this.ResumeLayout(false);
 
        }
 
        #endregion

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jun 2014
2 answers
210 views
For C# winforms.
I wanted to check for each cells in a RadGridView. Wanted to add a eventhandler, once all data dataloaded.
For the cell with value "Completed" I would like to change the cell into a button, lets say a radButton named "radButtonView".

Anyone have any idea how to do that?
A simple example will do :)
Jacky
Top achievements
Rank 1
 answered on 24 Jun 2014
1 answer
173 views
I am having a problem using filtering with a column which has a DataTypeConverter specified.

My object has a bool value which I have bound to a text box column.  I use a TypeConverter to convert this bool to a string (and back); true converts to "group", false converts to "individual".  This works fine except when I try to use filtering.  I chose "equals" and entered "individual"; I expected my type converter to be called so it could convert "invidual" to false, but the type converter was not getting called at all.  When I entered "false" into the filter my type converter was finally called but was passed a bool; it wanted me to convert bool to bool?!.  It seems that the filter is converting the string to bool itself and not using my type converter.  After I typed in "false" the filter showed "Equals: individual" and seemed to work correctly. 

This  behavior is a problem since I cannot ask my end users to type in "true" and "false" and remember which maps to which display value.  It seems like not using my specified TypeConverter to convert the string back to the match value is a bug. 

Can you suggest a work around?  Will this be fixed?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jun 2014
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)
Chart (obsolete as of Q1 2013)
Form
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
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?