Telerik Forums
UI for WinForms Forum
1 answer
82 views

Hi

I am playing with the RadRangeSelector. I have associated it to an existing chart. The chart is dynamically filled using data from the database.

In the image here below, the top control is a RadRangeSelector, the bottom control is a RadChartView.

Notice that my bottom chart shows series as stacked. How can I get the RadRangeSelector also showing stacked series?

Also notice that the dates are not inlined between top and bottom. How can the RadRangeSelector be sorted by dates (as my chart is showing)?

 

Nadya | Tech Support Engineer
Telerik team
 answered on 15 Nov 2023
1 answer
71 views

Hi,

I'm using Telerik for Winforms 2023.3.1010 on .NET 7.

While trying to configure the position of my label position using PieTwoLabelColumnsStrategy, only the first label seems to be working with DistanceBetweenLabels property.

 

 PieTwoLabelColumnsStrategy strategy = new PieTwoLabelColumnsStrategy()
 {
     DistanceBetweenLabels = 50,
     DistanceToLabel = -100
 };

 SmartLabelsController smartLabelsController = new SmartLabelsController
 {
     Strategy = strategy
 };

 radChartView.Controllers.Add(smartLabelsController);
 radChartView.ShowSmartLabels = true;

Here is how I'm filling the chart:


   radChartView.AreaType = ChartAreaType.Pie;
   radChartView.Series.Clear();

   DonutSeries donut = new DonutSeries
   {
       ShowLabels = true,
       LabelMode = PieLabelModes.Horizontal,
       DrawLinesToLabels = true,
       SyncLinesToLabelsColor = true,
       NumberOfColors = categoryCount
   };

   foreach (var v in totals.OrderByDescending(s => s.Statut))
   {
       PieDataPoint point = new PieDataPoint(v.Nombre, v.Statut)
       {
           Label = $"{v.Percentage}% {v.Statut}"
       };

       donut.DataPoints.Add(point);
   }

   radChartView.Series.Add(donut);
   radChartView.Area.View.Palette = KnownPalette.Metro;
   radChartView.SelectionMode = ChartSelectionMode.SingleDataPoint;
   radChartView.BackColor = Color.WhiteSmoke;

With small percentages, it doesn't work (except of the right bottom label)

With higher percentages it seems to be working :

The behavior is quite inconsistent.

Thank you for your help.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Nov 2023
1 answer
110 views

Hello,

In my gridview, I have a  progressBarElement in a grid column as explained here:

https://docs.telerik.com/devtools/winforms/controls/gridview/cells/creating-custom-cells?_gl=1*d7lc04*_gcl_au*MTgwMTc5NzcyMS4xNjk5NTI4NjIw*_ga*OTQ3ODE2NTUuMTY5MTU3MzE4Nw..*_ga_9JSNBCSF54*MTY5OTUyODYyMC4xNS4xLjE2OTk1MzMwODcuMzUuMC4w&_ga=2.222397211.1249884809.1699528621-94781655.1691573187

When I export, I don't have the progress bar, only values



 private void RunExportToExcelML(string fileName, ref bool openExportFile)
        {
            ExportToExcelML excelExporter = new ExportToExcelML(this.radGridView1)
            {
                SheetName = "Essai",
                SummariesExportOption = SummariesOption.ExportAll,
                SheetMaxRows = ExcelMaxRows._65536,
                ExportVisualSettings =true,
                
                
                
            };

            try
            {
                excelExporter.RunExport(fileName);

                RadMessageBox.SetThemeName(this.radGridView1.ThemeName);
                DialogResult dr = RadMessageBox.Show("The data in the grid was exported successfully. Do you want to open the file?",
                    "Export to Excel", MessageBoxButtons.YesNo, RadMessageIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    openExportFile = true;
                }
            }
            catch (IOException ex)
            {
                RadMessageBox.SetThemeName(this.radGridView1.ThemeName);
                RadMessageBox.Show(this, ex.Message, "I/O Error", MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Nov 2023
1 answer
110 views

I must be missing something obvious here. Given the class below:

    public class ContractForRefinance
    {
        public int ContrID { get; set; }
        public string ContrNumber { get; set; }
        public string LoanClass { get; set; }
        public DateTime LoanDate { get; set; }
        public decimal Balance { get; set; }
    }

I'm trying to set up a multi-column listbox with headers like this:

ListViewDetailColumn contrIDColumn = new ListViewDetailColumn("ContrID");
contrIDColumn.Width = 150;
contrIDColumn.HeaderText = "ContrID";
lstContractForRefinance.Columns.Add(contrIDColumn);

ListViewDetailColumn contrNumberColumn = new ListViewDetailColumn("ContrNumber");
contrNumberColumn.HeaderText = "ContrNumber";
contrNumberColumn.Width = 100;
lstContractForRefinance.Columns.Add(contrNumberColumn);

ListViewDetailColumn loanClassColumn = new ListViewDetailColumn("LoanClass");
loanClassColumn.HeaderText = "Description";
loanClassColumn.Width = 100;
lstContractForRefinance.Columns.Add(loanClassColumn);

ListViewDetailColumn loanDateColumn = new ListViewDetailColumn("LoanDate");
loanDateColumn.HeaderText = "LoanDate";
loanDateColumn.Width = 100;
lstContractForRefinance.Columns.Add(loanDateColumn);

ListViewDetailColumn balanceColumn = new ListViewDetailColumn("Balance");
balanceColumn.HeaderText = "Balance";
balanceColumn.Width = 100;
lstContractForRefinance.Columns.Add(balanceColumn);

lstContractForRefinance.ShowColumnHeaders = true;
lstContractForRefinance.ShowCheckBoxes = true;

foreach (var item in applicationManager.ContractForRefinanceList)
{
    lstContractForRefinance.Items.Add(item);
}

However, the control looks like this:

What am I missing?

Thanks

Carl

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Nov 2023
3 answers
95 views

Probably more of a suggestion than a question.

I would like an FileExportMode that is between the 2 existing modes. It creates or overrides the named Sheet in the given XLSX

User could then:

  • Export to a named sheet.
  • Add another sheet that references the exorted data
  • Run the Export again to refresh the data
Nadya | Tech Support Engineer
Telerik team
 answered on 10 Nov 2023
1 answer
83 views

I have grid with hierarchy gridviewtemplate.  Is there a way to paginate the child  like the master template?

thanks

Nadya | Tech Support Engineer
Telerik team
 answered on 10 Nov 2023
1 answer
90 views

I have a list view to apply the waiting bar.

The list view is bound to the bindingList<T> data structure.

I want to apply the waiting bar to prevent UI from stopping while applying the data I have been querying in DB to the list view.

I think if there is a lot of data, it takes a long time because the work takes longer in the CellFomattting part.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Nov 2023
8 answers
134 views

Hello Telerik Team,

I want to implement some custom renderings or a overlay for a radChart. I added a screenshot of my application with some annotations. My goal is to remove the dummy resource from the scheduler. The cells of the dummy resource are only used to show workload-percentages. But before I can remove it, I need to display the workload in the ChartView, more precisely in the RangeSelector.

Screenshot

I already implemented a custom CartesianRenderer and custom BarSeriesDrawPart to control the color of the bars depending on the calculated workload. But now I want a Label with the workload percentage centered on each bar. But i don't know how to calculate the the rectange of the area from 0% to 100% to figure out the correct positioning.

My solution so far:


internal class CustomBarSeriesDrawPart : BarSeriesDrawPart
{
    public Font DefaultFont { get; private set; }


    public CustomBarSeriesDrawPart(BarSeries series, IChartRenderer renderer, Font defaultFont) : base(series, renderer)
    {
        DefaultFont = defaultFont;
    }

    public override void DrawSeriesParts()
    {
        //LogHelper.Info("CustomBarSeriesDrawPart.DrawSeriesParts() START");
        if (!(Renderer is CustomCartesianRenderer renderer))
            throw new ApplicationException($"Renderer ist nicht vom Typ \"{nameof(CustomCartesianRenderer)}\"");

        var graphics = ((ChartRenderer)Renderer).Graphics;
        var radGraphics = new RadGdiGraphics(graphics);

        for (int i = 0; i < Element.DataPoints.Count; i++)
        {
            RadRect slot = Element.DataPoints[i].LayoutSlot;

            //how to get the rectangle for the full slot (from 0% to 100% height)? 
            RectangleF barBounds = new RectangleF((float)(OffsetX + slot.X), (float)(OffsetY + slot.Y), (float)slot.Width, (float)slot.Height);

            DataPointElement childElement = (DataPointElement)Element.Children[i];

            float realWidth = barBounds.Width * childElement.HeightAspectRatio;
            barBounds.Width = realWidth;

            barBounds.Height = Math.Max(barBounds.Height, 1f);
            double percentage = 0;
            Color color;

            if (Element.DataPoints[i] is CategoricalDataPoint point)
            {
                percentage = point.Value ?? 0;

                //color = Owner.Auslastungsfarbe(percentage);
                color = renderer.Owner.Auslastungsfarbe(percentage);
            }
            else
                color = Color.LightGray;

            radGraphics.FillRectangle(barBounds, color);

            //radGraphics.DrawEllipse();

            var parameters = new TextParams()
            {
                text = $"{(int)percentage}%",
                alignment = ContentAlignment.MiddleCenter,
                foreColor = Color.Black,
                paintingRectangle = barBounds,
                font = DefaultFont,
            };
            radGraphics.DrawString(parameters, barBounds.Size);
        }
        //base.DrawSeriesParts();
    }
}

Hope you can help my with it.

Regards,

Stephan

Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 08 Nov 2023
3 answers
80 views

Hello, 

I'm trying to set up a custom filter for a ListView set in Icon Mode.

Following along with the example provided here: https://docs.telerik.com/devtools/winforms/controls/listview/features/filtering

I've created the following function (no actual filtering functionality has been added yet):

//Apply the filters to the RadListView
bool BrightLife::FilterDatabase(ListViewDataItem^ item)
{

	//Filter by Tree View

	//Filter by Search Bar

	//Filter by Color

	//Filter by Style

	return false;
}

Then, in the constructor of my form, I have the following:

this->LV_Assets->EnableFiltering = true;
this->LV_Assets->ListViewElement->DataView->Filter = FilterDatabase; //<- Problem here

The line which assigns the filter to the RadListView is returning an error in Visual Studio

function "Telerik::WinControls::Data::RadCollectionView<TDataItem>::Filter::set [with TDataItem=Telerik::WinControls::UI::ListViewDataItem ^]" cannot be called with the given argument

I'm not entirely sure what the problem is here and would appreciate any insight to help me get this working. Thanks!

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Nov 2023
2 answers
176 views

Hello I need to localize the filedialog componenet to french

I have created the frenchlocalization class and it works partially, as you can see from the attached screenshot some of the elements are properly translated but all the buttons and some labels are not translated

I don't see what I am missing:

here below the code and the class

-----------------------------------------------------

            Select Case MyPreference.ifLanguage
                Case "fr" : FileDialogsLocalizationProvider.CurrentProvider = New FrenchLocalization.MyFrenchFileDialogsLocalizationProvider()
            End Select

-------------------------------------------------------

    Public Class MyFrenchFileDialogsLocalizationProvider
        Inherits FileDialogsLocalizationProvider
        Public Overloads Overrides Function GetLocalizedString(ByVal id As String) As String
            Select Case id
                Case FileDialogsStringId.OK
                    Return "OK"
                Case FileDialogsStringId.Yes
                    Return "Oui"
                Case FileDialogsStringId.No
                    Return "Non"
                Case FileDialogsStringId.Cancel
                    Return "Annuler"
                Case FileDialogsStringId.Back
                    Return "Arrière"
                Case FileDialogsStringId.Forward
                    Return "Avant"
                Case FileDialogsStringId.Up
                    Return "en Haut"
                Case FileDialogsStringId.NewFolder
                    Return "Nouveau Dossier"
                Case FileDialogsStringId.SearchIn
                    Return "Chercher dans"
                Case FileDialogsStringId.SearchResults
                    Return "Résultats de recherche dans"
                Case FileDialogsStringId.ExtraLargeIcons
                    Return "Très grandes icônes"
                Case FileDialogsStringId.LargeIcons
                    Return "Grandes icônes"
                Case FileDialogsStringId.MediumIcons
                    Return "Icônes moyennes"
                Case FileDialogsStringId.SmallIcons
                    Return "Petites icônes"
                Case FileDialogsStringId.List
                    Return "Liste"
                Case FileDialogsStringId.Tiles
                    Return "Titres"
                Case FileDialogsStringId.Details
                    Return "Détails"
                Case FileDialogsStringId.NameHeader
                    Return "Nom"
                Case FileDialogsStringId.SizeHeader
                    Return "Taille"
                Case FileDialogsStringId.TypeHeader
                    Return "Type"
                Case FileDialogsStringId.DateHeader
                    Return "DModifié le"
                Case FileDialogsStringId.FileSizes_B
                    Return "bytes"
                Case FileDialogsStringId.FileSizes_GB
                    Return "GB"
                Case FileDialogsStringId.FileSizes_KB
                    Return "KB"
                Case FileDialogsStringId.FileSizes_MB
                    Return "MB"
                Case FileDialogsStringId.FileSizes_TB
                    Return "TB"
                Case FileDialogsStringId.OpenFileDialogHeader
                    Return "Ouvrir le fichier"
                Case FileDialogsStringId.OpenFolderDialogHeader
                    Return "Ouvrir le dossier"
                Case FileDialogsStringId.SaveFileDialogHeader
                    Return "Enregistrer sous"
                Case FileDialogsStringId.FileName
                    Return "Nom de fichier:"
                Case FileDialogsStringId.Folder
                    Return "Dossier:"
                Case FileDialogsStringId.SaveAsType
                    Return "Enregistrer comme type:"
                Case FileDialogsStringId.OpenFolder
                    Return "Ouverture du dossier"
                Case FileDialogsStringId.FileFolderType
                    Return "Dossier de fichier"
                Case FileDialogsStringId.Cut
                    Return "Couper"
                Case FileDialogsStringId.Copy
                    Return "Copier"
                Case FileDialogsStringId.CopyTo
                    Return "Copier vers"
                Case FileDialogsStringId.Delete
                    Return "Supprimer"
                Case FileDialogsStringId.Edit
                    Return "Modifier"
                Case FileDialogsStringId.MoveTo
                    Return "Déplacer vers"
                Case FileDialogsStringId.Open
                    Return "Ouvrir"
                Case FileDialogsStringId.Paste
                    Return "Coller"
                Case FileDialogsStringId.Properties
                    Return "Propriétés"
                Case FileDialogsStringId.Rename
                    Return "Renommer"
                Case FileDialogsStringId.Save
                    Return "Enregistrer"
                Case FileDialogsStringId.View
                    Return "Vue"
                Case FileDialogsStringId.CheckThePath
                    Return "Vérifier le chemin et réessayer."
                Case FileDialogsStringId.ConfirmSave
                    Return "Confirmer enregistrer sous"
                Case FileDialogsStringId.FileExists
                    Return "existe déjà."
                Case FileDialogsStringId.FileNameWrongCharacters
                    Return "Un nom de fichier ne peut pas contenir les caractères : \ / : * ? "" < > |"
                Case FileDialogsStringId.InvalidExtensionConfirmation
                    Return "Etes-vous sûr de vouloir le changer?"
                Case FileDialogsStringId.InvalidFileName
                    Return "Le nom du fichier n'est pas valide."
                Case FileDialogsStringId.InvalidOrMissingExtension
                    Return "Si vous changez l'extension d'un fichier, ce dernier peut devenir inutilisable."
                Case FileDialogsStringId.InvalidPath
                    Return "Le chemin n'existe pas."
                Case FileDialogsStringId.OpenReadOnly
                    Return "Ouvrir en lecture seule"
                Case FileDialogsStringId.ReplacementQuestion
                    Return "Voulez-vous le remplacer?"
                Case Else
                    Return String.Empty
            End Select
        End Function
    End Class

Nadya | Tech Support Engineer
Telerik team
 answered on 08 Nov 2023
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
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
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
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
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
NavigationView
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?