Telerik Forums
UI for WinForms Forum
1 answer
117 views

I have a button and I'd like it to look the same way as the title bar close button does.

How can I apply a specific style to a control?

The only thing I tried is to access theme information, but it is really complicated as there are multiple levels of nesting and derivation of settings etc. I think, that there should be easier way to do this.

      var theme = Telerik.WinControls.ThemeResolutionService.GetTheme(TelerikSkinAdapter.GetThemeName("MySkin"));
      foreach (var group in theme.StyleGroups)
        foreach (var registration in group.Registrations)
          System.Diagnostics.Debug.WriteLine($"{registration.ControlName} {registration.ControlType} {registration.ElementName} {registration.ElementType}");

Nadya | Tech Support Engineer
Telerik team
 answered on 29 Jun 2021
6 answers
123 views

hi,

I am currently having a radgridview with 3 columns in which the 3rd column is a chart type custom column. i have set a minimum width to it which leads to scroll bar on smaller displays. Now , if i scroll across a few times the data in the chart disappears. 

Is there any event where i can write code to prevent from happening ? Code below updated


public RadForm1()
        {
            InitializeComponent();

            this.radGridView1.Columns.Add("Column1");
            this.radGridView1.Columns.Add("Column2");
            ChartColumn customColumn = new ChartColumn("Chart column");
            this.radGridView1.Columns.Add(customColumn);
            this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

            for (int i = 0; i < 10; i++)
            {
                this.radGridView1.Rows.Add(i, i, i);
            }
            this.radGridView1.TableElement.RowHeight = 200;
            this.radGridView1.AllowAddNewRow = false;
        }

        public class ChartCell : GridDataCellElement
        { 
            public ChartCell(GridViewColumn column, GridRowElement row) : base(column, row)
            {
            }

            RadChartElement chart = new RadChartElement();
 
            protected override void CreateChildElements()
            {
                base.CreateChildElements();
                LoadBarChart();
                this.Children.Add(chart);
            }

            private void LoadBarChart()
            {
                chart.View.AreaType = ChartAreaType.Cartesian; 
                chart.AngleTransform = 90;
                RangeBarSeries rangeBarSeries = new RangeBarSeries("End Time", "Start Time", "Summarization Date");

                rangeBarSeries.DataPoints.Add(new RangeDataPoint(DateTime.Now.TimeOfDay.TotalMinutes + 14, DateTime.Now.TimeOfDay.TotalMinutes + 10, "6/8/2021"));
                rangeBarSeries.DataPoints.Add(new RangeDataPoint(DateTime.Now.TimeOfDay.TotalMinutes + 7, DateTime.Now.TimeOfDay.TotalMinutes + 5, "6/8/2021"));
                rangeBarSeries.DataPoints.Add(new RangeDataPoint(DateTime.Now.TimeOfDay.TotalMinutes + 4, DateTime.Now.TimeOfDay.TotalMinutes + 2, "6/8/2021"));

                rangeBarSeries.DataPoints.Add(new RangeDataPoint(DateTime.Now.TimeOfDay.TotalMinutes + 30, DateTime.Now.TimeOfDay.TotalMinutes + 10, "6/7/2021"));
                rangeBarSeries.DataPoints.Add(new RangeDataPoint(DateTime.Now.TimeOfDay.TotalMinutes + 7, DateTime.Now.TimeOfDay.TotalMinutes + 5, "6/7/2021"));

                CategoricalAxis horizontalAxis = new CategoricalAxis();

                //horizontalAxis.Title = "Summarization Days";
                horizontalAxis.ClipLabels = false;
                horizontalAxis.LabelRotationAngle = -90;
                horizontalAxis.LabelFitMode = AxisLabelFitMode.Rotate;

                horizontalAxis.PlotMode = AxisPlotMode.BetweenTicks;
                rangeBarSeries.HorizontalAxis = horizontalAxis;

                chart.View.Series.Add(rangeBarSeries);

                rangeBarSeries.VerticalAxis.LabelFormatProvider = new MyFormatProvider();
                //rangeBarSeries.VerticalAxis.Title = "Time of the day";
                rangeBarSeries.VerticalAxis.ClipLabels = false;
                rangeBarSeries.VerticalAxis.LabelRotationAngle = -45;
                rangeBarSeries.VerticalAxis.LabelFitMode = AxisLabelFitMode.Rotate;

                LinearAxis verticalAxis = chart.View.Axes.Get<LinearAxis>(1);
                verticalAxis.Minimum = 0; //Minutes 0:00
                verticalAxis.Maximum = 1380; //Minutes 23:00
                verticalAxis.MajorStep = 60; //60 minutes in an hour

                CartesianArea area = chart.View.GetArea<CartesianArea>();
                area.ShowGrid = true;

                CartesianGrid grid = area.GetGrid<CartesianGrid>();
                grid.DrawVerticalStripes = true;
                grid.DrawHorizontalStripes = false;
            }

            protected override void SetContentCore(object value)
            {
                base.SetContentCore(value);
                //you can synchronize the chart data points according to the cell value if necessary 
            }
            
            protected override Type ThemeEffectiveType
            {
                get
                {
                    return typeof(GridDataCellElement);
                }
            }

            public override bool IsCompatible(GridViewColumn data, object context)
            {
                return data is ChartColumn && context is GridDataRowElement;
            }
        }

        public class ChartColumn : GridViewDataColumn
        {
            public ChartColumn(string fieldName) : base(fieldName)
            {
            }

            public override Type GetCellType(GridViewRowInfo row)
            {
                if (row is GridViewDataRowInfo)
                {
                    return typeof(ChartCell);
                }
                return base.GetCellType(row);
            }
        }

        public class MyFormatProvider : IFormatProvider, ICustomFormatter
        {
            public object GetFormat(Type formatType)
            {
                return this;
            }

            public string Format(string format, object arg, IFormatProvider formatProvider)
            {
                int totalminutes = Convert.ToInt32(arg);

                TimeSpan timeSpan = TimeSpan.FromMinutes(totalminutes);

                return timeSpan.ToString(@"hh\:mm");
            }
        }


Nadya | Tech Support Engineer
Telerik team
 answered on 29 Jun 2021
3 answers
300 views

Hi ,

i have a radgridview with lengthy columns (actually 3 columns with the 3rd as minwidth 4000 which is a custom chart column) . So this comes up with scrolling effect if the monitor size is small . It seems that due to virtualization , the data in some rows (the 3rd column) disappears randomly on scroll. Any way to avoid that?

 

Guess disabling virtualization should do but any other idea is welcome

Nadya | Tech Support Engineer
Telerik team
 answered on 29 Jun 2021
1 answer
188 views

Hello,

I would like to know if it's possible to disable the video recording function in a radWebCam. I would like to use it to take snapshots only.

 

Thank you and have a nice day!

Stoyan
Telerik team
 answered on 29 Jun 2021
2 answers
145 views

hi,

i want to use the radvirtualgrid to add a new row/record to a database but instead of using Tab button to switch between column i prefer to use the enter key.

is that possible, if yes can you give me a sample please ?

Thanks in advance

Nadya | Tech Support Engineer
Telerik team
 answered on 28 Jun 2021
1 answer
550 views
I have to add a context menu to the list view but need the menu items to change depending on the items clicked, but am not able to find the contextmenuopening event for the listbox. am i missing something or is there a different way to handle this.
I have used this same method for treeview and that works perfectly.
Nadya | Tech Support Engineer
Telerik team
 answered on 28 Jun 2021
4 answers
139 views

Hello all... 

i have this code for clear radtextboxcontrol, how make this for radspineditor ? 

        Dim a, b As Control
        For Each a In TableLayoutPanel2.Controls
            If TypeOf a Is Telerik.WinControls.UI.RadTextBoxControl Then
                a.Text = ""
            End If
        Next

        For Each b In TableLayoutPanel2.Controls
            If TypeOf b Is Telerik.WinControls.UI.RadSpinEditor Then
                b.value = 0 <------ how make this happen 
            End If
        Next

 

thanks... 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 25 Jun 2021
1 answer
167 views

Hi.

I have this:

GridViewSummaryItem Duracao = new GridViewSummaryItem();
Duracao.Name = "Duração";
Duracao.FormatString = "{0}";
Duracao.AggregateExpression = "(sum(T_H))";

sum(T_H) it's the sum of times in seconds. I need show the result in time format (hh:mm:ss)

How i can do it? help please.

i'm program in C#.

Thank you.

Joswhar
Top achievements
Rank 1
Iron
 answered on 24 Jun 2021
1 answer
208 views

As the title suggest, how can I deselect currently selected row if it's previously selected? I have MultiSelect set to False. Ctrl + click doesn't work.

 

J

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jun 2021
2 answers
270 views

I have a RadAutoCompleteBox working as expected allowing user to type and pick an item from the list.

The token is then shown in the Textbox as expected.

 

Would like to have a way when they type again and pick another item, to then remove the 1st and only show the 2nd item.

Tried the  radautocompletebox.Text = "" but received some error.  It would be nice to have a property stating (Multiple Tokens (true/false).

 

Maybe there is a programmatically way to click the X in the token to remove it before adding the 2nd token?

 

 

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 23 Jun 2021
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
+? 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?