Telerik Forums
UI for WinForms Forum
2 answers
21 views

There is nothing in the docs about this after four hours of searching. I can only conclude there isn't support for this functionality but find that difficult to believe.

 

Thanks,.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Oct 2023
12 answers
1.5K+ views
I have a RadListBox control and I want to select items based on the value of the item (which is stored in my database). How can I accomplish this with the control?
Dess | Tech Support Engineer, Principal
Telerik team
 updated answer on 18 Oct 2023
1 answer
31 views

Before I attempt to go down this road, can the RadListControl (or any other Telerik control) do the following:

We need text on the left and 2 images on the right both of which can be clicked to fire separate events.

Thanks

Carl

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Jun 2023
2 answers
53 views

Hi,

I have used RadListControl.ScrollToItem to bring a searched for item into view,thi sbrings it into view but either at top or bottom of the list. Is it possible to somehow center the selected item in the middle of the view so that I can obtain context based on surrounding items ?

Many thanks

Toby

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 May 2023
1 answer
57 views
Can I add charts to a ListControl ?
Maria
Telerik team
 answered on 23 Sep 2022
1 answer
116 views

I am required to call an API endpoint, which is return a list of strings. This I have working.

Each item within that list is a daily announcement which is a block of text, that needs to be displaying within a scrolling parent frame. Please refer to the attached .PNG file with a screenshot of the mockup I got from our project managers.

I am not sure which is the best way to do this, as I'm relatively new to Telerik Winform UI. I am looking at either a:

DataGridView
ListControl
List of labels within a panel.

Just trying to find the most effective and simple way to do this. Any suggestions?

 

 

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

Hi.

I have a listbox on a form.  The user enters a value in a text box, clicks a button, the value is added to the list.  All that works.  The button click also sets the selected item to be the just entered value and calls scrolltoitem to reposition the listbox.  The list box doesn't reposition.

Here is the code from the button click function:


        private void radButton1_Click(object sender, EventArgs e)
        {
            var item = radTextBox1.Text;
            if (string.IsNullOrWhiteSpace(item))
                return;

            // let's make sure this folder doesn't already exist in the list.
            if (radListControl1.Items.Contains(item))
                return;

            var newItem = new RadListDataItem(item, item);

            radListControl1.Items.Add(newItem);
            radListControl1.SelectedItem = newItem;

            radListControl1.ScrollToItem(newItem);
        }

I have also attached a working example.

Why doesn't this work as expected?

Thanks

-marc

 

Nadya | Tech Support Engineer
Telerik team
 answered on 19 Jul 2021
3 answers
95 views
Hello!
I'm implementing a notification list where is possible to have several different layouts depends on the bound item's type. The problem is RadListControl attach incompatible DataItem to VisualItem.
In other words, is it possible to have something similar to Android's RecyclerView where depends on an item type you can have a different layout?

001.internal class NotificationA : INotification {
002.     public string Name { get; set; }
003.     public string Type => nameof(NotificationA);
004.}
005. 
006.internal class NotificationB : INotification {
007.    public int Degree { get; set; }
008.    public string Type => nameof(NotificationB);
009.}
010. 
011.internal class NotificationAListItem : RadListVisualItem {
012.        private LightVisualElement notificationTitleElement;
013.        private StackLayoutPanel stackLayout;
014. 
015.        protected override void CreateChildElements()
016.        {
017.            base.CreateChildElements();
018. 
019.            stackLayout = new StackLayoutPanel();
020.            stackLayout.Orientation = System.Windows.Forms.Orientation.Vertical;
021. 
022.            notificationTitleElement = new LightVisualElement();
023.            notificationTitleElement.TextAlignment = ContentAlignment.MiddleLeft;
024.            notificationTitleElement.Margin = new Padding(10);
025.            notificationTitleElement.ForeColor = Color.Black;
026.            stackLayout.Children.Add(notificationTitleElement);
027. 
028.            this.Children.Add(stackLayout);
029.        }
030. 
031.        public override void Synchronize()
032.        {
033.            base.Synchronize();
034.            Text = string.Empty;
035.            if (Data.DataBoundItem is not NotificationA n) return;
036.            notificationTitleElement.Text = Convert.ToString(n.Name);
037.        }
038. }
039. 
040.internal class NotificationBListItem : RadListVisualItem
041.    {
042.        private LightVisualElement notificationTitleElement;
043.        private StackLayoutPanel stackLayout;
044. 
045.        protected override void CreateChildElements()
046.        {
047.            base.CreateChildElements();
048. 
049.            stackLayout = new StackLayoutPanel();
050.            stackLayout.Orientation = Orientation.Vertical;
051. 
052. 
053.            notificationTitleElement = new LightVisualElement();
054.            notificationTitleElement.TextAlignment = ContentAlignment.MiddleLeft;
055.            notificationTitleElement.Margin = new Padding(10);
056.            notificationTitleElement.ForeColor = Color.Black;
057.            stackLayout.Children.Add(notificationTitleElement);
058. 
059.            Children.Add(stackLayout);
060. 
061.            Padding = new Padding(5);
062.            Shape = new RoundRectShape(3);
063.            BorderColor = Color.FromArgb(255, 110, 153, 210);
064.            BorderGradientStyle = GradientStyles.Solid;
065.            DrawBorder = true;
066.            DrawFill = true;
067.            BackColor = Color.FromArgb(255, 230, 238, 254);
068.            GradientStyle = GradientStyles.Solid;
069.        }
070. 
071.        public override void Synchronize()
072.        {
073.            base.Synchronize();
074.            Text = string.Empty;
075.            if (Data.DataBoundItem is not NotificationB n) return;
076.            notificationTitleElement.Text = Convert.ToString(n.Degree);
077.        }
078.}
079. 
080.public partial class TestForm : RadForm {
081.        public TestForm() {
082.            InitializeComponent();
083.            InitializeViewAppearance();
084.        }
085. 
086.        private void InitializeViewAppearance() {
087.            var notifications = new List<INotification> {
088.                new NotificationA {Name = "Foo"},
089.                new NotificationA {Name = "Bar"},
090.                new NotificationB { Degree = 180 }
091.            };
092.            for (var i = 0; i < 100000; i++) {
093.                notifications.Add(new NotificationA { Name = $"test item {i}" });
094.            }
095.            lcNotifications.CreatingVisualListItem += OnNotificationItemCreating;
096.            lcNotifications.DataSource = notifications;
097.        }
098. 
099.        private void OnNotificationItemCreating(object sender, CreatingVisualListItemEventArgs args)
100.        {
101.            args.VisualItem = args.DataItem.DataBoundItem switch {
102.                NotificationA _ => new NotificationAListItem(),
103.                NotificationB _ => new NotificationBListItem(),
104.                _ => args.VisualItem
105.            };
106.        }
107.    }
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Mar 2021
1 answer
192 views
Hi. I want to add a separator (horizontal line) item to my radDropDownList. I've followed the approach at https://www.telerik.com/forums/adding-some-separator-in-the-list which works. However I have 2 items that have empty string as the text and I only want one of them to be shown as a horizontal line. I'm using a data bound list and I'd like to use either the item's value or it's tag to determine whether to show the item as a horizontal line or not. How do I get the item's value or it's tag from the VisualListItemFormatting event?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Aug 2019
1 answer
17 views

I have a listbox and want to set some of the items as bold based on various criteria.

Example 1:

Listbox contains a list of all employees and I want to bold the employees who are listed as "working" in another table.

 

Example 2:

Listbox contains a list of ALL Products and I want to bold the ones that are that are in are on sale (as identified in another table).

 

I've looked at the examples of changing format based on selection or hover, but I can't figure out how to translate that into the above use cases.

Nadya | Tech Support Engineer
Telerik team
 answered on 18 Jul 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
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
Menu
RichTextEditor
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Barcode
Styling
ColorBox
PictureBox
Callout
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?