Telerik Forums
UI for WinForms Forum
1 answer
109 views
Why my GIF image is not animating in RadPictureBox?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2022
1 answer
137 views
why my GIF is not animating in RadPictureBox?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2022
1 answer
465 views
does RadPictureBox support gif file? if yes, why my GIF image doesnt animate?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2022
1 answer
145 views

Good evening,

I am having some basic issue with connecting a dataview to a chart and getting the piechart to show.

Heres My results:

the first chart is set up as follows:

 this.radChartView1.AreaType = ChartAreaType.Pie;
            PieSeries series = new PieSeries();
            series.DataPoints.Add(new PieDataPoint(50, "Germany"));
            series.DataPoints.Add(new PieDataPoint(70, "United States"));
            series.DataPoints.Add(new PieDataPoint(40, "France"));
            series.DataPoints.Add(new PieDataPoint(25, "United Kingdom") { Label = "My Label" });
            series.ShowLabels = true;
            series.DrawLinesToLabels = true;
            series.SyncLinesToLabelsColor = true;


            this.radChartView1.ShowSmartLabels = true;
            this.radChartView1.Series.Add(series);

Hardcoded.

the next one is my dataview;

 DataSet dsAnswer = new DataSet();
            DataView dvResult = new DataView();

            var db = Spectrotel.Library.DatabaseUtilities.DatabaseHelper.GetDB("RevIO");
            var cmd = db.GetStoredProcCommand("getme");
            string strSQLCMD = "";
            strSQLCMD = "[spectrotel].[sp_Rpt_Progress_getTodaysUsers]";
            cmd = db.GetStoredProcCommand(strSQLCMD);
            cmd.CommandTimeout = 10800;
            dsAnswer = db.ExecuteDataSet(cmd);
            dvResult = dsAnswer.Tables[0].AsDataView();

            radChartView2.AreaType = ChartAreaType.Pie;
            PieSeries series2 = new PieSeries();
            series2.DataSource = dvResult;
            series2.DisplayMember = "Bucket";
            //series.DataMember = "Cnts"; // it dont like this at all!
            series2.ShowLabels = true;
            series2.DrawLinesToLabels = true;
            series2.SyncLinesToLabelsColor = true;


            radChartView2.ShowSmartLabels = true;
            radChartView2.Series.Add(series2);

The data coming back from SQL is:

What am I doing wrong here?

Just want the basic C# code to get a piechart to appear like the first with my data.

 

Thanks.

Deasun.

 

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Apr 2022
3 answers
160 views

Hello,

 

it doesn't work for me. I don't know why...

 

My code try to build the code with parameters in a table, later I try to add calculatedfield, but I can't see the calculated field in the list... I think is the part of "The important part here is to add the custom field before setting the ItemsSource property", but I don't know how to manage it with my code...

My code:

 

  Try



            Me.RadPivotGrid1.AggregatesPosition = PivotAxis.Columns

            'MsgBox(numcubo)

            'cierro conexión
            conexion.Close()
            'abro conexión
            conexion.Open()
            'borro y cojo el detalle de apuntes del mes
            strSQL = "SELECT * FROM  [Profesionales].[dbo].[COSTES_cubos] where trim(cubo)=trim('" & numcubo & "') order by cubo, tipo, orden "

            oCommand = New SqlCommand(strSQL, conexion)
            oCommand.CommandTimeout = 0

            oCommand.CommandText = strSQL
            dataResult = oCommand.ExecuteReader()

            If dataResult.HasRows Then
                Do While dataResult.Read()

                    'sql
                    If dataResult.Item("tipo") = 1 Then

                        'strSQL = Me.Ini_SQL
                        strSQL = dataResult.Item("texto").ToString.Trim()
                        oCommand2 = New SqlCommand(strSQL, conexion)
                        oCommand2.CommandText = strSQL
                        oCommand2.CommandTimeout = 0
                        Cube_DataAdapter2 = New SqlDataAdapter(oCommand2)
                        Cube_DataSet2 = New DataSet()
                        Cube_DataAdapter2.Fill(Cube_DataSet2, "SQL")

                    End If

                    'fila
                    If dataResult.Item("tipo") = 2 Then

                        'Asigno valores
                        pivotRow = New PropertyGroupDescription()

                        pivotRow.PropertyName = dataResult.Item("texto").ToString.Trim()
                        pivotRow.CustomName = dataResult.Item("alias").ToString.Trim()

                        Me.RadPivotGrid1.ColumnGroupDescriptions.Add(pivotRow)

                    End If

                    'columna
                    If dataResult.Item("tipo") = 3 Then


                        'Asigno valores
                        pivotCol = New PropertyGroupDescription()
                        '  Dim pivotC = New PropertyAggregateDescription()
                        pivotCol.PropertyName = dataResult.Item("texto").ToString.Trim()
                        pivotCol.CustomName = dataResult.Item("alias").ToString.Trim()

                        Me.RadPivotGrid1.RowGroupDescriptions.Add(pivotCol)

                    End If

                    'datos
                    If dataResult.Item("tipo") = 4 Then

                        'Asigno valores
                        pivotVal = New PropertyAggregateDescription()
                        pivotVal.PropertyName = dataResult.Item("texto").ToString.Trim()
                        pivotVal.CustomName = dataResult.Item("alias").ToString.Trim()
                        pivotVal.StringFormat = dataResult.Item("formato").ToString.Trim()
                        pivotVal.AggregateFunction = AggregateFunctions.Sum

                        Me.RadPivotGrid1.AggregateDescriptions.Add(pivotVal)
                    End If

                    'filtros
                    If dataResult.Item("tipo") = 5 Then

                        Dim description As New PropertyFilterDescription()
                        Dim condition As New ComparisonCondition()
                        condition.Condition = Telerik.Pivot.Core.Filtering.Comparison.Equals
                        'condition.Than = "UK"
                        description.PropertyName = dataResult.Item("texto").ToString.Trim()
                        'description.Condition = condition
                        description.CustomName = dataResult.Item("alias").ToString.Trim()
                        Me.RadPivotGrid1.FilterDescriptions.Add(description)

                    End If



                    'orden
                    If dataResult.Item("tipo") = 6 Then


                        Dim propGroupDescription As PropertyGroupDescription = DirectCast(Me.RadPivotGrid1.RowGroupDescriptions(0), PropertyGroupDescription)
                        If dataResult.Item("sort").ToString.Trim() = "Ascending" Then
                            propGroupDescription.SortOrder = Telerik.Pivot.Core.SortOrder.Ascending
                        Else
                            propGroupDescription.SortOrder = Telerik.Pivot.Core.SortOrder.Descending
                        End If
                        propGroupDescription.GroupComparer = New GrandTotalComparer() With {
         .AggregateIndex = dataResult.Item("orden")
        }
                            Me.RadPivotGrid1.ReloadData()
                        End If

                Loop
            End If








            Me.RadPivotGrid1.DataSource = Cube_DataSet2
            Me.RadPivotGrid1.DataMember = "SQL"


           Using RadPivotGrid1.PivotGridElement.DeferRefresh()
                Dim calculatedField As New CommissionCalculatedField()
                calculatedField.Name = "Commission"
                DirectCast(Me.RadPivotGrid1.DataProvider, LocalDataSourceProvider).CalculatedFields.Add(calculatedField)
            End Using


            ''Cargo layout por defecto
            'If Me.Ini_Layout <> "" Then
            '    Me.RadPivotGrid1.LoadLayout(Me.Ini_Layout)
            'End If
            'Cargo grafico
            Me.RadChartView.DataSource = Me.RadPivotGrid1





            Dim verticalAxis As New LinearAxis()
            'verticalAxis.AxisType = AxisType.Second
            Dim horizontalAxis As New CategoricalAxis()
            horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine
            Me.RadChartView.Area.Axes.Add(horizontalAxis)
            Me.RadChartView.Area.Axes.Add(verticalAxis)
            Me.RadChartView.ChartElement.LegendElement.Visibility = Telerik.WinControls.ElementVisibility.Visible
            'Me.RadChartView.ChartElement.LegendPosition = LegendPosition.Right
            Me.RadChartView.ChartElement.LegendElement.Alignment = System.Drawing.ContentAlignment.TopCenter
            'Configuracion totales grafico
            Me.RadPivotGrid1.ChartDataProvider.IncludeRowSubTotals = False
            Me.RadPivotGrid1.ChartDataProvider.IncludeColumnSubTotals = False
            Me.RadPivotGrid1.ChartDataProvider.IncludeRowGrandTotals = False
            Me.RadPivotGrid1.ChartDataProvider.IncludeColumnGrandTotals = False
            'Oculto grafico
            Me.SplitContainer2.Panel2Collapsed = True
            Me.SplitContainer1.Panel1Collapsed = True
            Me.RadChartView.Title = Me.Titulo



            'cierro conexión
            conexion.Close()

        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical)

        End Try

 

and the class:

 


    Public Class CommissionCalculatedField
        Inherits CalculatedField
        Private extendPriceField As RequiredField
        Public Sub New()
            Me.Name = "Commission"
            Me.extendPriceField = RequiredField.ForProperty("importe")
        End Sub
        Protected Overrides Function RequiredFields() As IEnumerable(Of RequiredField)
            Return New List(Of RequiredField) From {extendPriceField}
        End Function
        Protected Overrides Function CalculateValue(aggregateValues As IAggregateValues) As AggregateValue
            Dim aggregateValue = aggregateValues.GetAggregateValue(Me.extendPriceField)
            If aggregateValue.IsError() Then
                Return aggregateValue
            End If
            Dim extendedPrice As Double = aggregateValue.ConvertOrDefault(Of Double)()

            Return New DoubleAggregateValue(extendedPrice * 0.1)

            Return Nothing
        End Function
    End Class                
Hristo
Telerik team
 answered on 18 Apr 2022
1 answer
213 views

I have a RadSplitButton that I build menuItems programmatically. But, I can't figure out how to capture a click event when the menuItem is clicked. 

The reason I'm doing it this way is because I have a RadbuttonTextbox with the RadSplitButton on its LeftButtonsItems collection.

The RadSplitButton contains previously entered data in the TextBox. The textbox is a Key field for the form, so the radSplitbutton would be perfect for this use if I can get it to work.

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2022
1 answer
184 views

statusbar  elements rightside alignment

exepectation

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Apr 2022
1 answer
308 views

Hi ,

once I made change allowedit = false; noneditable

this scenario ,I need to edit paritcular column edit in Radlistview.

thanks,

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2022
1 answer
138 views

first picture is basic ui

second picture is telerik ui

 

 

How to make it look like the first picture for telerik ui??????

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2022
0 answers
224 views
When importing a CSV file (or any file for that matter) how can I make every field a Text field rather than the import process trying to determine the data type and setting it. This is specifically causing me issues when importing fields with values like 9/10 which aren't dates.
Todd
Top achievements
Rank 1
Iron
 asked on 14 Apr 2022
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?