Telerik Forums
UI for WinForms Forum
2 answers
250 views

I would like to use the ChartView control to create charts of time line data. The SQL database that I am querying against has a data point for every minute for thousands of counters.  For space savings, the application that stores the data does not create a record if the value of the data points is ZERO for that minute.  For this data, that is a savings of more than 75%.

When creating a line chart, is it possible to have RadChartView treat the missing data points with the value of ZERO?  In my test application, ChartView seems to approximate the missing values and simply draws a straight line between the two point that do have a value.  This is not an accurate representation of the data. What I need is from the line chart to go to 0 for the minutes there there is no data.

I've used other charting applications that have this capability.

Chris

 

Chris Ward
Top achievements
Rank 1
 answered on 16 Jan 2019
8 answers
230 views

Hello
I have some problem with displaying RadGroupBox on HDPI that host in UserControl/System.Windows.Form and must be AutoSize = true.
In our scenario, the RadGroupBox contains RadLabel and must change size depending on the size of the text. So we set AutoSize = true. However such RadGroupBox have incorrect font scaling in the header, the font becomes at least 2 times larger than it should be, and if GB is in the scrolling container (like in the example below) even larger. 

If groupbox is hosted in RadForm the bug is not reproducible. 

I use Telerik 2018.3.1016.20 with .Net 3.5 
I very much rely on your help and advice.

Here are examples of my code and screenshots from different DPI. 

100% (Form) https://c2n.me/3Z4oYcS
100% (RadForm) https://c2n.me/3Z4p2L0
200% (Form) https://clip2net.com/s/3Z4pjSv
200% (RadForm) https://clip2net.com/s/3Z4pbV0

using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.Primitives;
using Telerik.WinControls.UI;
 
namespace PP.DesignExamples.BugsForTelerik
{
    public class Form6 : Form
    {
        private RadScrollablePanel actionsScroll;
        private RadGroupBox gbAutosizeTrue;
        private RadLabel lblAutosizeTrueContent;
        private RadGroupBox gbAutosizeFalse;
        private RadLabel lblAutosizeFalseContent;
 
        public Form6()
        {
            InitializeComponent();
        }
 
        private void InitializeComponent()
        {
            actionsScroll = new RadScrollablePanel();
            gbAutosizeTrue = new RadGroupBox();
            lblAutosizeTrueContent = new RadLabel();
            gbAutosizeFalse = new RadGroupBox();
            lblAutosizeFalseContent = new RadLabel();
            ((ISupportInitialize)(actionsScroll)).BeginInit();
            actionsScroll.PanelContainer.SuspendLayout();
            actionsScroll.SuspendLayout();
            ((ISupportInitialize)(gbAutosizeTrue)).BeginInit();
            gbAutosizeTrue.SuspendLayout();
            ((ISupportInitialize)(lblAutosizeTrueContent)).BeginInit();
            ((ISupportInitialize)(gbAutosizeFalse)).BeginInit();
            gbAutosizeFalse.SuspendLayout();
            ((ISupportInitialize)(lblAutosizeFalseContent)).BeginInit();
            SuspendLayout();
            //
            // actionsScroll
            //
            actionsScroll.BackColor = Color.Transparent;
            actionsScroll.Dock = DockStyle.Fill;
            actionsScroll.ForeColor = Color.Transparent;
            actionsScroll.Location = new Point(0, 0);
            actionsScroll.Margin = new Padding(0);
            actionsScroll.MaximumSize = new Size(205, 0);
            actionsScroll.MinimumSize = new Size(205, 0);
            actionsScroll.Name = "actionsScroll";
            actionsScroll.Padding = new Padding(0);
            //
            // actionsScroll.PanelContainer
            //
            actionsScroll.PanelContainer.BackColor = Color.Transparent;
            actionsScroll.PanelContainer.Controls.Add(gbAutosizeTrue);
            actionsScroll.PanelContainer.Controls.Add(gbAutosizeFalse);
            actionsScroll.PanelContainer.Location = new Point(0, 0);
            actionsScroll.PanelContainer.Margin = new Padding(0);
            actionsScroll.PanelContainer.Size = new Size(205, 423);
            //
            //
            //
            actionsScroll.RootElement.MaxSize = new Size(205, 0);
            actionsScroll.RootElement.MinSize = new Size(205, 0);
            actionsScroll.Size = new Size(205, 423);
            actionsScroll.TabIndex = 4;
            ((RadScrollablePanelElement)(actionsScroll.GetChildAt(0))).Padding = new Padding(0);
            ((FillPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(0))).Visibility = ElementVisibility.Hidden;
            ((BorderPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(1))).Width = 0F;
            ((BorderPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(1))).LeftWidth = 0F;
            ((BorderPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(1))).TopWidth = 0F;
            ((BorderPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(1))).RightWidth = 0F;
            ((BorderPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(1))).BottomWidth = 0F;
            ((BorderPrimitive)(actionsScroll.GetChildAt(0).GetChildAt(1))).Visibility = ElementVisibility.Hidden;
            //
            // gbAutosizeTrue
            //
            gbAutosizeTrue.AccessibleRole = AccessibleRole.Grouping;
            gbAutosizeTrue.AutoSize = true;
            gbAutosizeTrue.BackColor = Color.Transparent;
            gbAutosizeTrue.Controls.Add(lblAutosizeTrueContent);
            gbAutosizeTrue.Dock = DockStyle.Top;
            gbAutosizeTrue.GroupBoxStyle = RadGroupBoxStyle.Office;
            gbAutosizeTrue.HeaderText = "AutoSize = true";
            gbAutosizeTrue.Location = new Point(0, 100);
            gbAutosizeTrue.MinimumSize = new Size(0, 100);
            gbAutosizeTrue.Name = "gbAutosizeTrue";
            gbAutosizeTrue.Padding = new Padding(4, 28, 4, 0);
            //
            //
            //
            gbAutosizeTrue.RootElement.AutoSize = false;
            gbAutosizeTrue.RootElement.MinSize = new Size(0, 100);
            gbAutosizeTrue.Size = new Size(205, 100);
            gbAutosizeTrue.TabIndex = 8;
            gbAutosizeTrue.Text = "AutoSize = true";
            ((RadGroupBoxElement)(gbAutosizeTrue.GetChildAt(0))).Padding = new Padding(4, 28, 4, 0);
            ((FillPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(0).GetChildAt(0))).BackColor = Color.FromArgb(176, 223, 226);
            ((GroupBoxHeader)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1))).GroupBoxStyle = RadGroupBoxStyle.Office;
            ((GroupBoxHeader)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1))).ForeColor = Color.DodgerBlue;
            ((FillPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(0))).BackColor = Color.Transparent;
            ((FillPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(0))).SmoothingMode = SmoothingMode.None;
            ((FillPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(0))).AutoSize = true;
            ((FillPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(0))).Margin = new Padding(0);
            ((TextPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Text = "AutoSize = true";
            ((TextPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).LineLimit = false;
            ((TextPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Font = new Font("Arial", 11.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
            ((TextPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Margin = new Padding(7, 0, 0, 0);
            ((TextPrimitive)(gbAutosizeTrue.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Alignment = ContentAlignment.MiddleLeft;
            //
            // lblAutosizeTrueContent
            //
            lblAutosizeTrueContent.Dock = DockStyle.Top;
            lblAutosizeTrueContent.Location = new Point(4, 28);
            lblAutosizeTrueContent.Margin = new Padding(16);
            lblAutosizeTrueContent.Name = "lblAutosizeTrueContent";
            //
            //
            //
            lblAutosizeTrueContent.RootElement.MaxSize = new Size(0, 0);
            lblAutosizeTrueContent.Size = new Size(197, 18);
            lblAutosizeTrueContent.TabIndex = 2;
            lblAutosizeTrueContent.Text = "description will be here";
            ((RadLabelElement)(lblAutosizeTrueContent.GetChildAt(0))).TextAlignment = ContentAlignment.MiddleLeft;
            ((RadLabelElement)(lblAutosizeTrueContent.GetChildAt(0))).Text = "description will be here";
            ((FillPrimitive)(lblAutosizeTrueContent.GetChildAt(0).GetChildAt(0))).AutoSizeMode = RadAutoSizeMode.Auto;
            ((FillPrimitive)(lblAutosizeTrueContent.GetChildAt(0).GetChildAt(0))).StretchHorizontally = false;
            //
            // gbAutosizeFalse
            //
            gbAutosizeFalse.AccessibleRole = AccessibleRole.Grouping;
            gbAutosizeFalse.BackColor = Color.Transparent;
            gbAutosizeFalse.Controls.Add(lblAutosizeFalseContent);
            gbAutosizeFalse.Dock = DockStyle.Top;
            gbAutosizeFalse.GroupBoxStyle = RadGroupBoxStyle.Office;
            gbAutosizeFalse.HeaderText = "AutoSize = false";
            gbAutosizeFalse.Location = new Point(0, 0);
            gbAutosizeFalse.MinimumSize = new Size(0, 100);
            gbAutosizeFalse.Name = "gbAutosizeFalse";
            gbAutosizeFalse.Padding = new Padding(4, 28, 4, 0);
            //
            //
            //
            gbAutosizeFalse.RootElement.AutoSize = false;
            gbAutosizeFalse.RootElement.MinSize = new Size(0, 100);
            gbAutosizeFalse.Size = new Size(205, 100);
            gbAutosizeFalse.TabIndex = 8;
            gbAutosizeFalse.Text = "AutoSize = false";
            ((RadGroupBoxElement)(gbAutosizeFalse.GetChildAt(0))).Padding = new Padding(4, 28, 4, 0);
            ((FillPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(0).GetChildAt(0))).BackColor = Color.FromArgb(176, 223, 226);
            ((GroupBoxHeader)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1))).GroupBoxStyle = RadGroupBoxStyle.Office;
            ((GroupBoxHeader)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1))).ForeColor = Color.DodgerBlue;
            ((FillPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(0))).BackColor = Color.Transparent;
            ((FillPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(0))).SmoothingMode = SmoothingMode.None;
            ((FillPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(0))).AutoSize = true;
            ((FillPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(0))).Margin = new Padding(0);
            ((TextPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Text = "AutoSize = false";
            ((TextPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).LineLimit = false;
            ((TextPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Font = new Font("Arial", 11.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
            ((TextPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Margin = new Padding(7, 0, 0, 0);
            ((TextPrimitive)(gbAutosizeFalse.GetChildAt(0).GetChildAt(1).GetChildAt(2).GetChildAt(1))).Alignment = ContentAlignment.MiddleLeft;
            //
            // lblAutosizeFalseContent
            //
            lblAutosizeFalseContent.Dock = DockStyle.Top;
            lblAutosizeFalseContent.Location = new Point(4, 28);
            lblAutosizeFalseContent.Margin = new Padding(16);
            lblAutosizeFalseContent.Name = "lblAutosizeFalseContent";
            //
            //
            //
            lblAutosizeFalseContent.RootElement.MaxSize = new Size(0, 0);
            lblAutosizeFalseContent.Size = new Size(197, 18);
            lblAutosizeFalseContent.TabIndex = 2;
            lblAutosizeFalseContent.Text = "description will be here";
            ((RadLabelElement)(lblAutosizeFalseContent.GetChildAt(0))).TextAlignment = ContentAlignment.MiddleLeft;
            ((RadLabelElement)(lblAutosizeFalseContent.GetChildAt(0))).Text = "description will be here";
            ((FillPrimitive)(lblAutosizeFalseContent.GetChildAt(0).GetChildAt(0))).AutoSizeMode = RadAutoSizeMode.Auto;
            ((FillPrimitive)(lblAutosizeFalseContent.GetChildAt(0).GetChildAt(0))).StretchHorizontally = false;
            //
            // Form6
            //
            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode = AutoScaleMode.Font;
            ClientSize = new Size(311, 423);
            Controls.Add(actionsScroll);
            Name = "Form6";
            Text = "Form6";
            actionsScroll.PanelContainer.ResumeLayout(false);
            actionsScroll.PanelContainer.PerformLayout();
            ((ISupportInitialize)(actionsScroll)).EndInit();
            actionsScroll.ResumeLayout(false);
            ((ISupportInitialize)(gbAutosizeTrue)).EndInit();
            gbAutosizeTrue.ResumeLayout(false);
            gbAutosizeTrue.PerformLayout();
            ((ISupportInitialize)(lblAutosizeTrueContent)).EndInit();
            ((ISupportInitialize)(gbAutosizeFalse)).EndInit();
            gbAutosizeFalse.ResumeLayout(false);
            gbAutosizeFalse.PerformLayout();
            ((ISupportInitialize)(lblAutosizeFalseContent)).EndInit();
            ResumeLayout(false);
 
        }
    }
}

 

Hristo
Telerik team
 answered on 16 Jan 2019
1 answer
364 views

In native WinForm forms, a property called AutoValidate can be changed to EnableAllowFocusChange to allow users to continue to other controls if validation fails for an errorProvider.

I am trying to mimic this behavior with radGridView. Currently, users are unable to move onto other cells or rows, or other controls outside of the gridView until they input correct data into the cell.

I want to be able to allow the user to work on other things, add rows, edit cells on a new row or an existing row, etc without forcing them to input something just to get rid of the validation. Only at the end of the process would I loop through all controls and cells to see if an error exists, and remind the user before they can continue on.

This is so that the user doesn't put in erroneous data into the cell just so they can move on. For example, if they do not know what the account code is for an item, they would have to ask someone else and this may take some time. They should be able to work on other things on the form in the mean time.

I've tried cancelling the editor and calling EndEdit on the current active editor, but this isn't working. Users are still locked in on a cell if validation failed. How do I allow the user to get out of the cell even if an error exists?

See below on what I have tried:

   if (e.Row is GridViewDataRowInfo)
                    {
                        if (detailValidation.IsEmptyInput(((string)e.Value), out errorMsg) || (!detailValidation.IsValidDecimalFormat(((string)e.Value), out errorMsg)))
                        {
                            e.ActiveEditor.EndEdit();
                            e.Cancel = true;
                            var test = e.ActiveEditor as RadTextBoxEditor;

                            currentCell.BackColor = Color.FromArgb(255, 221, 221);
                            ((GridViewDataRowInfo)e.Row).ErrorText = errorMsg;
                            
                           
                        }
                        else
                        {
                            ((GridViewDataRowInfo)e.Row).ErrorText = string.Empty;
                        }
                    }
                   


Dimitar
Telerik team
 answered on 16 Jan 2019
7 answers
382 views
Hi,

Is it possible to have custom column types in your grid?
I need to a column that in edit mode is a drop down list of values, with each entry being color coded. I need to then convert the selected value to an enum
I made a custom column based on your GridViewComboBoxColumn, which is displaying the list of values okay, but when I select one, I can't seem to cast it to an enum
And I can't change the colors because I don't seem to have access to the combo box itself.  It looks like I would have if I could write an editor based on RadComboBoxEditor, but then I can't find a way to associate the editor with the column?

any help/suggestions much appreciated.

thanks

noha
Top achievements
Rank 1
 answered on 14 Jan 2019
1 answer
233 views
I need to count items (rows) inside radlistview1
Dimitar
Telerik team
 answered on 14 Jan 2019
11 answers
154 views

Hi,

I have this problem:

In a Form with a RadDock, in this RadDock two ToolWindows with one button each and two DocumentWindows. In a DocumentWindow, a RadGridView.

The RadGridView is with the event UserAddingRow:

private void RadGridView1_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e)
 {
     if (e.Rows.Count() > 0 && e.Rows[0].Cells["Id"].Value == null)
     {
         e.Cancel = true;
         this.radGridView1.GridNavigator.Select(this.radGridView1.MasterView.TableAddNewRow, this.radGridView1.Columns["Id"]);
         this.radGridView1.BeginEdit();
     }
 }

 

If you are editing a new row in the RadGridView with the value of "Id" null and you click on a button or in the tab of the other DocumentWindow, you don't stay in the new row. And the UserAddingRow event is fired many time.

Why? How to edit the column "Id" of the new row if you validate by clicking in other control?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Jan 2019
0 answers
69 views

Hello everyone,

   When I run WinForm, the interface can perform related operations, but when I operate, the mouse will display refresh status;

how to change the mouse display mode to cursor display;

hong
Top achievements
Rank 1
 asked on 14 Jan 2019
4 answers
87 views

Hi ,

I used following link.

https://www.telerik.com/support/kb/winforms/gridview/details/creating-a-radradiobuttoncellelement

I want to do readonly for this column . I put readonly = true but still can click radiobutton. May I know how to do this column readonly true.

 

Thanks

Moe

Moe
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 14 Jan 2019
2 answers
887 views
In MDI parent form, if the MDI child form is maximized, the child form is getting merged with the parent menu bar. Can you please help to get a separate menu bar for the MDI child form too. Please check and do the needful.
Hristo
Telerik team
 answered on 11 Jan 2019
2 answers
274 views

hi 

 

i have a problem i want save my data from gridview to dabase including update, deleting a row and adding a row

i populate radgridview from a datatable.

 

my delete button is click event on a image 

and my addnew row is the button from da radgridview

the add new row works almost fine (the click event are not firing on the images.) but add the row to the database.

the delete "button" remove the row from datagrid but is not working removing from the database only radgrid,

is there way i can add delete and update radgridview and then i press a button and update the database?

 

 

 

Pedro Filipe
Top achievements
Rank 1
 answered on 11 Jan 2019
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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
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
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?