Telerik Forums
UI for WinForms Forum
4 answers
323 views

I need the horizontal axis to be linear in the chart. For example:

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            MakeChart();
        }

        private DataTable _dtChart;

        private void MakeChart()
        {
            _dtChart = new DataTable("Chart");
            var column = new DataColumn("COLUMN0", typeof(DateTime));
            _dtChart.Columns.Add(column);
            column = new DataColumn("COLUMN1", typeof(double));
            _dtChart.Columns.Add(column);
            column = new DataColumn("COLUMN2", typeof(double));
            _dtChart.Columns.Add(column);
            column = new DataColumn("COLUMN3", typeof(double));
            _dtChart.Columns.Add(column);
            _dtChart.BeginLoadData();
            var row = new object[_dtChart.Columns.Count];
            var date = new DateTime(2007, 1, 1);
            row[0] = date; row[1] = 14.163764; row[2] = 13.56391907;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(1); row[1] = 14.16415691; row[2] = 13.56490612;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(2); row[1] = 14.16449642; row[2] = 13.56572723;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(3); row[1] = 14.16489506; row[2] = 13.56701374;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(4); row[1] = 14.16524887; row[2] = 13.56779575;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(5); row[1] = 14.16561508; row[2] = 13.56877995;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(6); row[1] = 14.1659956;  row[2] = 13.56987286; row[3] = 12.9375058;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(7); row[1] = 14.16635513; row[2] = 13.57107353; row[3] = 12.93832116;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(8); row[1] = 14.16672421; row[2] = 13.57207203; row[3] = 12.93914642;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(9); row[1] = 14.16709232; row[2] = 13.57329559; row[3] = 12.93998154;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(10); row[1] = 14.1674614;  row[2] = 13.57457256; row[3] = 12.94082651;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(11); row[1] = 14.16784954; row[2] = 13.57580566; row[3] = 12.94168131;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(12); row[1] = 14.16822338; row[2] = 13.57705879; row[3] = 12.94254593;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(13); row[1] = 14.16857815; row[2] = 13.57775879; row[3] = 12.9441519;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(14); row[1] = 14.16896725; row[2] = 13.57868004; row[3] = 12.94503586;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(15); row[1] = 14.16935158; row[2] = 13.5797205;  row[3] = 12.94592957;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(16); row[1] = 14.16974831; row[2] = 13.58084583; row[3] = 12.94683301;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(17); row[1] = 14.17011547; row[2] = 13.58196545; row[3] = 12.94774618;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(18); row[1] = 14.17047501; row[2] = 13.58280563; row[3] = 12.94866904;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(19); row[1] = 14.17082119; row[2] = 13.58374691; row[3] = 12.94960158;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(20); row[1] = 14.17117214; row[2] = 13.58471298; row[3] = 12.95054378;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(21); row[1] = 14.17156029; row[2] = 13.5856638;  row[3] = 12.95149562;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(22); row[1] = 14.17191505; row[2] = 13.58641052; row[3] = 12.95245707;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(23); row[1] = 14.17225742; row[2] = 13.58718204; row[3] = 12.95342813;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(24); row[1] = 14.1726265;  row[2] = 13.58848;    row[3] = 12.95440876;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(25); row[1] = 14.17300701; row[2] = 13.5894928;  row[3] = 12.95539896;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(26); row[1] = 14.17333603; row[2] = 13.59065437; row[3] = 12.95639868;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(27); row[1] = 14.17368698; row[2] = 13.5917902;  row[3] = 12.95740793;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(28); row[1] = 14.17403889; row[2] = 13.59270477; row[3] = 12.95842667;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(29); row[1] = 14.17442799; row[2] = 13.59344292; row[3] = 12.95945488;
            _dtChart.Rows.Add(row);            
            row[0] = date.AddDays(30); row[1] = 14.17476845; row[2] = 13.59449482; row[3] = 12.96049254;
            _dtChart.Rows.Add(row);            
            _dtChart.EndLoadData();
            var horizontalAxis = new LinearAxis {Title = "Ln"};
            var verticalAxis = new LinearAxis
            {
                AxisType = AxisType.Second,
                Title = "Value"
            };
            var lineSeria = new LineSeries
            {
                DisplayMember = "COLUMN1",
                ValueMember = "COLUMN2",
                VerticalAxis = verticalAxis,
                HorizontalAxis = horizontalAxis,
            };
            radChartView1.Series.Add(lineSeria);
            radChartView1.DataSource = _dtChart;
            radChartView1.Refresh();

        }

    }

But nothing is drawn on the chart, and the range of the horizontal axis is wrong.

What am I doing wrong?

Nadya | Tech Support Engineer
Telerik team
 answered on 04 May 2020
1 answer
190 views

Hi,

 

I'm trying to set the focus on the first control of my tab when user switches between tab. To do that, I'm using the eventhandler SelectedTabChanged and put something like that:

private void radTabbedFormControl1_SelectedTabChanged(object sender, EventArgs e)
{
    textBox8.Focus();
}

 

 

 

But unfortunately, I can see that my control take the focus but immediatly lose it after.

Can you tell me how I can achieve that ? The final goal is to restore the focus state when the user is switching between tab, so he don't have to do an useless click with mouse to continue to work.

Thanks

Best Regards

Nadya | Tech Support Engineer
Telerik team
 answered on 04 May 2020
1 answer
153 views

I need to draw a series of graphs and show the legend. When the legend does not fit in the radchartview, a scroll bar appears - this is acceptable, you can quickly see the whole legend. But the title of the legend is cut off in half - the visual reproduction of the picture is sharply reduced.

In addition, if such a graph is exported to a file (ExportToImage), then we get an image containing a scroll bar. And why do you need a scroll bar in the exported drawing? We cannot use it here. In fact, we received a printscreen, not a normal export. I would like to export more intellectually for such cases.

 

Nadya | Tech Support Engineer
Telerik team
 answered on 01 May 2020
1 answer
380 views

By default, a legend is always drawn in a square shape. But it is very not convenient for LineSeries. Because in the legend you need to show not only the color, but also the type of line.

You can, of course, create your own ElementShape (https://www.telerik.com/forums/change-shape-of-items-in-legend). But there is very little space (bounds.Width = 10 pixels) and it is impossible to qualitatively draw a line of a certain type, for example, an extra-long dotted line. 

If you try to draw outside the bounding box, then the chart either always cuts everything outside the bounds of this rectangle (ChartElement.LegendElement.StackElement.Orientation = Orientation.Vertical), or partially and not quite right (ChartElement.LegendElement.StackElement.Orientation = Orientation.Horizontal)

Example:

 

        private void LegendElement_VisualItemCreating(object sender, LegendItemElementCreatingEventArgs e)
        {
            e.ItemElement = new LegendItemElement(e.LegendItem);
            e.ItemElement.MarkerElement.Shape = new LineShape();
        }

    public class LineShape : ElementShape
    {
        public override GraphicsPath CreatePath(Rectangle bounds)
        {
            var path = new GraphicsPath();
            var rect = new Rectangle(bounds.X - 50, bounds.Y + bounds.Height / 2, bounds.Width + 50, 2);
            path.AddRectangle(rect);
            return path;
        }
    }

What is the result drawn on the legend - see the attached image.

Obviously, the logic of drawing a legend for LineSeries, should be completely different. Current version - definitely not satisfied

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 May 2020
4 answers
320 views

Hi, 

I'm using RadMessgeBox during the load of my application (SpashScreen).The messages box appears behind the splash.

Is there a way to show them in topmost ?

NB : I don't want to use the shown event of the form, cause the messages box are in objects, not directly in the class form.

thanx :)

Nadya | Tech Support Engineer
Telerik team
 answered on 30 Apr 2020
7 answers
1.5K+ views

Hello I need to programmatically change the colors of a cell specified by its index , i.e. not the selected cell.

I know that the colors can/must be set on the cellelement but I have not found how to get the cellelement of a cell by it's index (or column name) in the currentrow

    e.currentrow(7).cellelement does not exists

and I have tried   e.CurrentRow.Cells(7).style.BackColor=Color.Blue but it has no effects

Thanks in advance

Pierre-Jean

Nadya | Tech Support Engineer
Telerik team
 answered on 30 Apr 2020
1 answer
948 views
I'm trying to add a checkbox to all column headers of a GridView, however I cannot see an easy way to accomplish it.  Basically, I have a dynamically generated set of columns (which each can contain a different editor).  I want a checkbox in the header cell which will allow me to enable/disable that column, however I cannot see a way to do it (I basically want to replicate the 'EnableHeaderCheckBox' functionality of the GridViewCheckBoxColumn, except on all columns regardless of data type).  Can anybody offer any advice on how this can be acheived?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Apr 2020
3 answers
83 views

is it possible to drop a hyperlink object - as a custom cell, no doubt - into a virtual grid

I downloaded the example from another post in this forum but it was for a checkbox

I found a HyperlinkElement but it is calling for the specific row and column before instantiating

any assistance is greatly appreciated

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Apr 2020
1 answer
228 views

Hi I am developing an application where Image URLs are saved onto a SQL database (Local paths) The images are in a JPEG/PNG format. Would it be possible to get the Image URLs from the database and insert them into the carousel? If so please can I get some help on how to do so :)

Kind regards

Nadya | Tech Support Engineer
Telerik team
 answered on 29 Apr 2020
14 answers
3.7K+ views
Hello,

I've tried to find some info on this but I'm not sure what the problem really is.  Overall I have a master/detail record situation.

I have a datasource bound to a RadGrid and to form items in a "detail" view above the grid. When I click a row the form items in the detail view update with the current record data.  Works great, drop down's and all.  However, the RadDateTime picker has me puzzled.  It updates fine until it hits a record with a null value for the date. Rather than going blank it holds the last date that it received. I expected it to go blank on a null value.  The datepicker supports a 'work order closed' field and will remain null until some point in the future.

Is there something i'm missing? or am I going against best practice and there is a better way?

Thanks,

Dean.
Nadya | Tech Support Engineer
Telerik team
 answered on 29 Apr 2020
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
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
CollapsiblePanel
TextBoxControl
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
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
NavigationView
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?