Telerik Forums
UI for WinForms Forum
6 answers
124 views

Hello,

I have implemented a custom AppointmentElement and I habe a small display problem with it.

Here is a screenshot: Screenshot

When the area of the appointment gets to small,  the arrow on the right is no longer drawn, but i want the element to always draw it and cut the text first.

Here is my implementation:


internal class CustomAppointmentElement : AppointmentElement
{
    private AppointmentsViewModel _appointmentsViewModel;
    private DockLayoutPanel _outerContainer;
    private StackLayoutElement _container;
    private LightVisualButtonElement _expandCollapseButton;
    private LightVisualElement _icon1;
    private LightVisualElement _icon2;
    private LightVisualElement _icon3;
    private LightVisualElement _timeText;
    private LightVisualElement _summaryText;
    private LightVisualElement _continueArrow;

    protected override void CreateChildElements()
    {
        base.CreateChildElements();
        this.Padding = new Padding(1, 0, 1, 0);

        _outerContainer = new DockLayoutPanel();
        _outerContainer.StretchHorizontally = true;
        _outerContainer.StretchVertically = true;
        _outerContainer.ShouldHandleMouseInput = false;
        _outerContainer.NotifyParentOnMouseInput = true;
        _outerContainer.LastChildFill = true;

        _continueArrow = new LightVisualElement();
        _continueArrow.Image = ArrowRightImage;
        _continueArrow.StretchHorizontally = false;

        _container = new StackLayoutElement();
        _container.Orientation = Orientation.Horizontal;
        _container.Alignment = ContentAlignment.MiddleLeft;
        _container.StretchHorizontally = false;
        _container.StretchVertically = true;
        _container.ShouldHandleMouseInput = false;
        _container.NotifyParentOnMouseInput = true;

        _expandCollapseButton = new LightVisualButtonElement();
        _expandCollapseButton.ShouldHandleMouseInput = true;
        _expandCollapseButton.Margin = new Padding(1, 1, 0, 1);
        _expandCollapseButton.NotifyParentOnMouseInput = false;
        _expandCollapseButton.Alignment = ContentAlignment.MiddleLeft;
        _expandCollapseButton.StretchHorizontally = false;
        _expandCollapseButton.StretchVertically = false;
        _expandCollapseButton.Click += _expandCollapseButton_Click;
        _expandCollapseButton.Image = GetButtonImage(false);

        _icon1 = new LightVisualElement();
        _icon1.ShouldHandleMouseInput = false;
        _icon1.Margin = new Padding(1, 1, 0, 1);
        _icon1.NotifyParentOnMouseInput = true;
        _icon1.Alignment = ContentAlignment.MiddleLeft;
        _icon1.StretchHorizontally = false;
        _icon1.StretchVertically = false;

        _icon2 = new LightVisualElement();
        _icon2.ShouldHandleMouseInput = false;
        _icon2.NotifyParentOnMouseInput = true;
        _icon2.Alignment = ContentAlignment.MiddleLeft;
        _icon2.StretchHorizontally = false;
        _icon2.StretchVertically = false;
        _icon2.Margin = new Padding(2, 1, 0, 1);

        _icon3 = new LightVisualElement();
        _icon3.ShouldHandleMouseInput = false;
        _icon3.NotifyParentOnMouseInput = true;
        _icon3.Alignment = ContentAlignment.MiddleLeft;
        _icon3.StretchHorizontally = false;
        _icon3.StretchVertically = false;
        _icon3.Margin = new Padding(2, 1, 0, 1);

        _timeText = new LightVisualElement();
        _timeText.Alignment = ContentAlignment.MiddleLeft;
        _timeText.ShouldHandleMouseInput = false;
        _timeText.NotifyParentOnMouseInput = true;
        _timeText.StretchHorizontally = false;
        _timeText.StretchVertically = false;
        _timeText.Margin = new Padding(2, 1, 2, 1);
        _timeText.ClipText = true;
        _timeText.TextWrap = false;
        _timeText.AutoEllipsis = true;

        _summaryText = new LightVisualElement();
        _summaryText.Alignment = ContentAlignment.MiddleLeft;
        _summaryText.ShouldHandleMouseInput = false;
        _summaryText.NotifyParentOnMouseInput = true;
        _summaryText.StretchHorizontally = false;
        _summaryText.StretchVertically = false;
        _summaryText.Margin = new Padding(2, 1, 2, 1);
        _summaryText.ClipText = true;
        _summaryText.TextWrap = false;
        _summaryText.AutoEllipsis = true;
        _summaryText.Font = new Font(_summaryText.Font, FontStyle.Bold);

        _container.Children.Add(_expandCollapseButton);
        _container.Children.Add(_icon1);
        _container.Children.Add(_icon2);
        _container.Children.Add(_icon3);
        _container.Children.Add(_timeText);
        _container.Children.Add(_summaryText);

        DockLayoutPanel.SetDock(_container, Telerik.WinControls.Layouts.Dock.Left);
        _outerContainer.Children.Add(_continueArrow);
        DockLayoutPanel.SetDock(_continueArrow, Telerik.WinControls.Layouts.Dock.Right);
        _outerContainer.Children.Add(_container);

        Children.Add(_outerContainer);
    }
}

Hope you could help me solve it.

 

Regards,

Stephan

Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 16 Jan 2024
2 answers
457 views
Would it be possible to create combobox (within GridViewComboBoxColumn) with image and text (as it was done for RadDropDownList)?
Nadya | Tech Support Engineer
Telerik team
 answered on 16 Jan 2024
1 answer
89 views

Hi,

I can generate a spreadsheet from stream then visualize it with a radspreadsheet and related ribbon bar, but when I save it, the default extension is always .xls, all I want is to save as default in xlsx (and maybe remove the other file type filters).

Also I was unable to set a default name for the file, how can I do that?

Thank you.

Alessandro

Nadya | Tech Support Engineer
Telerik team
 answered on 16 Jan 2024
1 answer
77 views

Hello,

I created a custom column and cell in my grid following the progress-bar example

https://docs.telerik.com/devtools/winforms/controls/gridview/cells/creating-custom-cells

But I have modified it so that I can view either a textBoxElement or a dropDownListElement depending on what data is in the cell. It all seems to work just fine until I scroll the grid. Scrolling visualy shuffles the data in the custom column. I've tried to take the cell-formatting route but without success. Is it possible to achieve this result somehow?

 Public Class GridParameterValueElement
        Inherits GridDataCellElement

        Public Sub New(ByVal column As GridViewColumn, ByVal row As GridRowElement)
            MyBase.New(column, row)
        End Sub

        Private isInitialized As Boolean
        Private firstTimeIndexChanged As Boolean = True
        Private dropDown As RadDropDownListElement
        Private textBox As RadTextBoxElement
        Protected Overrides Sub CreateChildElements()
            MyBase.CreateChildElements()
            dropDown = New RadDropDownListElement() With { 
                .DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList
            }
            textBox = New RadTextBoxElement() With {
                .Enabled = True,
                .ClickMode = Telerik.WinControls.ClickMode.Press,
                .ZIndex = -1
            }
            If Me.Children.Contains(dropDown) Then Me.Children.Remove(dropDown)
            If Me.Children.Contains(textBox) Then Me.Children.Remove(textBox)
            Me.Children.Add(dropDown)
            Me.Children.Add(textBox)
            AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
            AddHandler textBox.TextChanged, AddressOf TextInBoxChanged
            'AddHandler textBox.Click, AddressOf TextBox_Click

        End Sub

        Protected Overrides Sub DisposeManagedResources()
            RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
            RemoveHandler textBox.TextChanged, AddressOf TextInBoxChanged
            MyBase.DisposeManagedResources()
        End Sub
            
        'Private Sub TextBox_Click(sender As Object, e As EventArgs)
        '    Dim test  = sender
        'End Sub


        Public Overrides Sub SetContent()
            MyBase.SetContent()

            If Me.RowInfo.Cells("DisplayValue").Tag IsNot Nothing Then

                If Not Me.isInitialized Then 
                    If Me.Children.Contains(textBox) Then Me.Children.Remove(textBox)

                    With Me.dropDown
                        .DataSource = Me.RowInfo.Cells("DisplayValue").Tag
                        .ValueMember = ("DevelopmentTypeParameterValueId")
                        .DisplayMember = ("ParameterValue")
                    End With 
                End If

                If Me.RowInfo.Tag IsNot Nothing Then
                    RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                    dropDown.SelectedIndex = DirectCast(Me.RowInfo.Tag, Integer)
                    AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                Else
                    RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                    dropDown.SelectedIndex = -1
                    AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                End If

            ElseIf Me.Value IsNot Nothing AndAlso Me.Value IsNot DBNull.Value Then

                If Not Me.isInitialized Then 
                    If Me.Children.Contains(dropDown) Then Me.Children.Remove(dropDown)
                    Me.textBox.Text = CStr(Me.Value)
                End If
       
            End If

            Me.isInitialized = True
        
        End Sub


        Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
            Get
                Return GetType(GridDataCellElement)
            End Get
        End Property

        Public Overrides Function IsCompatible(ByVal data As GridViewColumn, ByVal context As Object) As Boolean
            Return TypeOf data Is GridViewParameterValueColumn AndAlso TypeOf context Is GridDataRowElement
        End Function

    End Class
    
    Public Class GridViewParameterValueColumn
        Inherits GridViewDataColumn
        Public Sub New(ByVal fieldName As String)
            MyBase.New(fieldName)
        End Sub
        Public Overrides Function GetCellType(ByVal row As GridViewRowInfo) As Type
            If TypeOf row Is GridViewDataRowInfo Then
                Return GetType(GridParameterValueElement)
            End If
            Return MyBase.GetCellType(row)
        End Function
    End Class


Nadya | Tech Support Engineer
Telerik team
 answered on 16 Jan 2024
1 answer
169 views

Hi everyone,

is possible with the Zip Library of Telerik UI for WinForms to get the status of compression progress?

What I want is to fill a radprogressbar, so the user can see how much work was already done.

Tank you.

Alessandro

Yoan
Telerik team
 answered on 16 Jan 2024
2 answers
110 views

Hi,

I would like to have a grid with no cell selected by default. So every time it is loaded no CurrentCell is selected. Same when there is no selection and the grid is sorted by a column.

Right now, the grid marks the first cell as CurrentCell when it is loaded. I could solve it using the .ClearSelection() method but then I have the same problem when sorting: the first cell is marked as selected.

How can avoid this behavior and only set the CurrentCell when the user marks it?

Nadya | Tech Support Engineer
Telerik team
 answered on 15 Jan 2024
1 answer
378 views

Hi,

It seems after upgrading to the latest Nuget version of UI.for.WinForms.AllControls.Net70" (Version="2023.3.1114") I ran into the following issue when opening the designer :

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Schema, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Le fichier spécifié est introuvable.
                        File name: 'System.Runtime.Serialization.Schema, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
                           at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
                           at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
                           at Microsoft.DotNet.DesignTools.Server.DesignToolsServer.LoadReferencedAssemblies(AssemblyName[] referencedAssemblyNames, HashSet`1 serverDependenciesNames, CancellationToken cancellationToken)

 

After the designer shows up, every custom user control I'm using on it (based on Telerik controls) completely disappear.

If I make a single change and save the file, I can confirm that all of them are gone, looking at the diff with Git.

I'm wondering if it's a Telerik or a Visual Studio issue, but either way, the result is that I can't work anymore on this project.


Jérôme
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 11 Jan 2024
3 answers
88 views

Hi, I found out that for some languages like Hungarian <html> tag used in radLabel.text white spaces are escaped.

See an example below:

Is there a way to not remove these white spaces?

Br

Pawel

 

Nadya | Tech Support Engineer
Telerik team
 answered on 11 Jan 2024
0 answers
80 views

Hi all,

I want to set the initial state of a radCollapsiblePanel to expanded or collapsed. Then, I want to associate an event handler to handle user interaction that can expand or collapse the panel. I perform some operations to set the initial state. When I attach the event handler for the collapsed state, the event is triggered even if the user has not interacted with the panel.

I don't understand why.

Suggestions

Regards

Alessandro

Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 09 Jan 2024
1 answer
81 views

My form have some RadCommandBar, when I click on OverflowButton then a dropdownMenu to show with default two item:

1. Add or Remove Buttons

2. Customize...

And then,  my mouse click on another control on my form, but I see that  RadCommandBar's DropdownMenu do not close.

I also try to some again, but do not anything change.

You can see my image I attached below. I use Telerik version: R3 2022 window form from Nuget package for Application .Net Core

Thank you so much.

Nadya | Tech Support Engineer
Telerik team
 answered on 09 Jan 2024
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
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
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?