Telerik Forums
UI for WinForms Forum
4 answers
179 views
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RadautocompleteDemo.Model;
using Telerik.WinControls.UI;
using Telerik.WinControls.Data;
using Telerik.WinControls;
namespace RadautocompleteDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();



            radAutoCompleteBox1.AutoCompleteDataSource = new Sample().ListGetSuggestions();
            radAutoCompleteBox1.AutoCompleteDisplayMember = "name";
            radAutoCompleteBox1.AutoCompleteValueMember = "id";



        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i = radAutoCompleteBox1.MaxLength;
            int j = radAutoCompleteBox1.TextLength;

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.radAutoCompleteBox1.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
        }
        List<Telerik.WinControls.UI.RadTokenizedTextItem> list = new List<RadTokenizedTextItem>();
       // HashSet<Telerik.WinControls.UI.RadTokenizedTextItem> HashSet = new HashSet<RadTokenizedTextItem>();
        void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            RadTokenizedTextItemCollection items = sender as RadTokenizedTextItemCollection;
            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                //list.so

                foreach (RadElement element in this.radAutoCompleteBox1.TextBoxElement.ViewElement.Children)
                {
                    TokenizedTextBlockElement token = element as TokenizedTextBlockElement;
                    if (token.Item == e.NewItems.SyncRoot)
                    {
                        MessageBox.Show("Item.already prepset");
                       //NotifyCollectionChangedAction.Remove;
                    }
                   
                }
                Int32 index = 0;
                for (int i = 0; i < e.NewItems.Count; i++)
                {
                    
                        list.Add((e.NewItems[i]) as RadTokenizedTextItem);
                    
                    //bool chekc = HasDuplicates((e.NewItems[i])as RadTokenizedTextItem);
                        list.Sort();
                       
                        while (index < list.Count - 1)
                        {
                            if (list[index] == list[index + 1])
                                list.RemoveAt(index);
                            else
                                index++;
                        }
                }
             

            }
        }

        private bool HasDuplicates(RadTokenizedTextItem radTokenizedTextItem)
        {
           // List<RadTokenizedTextItem> vals = new List<RadTokenizedTextItem>();
            bool returnValue = true;
            foreach (var s in list)
            {
               
                if (list.Contains(radTokenizedTextItem))
                {
                    returnValue = false;
                    break;
                }
               
            }


            return returnValue;
        }






    }
}


I am Trying to remove the duplicate values entered by user..if suppose user enters the duplicate values in the radAutocomplete textbox then i just want to give the messagebox that "Duplicate values are not allowed"and after giving this message i just want to remove the duplicate value entered by the user automaticaly..
I am new to this controls i tried to find out the events but i didnt get any...
so please give me the solution
Thaning You in advance
Zan
Top achievements
Rank 1
 answered on 23 Dec 2017
1 answer
97 views

I Have a problem I am using a custom appointment element to add a checkbox to the scheduler while that works the appointment is streching to the full time slot I can have multiple appointments in the same time slot so how do I stop this hapening. 

 

Also I wish to place the name of the patient beside the time on the slot it self but no matter what I try it only shows the time slot 

 

01.using System;
02.using System.Collections.Generic;
03.using System.Drawing;
04.using System.Linq;
05.using System.Text;
06.using System.Threading.Tasks;
07.using System.Windows.Forms;
08.using Telerik.WinControls.UI;
09. 
10.namespace WindowsFormsApplication1.Classes.Appointments
11.{
12.    public class MyAppointmentElement : AppointmentElement
13.    {
14.        public MyAppointmentElement(RadScheduler scheduler, SchedulerView view, IEvent appointment)
15.            : base(scheduler, view, appointment)
16.        { }
17. 
18.        StackLayoutElement container = new StackLayoutElement();
19.        RadCheckBoxElement checkBox = new RadCheckBoxElement();
20.        StackLayoutElement panel = new StackLayoutElement();
21.        LightVisualElement timeInterval = new LightVisualElement();
22.        LightVisualElement description = new LightVisualElement();
23.        SourceContext SourceDal = new SourceContext();
24.        Patient patientInfo = new Patient();
25.        RadLabelElement label = new RadLabelElement();
26.        protected override void CreateChildElements()
27.        {
28.            base.CreateChildElements();
29. 
30.            this.container = new StackLayoutElement();
31.            this.container.Orientation = Orientation.Horizontal;
32.            this.container.StretchHorizontally = true;
33.            this.container.StretchVertically = true;
34. 
35.            this.checkBox = new RadCheckBoxElement() { MaxSize = new Size(20, 0) };
36.            this.checkBox.CheckStateChanged += CheckBox_CheckStateChanged;
37.            this.container.Children.Add(this.checkBox);
38. 
39. 
40. 
41.            this.label = new RadLabelElement();
42.            this.Text = "David Buckley test ";
43.            this.container.Children.Add(this.label);
44. 
45. 
46.            this.panel.StretchHorizontally = true;
47.            this.panel.StretchVertically = true;
48.            this.panel.Orientation = Orientation.Vertical;
49.            this.panel.Children.Add(timeInterval);
50.            this.panel.Children.Add(description);
51.         
52. 
53.            this.container.Children.Add(this.panel);
54.            this.Children.Add(this.container);
55.        }
56. 
57.        protected override SizeF ArrangeOverride(SizeF finalSize)
58.        {
59.            SizeF size = base.ArrangeOverride(finalSize);
60. 
61.            float start = this.checkBox.DesiredSize.Width;
62.            this.panel.Arrange(new RectangleF(start, 0, size.Width - start, size.Height));
63. 
64.            return size;
65.        }
66. 
67.        private void CheckBox_CheckStateChanged(object sender, EventArgs e)
68.        {
69.            //...
70.        }
71. 
72.        private void button_Click(object sender, EventArgs e)
73.        {
74.            this.Scheduler.Appointments.Remove(this.Appointment);
75.        }
76. 
77. 
78.       
79.        public override void Synchronize()
80.        {
81.            base.Synchronize();
82. 
83.            timeInterval.Text = this.Appointment.Start.ToLongTimeString() + " - " + this.Appointment.End.ToLongTimeString();
84.            description.Text = this.Appointment.Summary;
85.        }
86. 
87.        public override void DrawEventText(Telerik.WinControls.Paint.IGraphics graphics)
88.        {
89.            //leave the method empty to prevent the default appointment information to be drawn
90.        }
91.    }
92.}

 

 

 

 

david
Top achievements
Rank 1
 answered on 22 Dec 2017
2 answers
87 views

Hello guys.

I want to add to my app RadSplitButton, but I can't configure it normally. I was looking to example code from telerik how to use this type of buttons. But when I added it to my project with all settings, buttons behavior was diffrenet from the telerik example. Allways when I am pressing on the button in all the places(Arrow button, Action button) the DropDownMenu is opened (the differance is that in the telerik example DropDownMenu opened only when Arrow button pressed).

The 1st question is why example has't all the settings? And I think I am not telling about one property that has be forgotten, because selection of the button in example was modified too.

I tried to find a property that can disable menu popupping, but my attempt was failed.

I found ugly solution:

- Set property DropDownButtonElement.DropDownMenu.PopupElement.Visibility = ElementVisibility.Collapsed 

- Add click method to Click Event for DropDownButtonElement.ActionButton, and add to the start of the method this function: DropDownButtonElement.DropDownMenu.Hide()

This solution works fine, but I believe that there is another way to disable menu popup on. Have you guys any ideas?

 

 

 

Ivan
Top achievements
Rank 1
 answered on 22 Dec 2017
3 answers
165 views

I'm new to using Kendo and have tried the following example that allows for a GridView in Virtual Mode to have sorting etc.

http://www.telerik.com/support/kb/winforms/gridview/details/high-performance-with-radgridview-and-virtual-mode-including-filtering-sorting-and-grouping

 

Using the latest version of Kendo with this example, the Grid still throws the 'Operation not supported in Virtual Mode' exceptions.

 

Has this functionality been changed / broken / replaced? Whilst I have a virtual mode grid working with a large data source through service interfaces using linq incl. paging, I can't even override the header sorting myself without these exceptions being thrown which kind of makes the grid not very useful for paging large result sets. The articles on the subject saying what to do no longer seem to work unless I'm missing something.

 

Andy

Dimitar
Telerik team
 answered on 22 Dec 2017
4 answers
198 views
Is it possible to change the appointment slots and the start time of the scheduler winforms control ?
Hristo
Telerik team
 answered on 22 Dec 2017
0 answers
92 views

I am trying to place RadDropDownElement controls in a list by putting them in a stackLayout and overriding CreateVisualElement.  That works.

My problem is that the shows up in black and white with no theming whatsoever.  The new VisualItem returns ThemeEffectiveType properly, but this is for the contained dropdowns, not the list control itself.

Why are the dropdowns not themed, and how do I correct this?

 

 

Dave
Top achievements
Rank 1
 asked on 21 Dec 2017
0 answers
77 views

I need a control that has a growable list of rows, and I'd like a strip of buttons.

I thought I could just use a RadListView and create my own VisualItems, but I cannot add a RadDropDownButton to it because that control doesn't appear to derive from RadElement.

I really don't want to have to manage scrolling and growth on my own with a RadScrollablePanel, so what's the best way to go about this?  All I need is a control that can show a list of strips that contain other controls that happen to include RadDropDownButtons and so on.

So what's the best way to manage a growing list of RadDropDownButton-based objects?

 

 

Dave
Top achievements
Rank 1
 asked on 21 Dec 2017
2 answers
145 views

I have a GridView bound to a DataTable.

.DataSource = table

I have all the properties set.(EnableFiltering = true, MasterTemplate.EnableFiltering = true, etc...

It shows the filtering, but when I attempt to do a filter, it does nothing...

Hristo
Telerik team
 answered on 21 Dec 2017
0 answers
70 views

Hello Telerik Team,

    I'm using RadGridView and has checkBoxColumn with Enabling HeaderCheckBox. When RadGridView is set to ReadOnly, checkBox from Data cell can't change toggle state. But checkBox from Header Cell can still changeable.

    How to prevent this cause ???

 

 

Zan
Top achievements
Rank 1
 asked on 21 Dec 2017
4 answers
207 views

Something so simply yet Telerik seems so un-intuitive.

I want a buttonface background color, but the cells I want white. It seems when I set the background color, it then colors the cells also. That to me seems very un-intuitive. Putting my gripe aside, any idea how to achieve this simply issue?

 

Dimitar
Telerik team
 answered on 21 Dec 2017
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?