Telerik Forums
UI for WinForms Forum
5 answers
340 views

Hello,

my task was to enable zoom of GridView using mouse wheel + Ctrl key. I implemented it with partial success. I am not able to correctly resize some parts of the grid - see attached pic with red rectangles. I can provide a sample project. And a subquestion - is it possible to disable scrolling while the Ctrl Key is pressed?

Thanks in advance for help.

Tomáš

Tomáš
Top achievements
Rank 1
Iron
 answered on 15 Mar 2021
1 answer
156 views

Hi,

I want to call DesktopAlert as ShowDialog instead of show. if any solution available ?

 

Thanks

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Mar 2021
2 answers
420 views

Hello Telerik,

How could I play with margin and padding to add some spacing between image, texte and certainly my checkboxe ?

Thank you in advance for your support !

Marco
Top achievements
Rank 2
Veteran
 answered on 12 Mar 2021
2 answers
166 views

I want to execute some code when a user types and then uses the Mouse to click on an item in the list.  

I will need to access the item selected.

 

I am having a hard time to find the correct event to capture this.

 

Thanks.

Nadya | Tech Support Engineer
Telerik team
 answered on 12 Mar 2021
2 answers
135 views

Hi.

As is known, Ctrl + A selects all cells in the spreadsheet. Can we change this to only select cells that are full?

özer
Top achievements
Rank 2
Veteran
Iron
 answered on 12 Mar 2021
3 answers
259 views

Hi,

I don't know if this is the correct forum for this question but I couldn't find an Excel export/import forum which might be more suitable.

I'm using GridViewSpreadStreamExport to export RadGridViews to Excel which works fine and I can open the generated spreadsheet in Excel without any issues.

The issue comes when I try to open/read the generated spreadsheet in code using OleDbCommand with the following connection string:

@"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + path + "; Extended Properties = " + @"""Excel 12.0 Xml;HDR=YES;IMEX=1"";";

I get an "External table is not in the expected format" error message on opening the connection.

If I first open the generated spreadsheet in Excel and just save it, without making any changes to it,the issue does not occur and I can open the spreadsheet in code without any issues.

The spreadsheet does have multiple worksheets, each one from a new instance of a RadGridView, but I don't think that is the issue because generating a spreadsheet with a single worksheet has the same issue.

The RadGridView is in memory, not on the UI, and I just set some of the column headers, width and text alignments.

Export format is SpreadStreamExportFormat.Xlsx and the export of individual RadGridViews are done via:

spreadStreamExport.RunExport(path, new SpreadStreamExportRenderer());

Although I have tried not creating a new instance of SpreadStreamExportRenderer as well.

I've reduced the export to its bare minimum (removed column header and text alignment settings) but nothing has helped.

Any ideas what the issue could be?

Thanks,

Arash

Dimitar
Telerik team
 answered on 12 Mar 2021
5 answers
172 views

Good day,

I have a radpivotgridview with a custom calculated field, 2 questions:

First one I see in https://docs.telerik.com/devtools/winforms/controls/pivotgrid/calculated-fields to make the custom calculated field from just a value column named ExtendedPrice if I want column a from database div column b from database how could I implement that.

Second I have a calculated field like this:

Public Class TelerikPivotCalculatedFieldDirua
    Inherits CalculatedField
    Private denboraEuroakField As RequiredField
    Public Sub New()
        Me.Name = "TotalEuro"
        Me.denboraEuroakField = RequiredField.ForProperty("zenbatSeg")
    End Sub
    Protected Overrides Function RequiredFields() As IEnumerable(Of RequiredField)
        Return New List(Of RequiredField) From {denboraEuroakField}
    End Function
    Protected Overrides Function CalculateValue(aggregateValues As IAggregateValues) As AggregateValue
        Dim aggregateValue = aggregateValues.GetAggregateValue(Me.denboraEuroakField)
        If aggregateValue.IsError() Then
            Return aggregateValue
        End If
        Dim denboraEuroak As Integer = 0 '= aggregateValue.ConvertOrDefault(Of Integer)()
        denboraEuroak = CInt(aggregateValue.GetValue)
        If denboraEuroak >= 0 Then
            Dim gEurosSeg As Decimal = 0
            gEurosSeg = CDec(gEurosHora) / CDec(3600)
            Dim gGuztira As Decimal = 0
            gGuztira = CDec(denboraEuroak) * CDec(gEurosSeg)
            gGuztira = Math.Round(gGuztira, 2, MidpointRounding.AwayFromZero)
            Return New DoubleAggregateValue(gGuztira)
        End If
        Return Nothing
    End Function

End Class

In the vb file:

    Me.provider = New LocalDataSourceProvider()
        'Using rpgestadistica.PivotGridElement.DeferRefresh()
        Using provider.DeferRefresh()
            Dim calculatedField As New TelerikPivotCalculatedFieldDirua()
            calculatedField.Name = "TotalEuro"
            calculatedField.DisplayName = Func_nombre(3372)
            provider.CalculatedFields.Add(calculatedField)
        End Using
        'DirectCast(Me.rpgestadistica.DataProvider, LocalDataSourceProvider).CalculatedFields.Add(calculatedField)
        'rpgestadistica.DataProvider = provider
        Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "globalNombre", _
                                                                                  .GroupComparer = New GroupNameComparer(), _
                                                                                  .CustomName = Func_nombre(3370)})
        Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "tipogasin", _
                                                                                  .GroupComparer = New GroupNameComparer(), _
                                                                                  .CustomName = Func_nombre(160)})
        Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "suscripcion", _
                                                                                  .GroupComparer = New GroupNameComparer(), _
                                                                                  .CustomName = Func_nombre(250)})
        Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "razon", _
                                                                                  .GroupComparer = New GroupNameComparer(), _
                                                                                  .CustomName = Func_nombre(174)})
        Me.provider.AggregateDescriptions.Add(New PropertyAggregateDescription() With {.PropertyName = "total", _
                                                                                       .AggregateFunction = AggregateFunctions.Sum})
        Me.provider.AggregateDescriptions.Add(New PropertyAggregateDescription() With {.PropertyName = "denbora", _
                                                                                       .AggregateFunction = New TelerikPivotAggregateFunctionEstTiempo()})
        'Me.provider.AggregateDescriptions.Add(provider.CalculatedFields.Item(11))
        Me.provider.AggregateDescriptions.Add(New PropertyAggregateDescription() With {.PropertyName = "TotalEuro", _
                                                                                       .AggregateFunction = AggregateFunctions.Sum})

    'This last line appears like "error".
        Me.cargaridiomarpg()
        provider.AggregatesPosition = PivotAxis.Columns
        provider.AggregatesLevel = 2
        Me.provider.ItemsSource = ldt
        rpgestadistica.DataProvider = provider
        cargaridiomarpg()
        For Each rd As RadElement In Me.rpgestadistica.PivotGridElement.ColumnDescriptorsArea.Children
            Dim pgde As PivotGroupDescriptorElement = TryCast(rd, PivotGroupDescriptorElement)
            If Not IsNothing(pgde) Then
                Me.rpgestadistica.PivotGridElement.BestFitHelper.BestFitRowHeaders(pgde.Level)
            End If
        Next
        For Each element As RadElement In Me.rpgestadistica.PivotGridElement.RowDescriptorsArea.Children
            Dim pgde As PivotGroupDescriptorElement = TryCast(element, PivotGroupDescriptorElement)
            If Not IsNothing(pgde) Then
                Me.rpgestadistica.PivotGridElement.BestFitHelper.BestFitRowHeaders(pgde.Level)
            End If
        Next
        Me.rpgestadistica.PivotGridElement.BestFitHelper.BestFitColumns()

See Attach file 1, CustomAggregatev1:

If I rightClick and deattach TiempoEuro column and reattach it. I see it ok:

See Attach file 2 and Attach file 3.

How can I achive it like in attach file 3 from the beginning instead of having errors.

Thanks in advance,

Xabi

Iñaki
Top achievements
Rank 1
 answered on 11 Mar 2021
1 answer
260 views

I want to temporarily disable the arrow keys in the grid.  When a row is selected, I do some image processing for that row, which typically takes .25  to 2 seconds.  During that processing time, I want to disable the arrow keys during processing and then enable them when done.  I created a bool isBusy Flag for the processing, but I cannot add that to the below custom behavior.  Any suggestions?  Is there a way to toggle the Custom behavior?

public class CustomGridBehavior : BaseGridBehavior

        {
            public override bool ProcessKey(KeyEventArgs keys__1)
            {
              
                switch (keys__1.KeyCode)
                {
                    case Keys.Up:
                    case Keys.Down:
                    case Keys.Left:
                    case Keys.Right:
                        {
                            return false;
                        }

                    default:
                        {
                            return base.ProcessKey(keys__1);
                        }
                }
            }
        }

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Mar 2021
1 answer
181 views

I have a win form on which I have a radribbon component which was working fine.

After I processed an update to Telerik UI components, the form could no longer open in design mode and attached are the error messages.

It looks like a bug, maybe not.

Could anyone assist?

Ekoue

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Mar 2021
10 answers
883 views
Hi
I don't know how to iterate the child rows of each parent row in Hierarchical Grid.
I havn't found any example for this.

I am looking for something like:
foreach (parentrow in grid)
{
    ChildRowCollection = GetChildRow(parentrow)
    foreach (ChildRow in ChildRowCollection )
    {
        do something on the ChildRow
    }
}

Thanks in advance
Yael Kline
Louise
Top achievements
Rank 1
 answered on 08 Mar 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
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
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
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
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?