Telerik Forums
UI for WinForms Forum
3 answers
1.1K+ views
Hi again!

How can I check if context menu is displayed?

I have a mouse_click event and if the user right clicks off a row (into white space) I display a custom popup. However, when the user right clicks on a row, the context menu pops up and then my menu pops up over top.

What i need to do is to determine whether the user right clicked on a row, or on white space so i can avoid showing my popup if they right clicked on a row.  

Thanks.


Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Dec 2019
2 answers
178 views

Hello,

Is there a simple way to get the selected appointment in agenda view?

Or is there a way to convert a AgendaAppointmentWrapper to an Appointment?

Grtz and thnxs

Patrick Vossen

Patrick
Top achievements
Rank 1
 answered on 29 Nov 2019
3 answers
499 views
Hi,

Is there a way to place a button inside of a textbox?

Here's my scenario:
A user has a textbox to enter words that they wish to search for. After they have searched and they want to clear the results, i want to have a button (a red x button or something) that shows up at the end of the textbox (inside the textbox) allow them to clear the textbox and search results.

I've tried making a RadButtonElement and adding it to the TextBoxElement.Children but the button appears to show up behind the textbox element. I can see and click on the very bottom edge of the textbox and fire the event handler.

        Dim btnElement As New RadButtonElement  
        btnElement.Text = "try this" 
        btnElement.Size = New Drawing.Size(20, 20)  
 
        Dim textboxElement As RadTextBoxElement = txtSearchFor.TextBoxElement  
 
        textboxElement.Children.Add(btnElement)  
        AddHandler btnElement.Click, AddressOf btnClearSearh_Click 

Thanks
Nadya | Tech Support Engineer
Telerik team
 answered on 29 Nov 2019
4 answers
362 views

I have gridview with string, date, and numeric columns.  Once I set the data source and fill with data, I format each column to a suitable display - eg: short date, 2 decimal places for some, 4 decimals for others, etc. using the column.formatstring.  

On a row click I need to get the formatted cell text, not the value and am wondering how I can do this?  Eg: the underlying value of a cell is 12345.670000 but is formatted and displayed in the cell as 12,345.67.  I could not find a "cell.text" property; and cell.value gives me the raw data.

How can I get the formatted cell text?  Thanks, Brendan

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Nov 2019
4 answers
234 views

Hello

I try to use the BrowseEditor in DialogType=FontFialog and I am faced with a few questions:

The value returned is a string ex: "Microsoft Sans Serif; 12pt; style=Bold"

1. How do I convert this string to a font type, taking into account that depending on the culture the size may be shown as 8,5 or 8.5

2. How do I set the initial value of the fonteditor from a fontvariable

4. Selecting "Modern 20, bold, size 8", I get the value: "Modern No. 20; 8,249999pt; style=Bold" (not that I want to use this font but I came across this anomality ,,,)

5. How do I change the initial text "(none)" in a localized text

 

And While I am on the BrowseEditor, in folderBrowseDialog, I select the intial directory on the .value property and it sets it properly but it is not always "visible" how can I insurevisible on the selected folder

 

Thanks in advance

Pierre-Jean

pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 28 Nov 2019
4 answers
260 views

Hello

in the FontDialog of the RadBrowseEditor is it possible to hide the three elements:
- Effects
- Sample
- Script

Thanks in advance

Pierre-Jean

pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 28 Nov 2019
5 answers
680 views

I need the right-click context, so setting the scheduler to readonly isn't an option.

I need to stop the scheduler showing the edit dialog when an appointment is double clicked... Any ideas?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Nov 2019
1 answer
278 views

Hello,

I have a dock, with 3 tool windows inside. There is only space for 2 out of 3 when the form is not maximized, how can I enable scrollbars / scrolling for the dock when there is not enough space for all of them?

 

Thanks in advance

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Nov 2019
2 answers
172 views

I think I have discovered a bug in the ChartView below is the designer and code for the user control

If you create a user control and past the code into it you should be able to replicate this;

Note: to load the chart - double-click on the chart

The first time it loads properly

The second time you double-click it - you will see that it loses its formatting.

Maybe (it's possible) that I have some conflicting line(s) of code causing this but I cannot find any conflicting code... perhaps you can test out and let me know what you think?

 

Here's the UserControl.vb Code

Imports Telerik.Charting
Imports Telerik.WinControls
Imports Telerik.WinControls.UI
Imports TelerikHelper

Public Class ucChartTest
    Private Sub ucChartTest_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        populateCustomers()
        populateQ1()
        populateQ2()
        populateQ3()
        populateQ4()
    End Sub

#Region " ENUMS "
    Private Enum GridFields
        CustomerRefFullName = 0
        Q1 = 1
        Q2 = 2
        Q3 = 3
        Q4 = 4
        Total = 5
    End Enum
#End Region

#Region " ArrayLists "
    Private _arrCustomers As New ArrayList
    Private Sub populateCustomers()
        _arrCustomers.Clear()
        _arrCustomers.Add("Customer 1")
        _arrCustomers.Add("Customer 2")
        _arrCustomers.Add("Customer 3")
        _arrCustomers.Add("Customer 4")
        _arrCustomers.Add("Customer 5")
        _arrCustomers.Add("Customer 6")
        _arrCustomers.Add("Customer 7")
        _arrCustomers.Add("Customer 8")
        _arrCustomers.Add("Customer 9")
        _arrCustomers.Add("Customer 10")
    End Sub

    Private _arrQ1 As New ArrayList
    Private Sub populateQ1()
        _arrQ1.Clear()
        _arrQ1.Add(73)
        _arrQ1.Add(69)
        _arrQ1.Add(50)
        _arrQ1.Add(32)
        _arrQ1.Add(34)
        _arrQ1.Add(19)
        _arrQ1.Add(27)
        _arrQ1.Add(24)
        _arrQ1.Add(27)
        _arrQ1.Add(30)
    End Sub

    Private _arrQ2 As New ArrayList
    Private Sub populateQ2()
        _arrQ2.Clear()
        _arrQ2.Add(40)
        _arrQ2.Add(82)
        _arrQ2.Add(47)
        _arrQ2.Add(46)
        _arrQ2.Add(32)
        _arrQ2.Add(21)
        _arrQ2.Add(39)
        _arrQ2.Add(45)
        _arrQ2.Add(29)
        _arrQ2.Add(33)
    End Sub

    Private _arrQ3 As New ArrayList
    Private Sub populateQ3()
        _arrQ3.Clear()
        _arrQ3.Add(93)
        _arrQ3.Add(76)
        _arrQ3.Add(58)
        _arrQ3.Add(41)
        _arrQ3.Add(41)
        _arrQ3.Add(37)
        _arrQ3.Add(35)
        _arrQ3.Add(22)
        _arrQ3.Add(39)
        _arrQ3.Add(21)
    End Sub

    Private _arrQ4 As New ArrayList
    Private Sub populateQ4()
        _arrQ4.Clear()
        _arrQ4.Add(75)
        _arrQ4.Add(39)
        _arrQ4.Add(31)
        _arrQ4.Add(27)
        _arrQ4.Add(30)
        _arrQ4.Add(51)
        _arrQ4.Add(10)
        _arrQ4.Add(13)
        _arrQ4.Add(6)
        _arrQ4.Add(16)
    End Sub
#End Region

#Region " Quarterly Sales Distribution "
    Private Sub BuildQuarterlySalesDistribution()
        Try
            RadChartView2.Series.Clear()

            RadChartView2.ShowLegend = True
            RadChartView2.ShowTitle = False
            RadChartView2.ShowSmartLabels = True
            RadChartView2.ShowGrid = True

            RadChartView2.Area.View.Palette = KnownPalette.Warm

            RadChartView2.ChartElement.LegendElement.TitlePosition = TitlePosition.Top
            RadChartView2.ChartElement.LegendPosition = LegendPosition.Top
            RadChartView2.ChartElement.LegendElement.StackElement.Orientation = Orientation.Horizontal

            AddHandler RadChartView2.ChartElement.LegendElement.VisualItemCreating, AddressOf LegendElement_VisualItemCreating

            Dim barSeriesQ1 As New Telerik.WinControls.UI.BarSeries("Q1", "Customer")
            For i As Integer = 0 To _arrQ1.Count - 1
                barSeriesQ1.DataPoints.Add(New CategoricalDataPoint(CDbl(_arrQ1(i)), _arrCustomers(i)))
            Next
            barSeriesQ1.ShowLabels = False
            barSeriesQ1.LegendTitle = "Q1"
            barSeriesQ1.CombineMode = ChartSeriesCombineMode.Stack
            RadChartView2.Series.Add(barSeriesQ1)

            Dim barSeriesQ2 As New Telerik.WinControls.UI.BarSeries("Q2", "Customer")
            For i As Integer = 0 To _arrQ2.Count - 1
                barSeriesQ2.DataPoints.Add(New CategoricalDataPoint(CDbl(_arrQ2(i)), _arrCustomers(i)))
            Next
            barSeriesQ2.ShowLabels = False
            barSeriesQ2.LegendTitle = "Q2"
            barSeriesQ2.CombineMode = ChartSeriesCombineMode.Stack
            RadChartView2.Series.Add(barSeriesQ2)

            Dim barSeriesQ3 As New Telerik.WinControls.UI.BarSeries("Q3", "Customer")
            For i As Integer = 0 To _arrQ3.Count - 1
                barSeriesQ3.DataPoints.Add(New CategoricalDataPoint(CDbl(_arrQ3(i)), _arrCustomers(i)))
            Next
            barSeriesQ3.ShowLabels = False
            barSeriesQ3.LegendTitle = "Q3"
            barSeriesQ3.CombineMode = ChartSeriesCombineMode.Stack
            RadChartView2.Series.Add(barSeriesQ3)

            Dim barSeriesQ4 As New Telerik.WinControls.UI.BarSeries("Q4", "Customer")
            For i As Integer = 0 To _arrQ4.Count - 1
                barSeriesQ4.DataPoints.Add(New CategoricalDataPoint(CDbl(_arrQ4(i)), _arrCustomers(i)))
            Next
            barSeriesQ4.ShowLabels = False
            barSeriesQ4.LegendTitle = "Q4"
            barSeriesQ4.CombineMode = ChartSeriesCombineMode.Stack
            RadChartView2.Series.Add(barSeriesQ4)


            RadChartView2.GetArea(Of CartesianArea)().Orientation = Orientation.Horizontal
            Application.DoEvents()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub LegendElement_VisualItemCreating(sender As Object, e As LegendItemElementCreatingEventArgs)
        e.ItemElement = New CustomLegendItemElement(e.LegendItem)
    End Sub

    Private Sub RadChartView2_LegendElement_VisualItemCreating(sender As Object, e As LegendItemElementCreatingEventArgs)
        e.ItemElement = New CustomLegendItemElement(e.LegendItem)
    End Sub

    Private Sub RadChartView2_DoubleClick(sender As Object, e As EventArgs) Handles RadChartView2.DoubleClick
        BuildQuarterlySalesDistribution()
    End Sub

    Private Sub RadChartView2_LabelFormatting(sender As Object, e As ChartViewLabelFormattingEventArgs) Handles RadChartView2.LabelFormatting
        Try
            e.LabelElement.Font = FontSegio
            e.LabelElement.BorderColor = Color.Black
            e.LabelElement.BackColor = Color.White
            e.Series.LabelRotationAngle = 45
            Dim series As BarSeries = TryCast(e.Series, BarSeries)
            Dim dblBarChartDataPoint As Double = GetBarChartDataPointValue(RadChartView2, e)
        Catch ex As Exception

        End Try
    End Sub
#End Region

End Class


 

Here's the Designer Code

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class ucChartTest
    Inherits System.Windows.Forms.UserControl

    'UserControl overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        Dim CartesianArea1 As Telerik.WinControls.UI.CartesianArea = New Telerik.WinControls.UI.CartesianArea()
        Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
        Me.RadLabel4 = New Telerik.WinControls.UI.RadLabel()
        Me.RadChartView2 = New Telerik.WinControls.UI.RadChartView()
        Me.TableLayoutPanel1.SuspendLayout()
        CType(Me.RadLabel4, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.RadChartView2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'TableLayoutPanel1
        '
        Me.TableLayoutPanel1.BackColor = System.Drawing.Color.White
        Me.TableLayoutPanel1.ColumnCount = 1
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
        Me.TableLayoutPanel1.Controls.Add(Me.RadLabel4, 0, 1)
        Me.TableLayoutPanel1.Controls.Add(Me.RadChartView2, 0, 2)
        Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
        Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(0)
        Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
        Me.TableLayoutPanel1.RowCount = 3
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
        Me.TableLayoutPanel1.Size = New System.Drawing.Size(370, 374)
        Me.TableLayoutPanel1.TabIndex = 0
        '
        'RadLabel4
        '
        Me.RadLabel4.AutoSize = False
        Me.RadLabel4.Dock = System.Windows.Forms.DockStyle.Fill
        Me.RadLabel4.Font = New System.Drawing.Font("Segoe UI Semilight", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.RadLabel4.Location = New System.Drawing.Point(0, 28)
        Me.RadLabel4.Margin = New System.Windows.Forms.Padding(0)
        Me.RadLabel4.Name = "RadLabel4"
        Me.RadLabel4.Size = New System.Drawing.Size(370, 28)
        Me.RadLabel4.TabIndex = 3
        Me.RadLabel4.Text = "QUARTERLY SALES DISTRIBUTION"
        '
        'RadChartView2
        '
        Me.RadChartView2.AreaDesign = CartesianArea1
        Me.RadChartView2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.RadChartView2.Location = New System.Drawing.Point(3, 59)
        Me.RadChartView2.Name = "RadChartView2"
        Me.RadChartView2.ShowGrid = False
        Me.RadChartView2.Size = New System.Drawing.Size(364, 312)
        Me.RadChartView2.TabIndex = 8
        '
        'ucChartTest
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.Controls.Add(Me.TableLayoutPanel1)
        Me.Margin = New System.Windows.Forms.Padding(0)
        Me.Name = "ucChartTest"
        Me.Size = New System.Drawing.Size(370, 374)
        Me.TableLayoutPanel1.ResumeLayout(False)
        CType(Me.RadLabel4, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.RadChartView2, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

    Friend WithEvents TableLayoutPanel1 As TableLayoutPanel
    Friend WithEvents RadLabel4 As Telerik.WinControls.UI.RadLabel
    Friend WithEvents RadChartView2 As Telerik.WinControls.UI.RadChartView
End Class














Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Nov 2019
16 answers
959 views
Hi all,

I am pretty sure it is very easy to achive but I just can't find it.

I have an application that uses quite a lot of CollapsiblePanels but it also uses Tabs and so the layout has a lot of borders that make the whole stuff look a bit... restless.
So I want to hide the border of the CollapsiblePanels without having to mess with the theme (the tool uses a theme manager and the user can switch between some of the custom themes) so I need to hide the borders in general.

How can I do that?

Kind regards,
Gabriele
Martin
Top achievements
Rank 1
 answered on 27 Nov 2019
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
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
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
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?