Telerik Forums
UI for WinForms Forum
9 answers
742 views
When on an add line, how can I set the focus to the first column? The column that gets the focus is wherever the user clicks on the line. I tried to set the focus in CurrentRowChanged event with this line:

 

    CType(e.CurrentRow, GridViewNewRowInfo).Cells("Acct_Code").CellElement.Focus()

 

 

but it has no effect. I looked into some of the other events, RowChanging and DefaultValuesNeeded, but CellElement is nothing at that point.
Hristo
Telerik team
 answered on 28 Dec 2017
1 answer
108 views
Hi,
I have a column with "FilterRow" filtering mode.
when I type some words in column filter area and wanna select a word, the Column will be dragged.
For Example:
I type "Ahmad Reza" in filtering TextBox and wanna change Ahmad To Ali
when I wanna select Ahmad, the Column will be dragged.
How do I Fix that?
Thanks.
Hristo
Telerik team
 answered on 27 Dec 2017
1 answer
58 views
I was looking at the asp.net ajax version of the control and on it it has daily but you can choose multiple days how do i right the same for the winforms version and why is it that we dont have a recurrence editor for winforms would make it easy for me to setup. How would i right this manually with the diailyrecurance rule
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Dec 2017
1 answer
1.2K+ views

Dear Team,

How do I set the image of button control to TelerikWebui Glyphs Icons or if possible a link to download the TeleriWebUI Icons.

I Try the below code and it works fine but is there a better way to set only the button image to the glyphs icon

 

sub new

     Dim font1 = ThemeResolutionService.GetCustomFont("TelerikWebUI")
      btnSave.ButtonElement.CustomFont = font1.Name
     btnSave.ButtonElement.Text = ChrW(&HE109).ToString() & " Save"

end sub

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Dec 2017
1 answer
88 views

Hello

I have a dynamically loaded textboxcontrol to which I attach an image from a file as background image.

At some point I need to remove the textboxcontrol from the RadPanel into which it has been added and I need to delete the image file used as background image

The File.delete(imagefilename) generates an error telling the it cannot delete the file because it is in use by another process.

I have tried to set the backgroundimage to nothing before the file delete but it does not help

Does anyone know how can I release the file ?

Thanks in advance

Pierre-Jean

Dimitar
Telerik team
 answered on 25 Dec 2017
5 answers
220 views

I need to be able to add a checkbox into the appointment on the scheduler its to allow staff to say that someone has arrived for the appointment. I am using c# and the 30 day demo thanks.

 

Hristo
Telerik team
 answered on 25 Dec 2017
1 answer
152 views

I am trying to bind resources to my appointments which has a field called ProviderId that provider id maps to a provider table, however the text is not showing 

01.private void BindScheduler()
02.       {
03.           try
04. 
05.           {
06.               SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource();
07.               AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo();
08.               BindingSource _bindingsource = new BindingSource();
09.               
10.               ResourceMappingInfo _resource = new ResourceMappingInfo();
11.               appointmentMappingInfo.Start = "ApptDate";
12.               appointmentMappingInfo.End = "AppEnd";
13.               appointmentMappingInfo.Duration = "ApptLength";
14. 
15.               appointmentMappingInfo.UniqueId = "ID";
16. 
17.               appointmentMappingInfo.Location = "Location";
18. 
19.               appointmentMappingInfo.Summary = "THIS IS A TEST FOR SUMMARY";
20.               appointmentMappingInfo.Description = "NAME";
21. 
22.               dataSource.EventProvider.Mapping = appointmentMappingInfo;
23.               dataSource.EventProvider.DataSource = _bindingsource;
24. 
25.               _bindingsource.DataSource = SourceDal.getAppointments(monthCalendar1.SelectionRange.Start);
26. 
27.               appointmentMappingInfo.ResourceId = "ProviderID";
28. 
29. 
30. 
31.               BindingList<CustomResource> resources = new BindingList<CustomResource>();
32.               ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo();
33.                resourceMappingInfo.Name = "Name";
34.               resourceMappingInfo.Id = "Id";
35.               resources = SourceDal.GetProviders();
36.               dataSource.ResourceProvider.Mapping = resourceMappingInfo;
37.               dataSource.ResourceProvider.DataSource = resources;
38. 
39. 
40.           
41.               this.sourceNetAppointments.GroupType = GroupType.Resource;
42.                
43. 
44. 
45. 
46.               this.sourceNetAppointments.ElementProvider = new MyElementProvider(this.sourceNetAppointments);
47. 
48.               this.sourceNetAppointments.DataSource = dataSource;
49. 
50. 
51.           }
52.           catch (Exception ex)
53.           {
54. 
55.           }
56. 
57.       }

 

Here you can see my get providers call.

01.public BindingList<CustomResource> GetProviders()
02.     {
03.         BindingList<CustomResource> resources = new BindingList<CustomResource>();
04. 
05.         try
06.         {
07.             var q = from lookup in _sourceEntities.Providers
08.                     orderby lookup.FirstName
09.                     select new
10.                     {
11.                         Code = lookup.ID,
12.                         Description = lookup.FirstName.Trim() +  "" + lookup.LastName.Trim()
13.                     };
14. 
15.             if (q != null)
16.             {
17.                 Array.ForEach(q.ToArray(), l =>
18.                 {
19.                     for (int i = 0; i < 5; i++)
20.                     {
21.                         CustomResource resource = new CustomResource();
22.                         resource.Id = i + 1;
23.                         resource.Name = "Resource " + l.Description;
24.                         resources.Add(resource);
25.                     }
26.                 });
27.             }
28.         }
29.         catch (Exception ex)
30.         {
31.             throw new EntityContextException("GetProviders failed.", ex);
32.         }
33. 
34.         return resources;
35.     }

 

 

Here is the data is ment to print out for the appointments with ProviderID =1 

But they are not showing can someone help

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

david
Top achievements
Rank 1
 answered on 24 Dec 2017
0 answers
147 views

I am trying to use resources in R2 2017 But it appears the resource mapping has changed and I no longer see the resource provider method if that is the case how then can I add the datasource of resoucrces to the calendar which will be a linq list. At present I was trying the below method but cannot access that method ?

 

SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource();
               AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo();
               BindingSource _bindingsource = new BindingSource();
               ResourceMappingInfo _resource = new ResourceMappingInfo();
               appointmentMappingInfo.Start = "ApptDate";
               appointmentMappingInfo.End = "AppEnd";
               appointmentMappingInfo.Duration = "ApptLength";
 
               appointmentMappingInfo.UniqueId = "ID";
 
               appointmentMappingInfo.Location = "Location";
 
               appointmentMappingInfo.Summary = "THIS IS A TEST FOR SUMMARY";
               appointmentMappingInfo.Description = "NAME";
 
               dataSource.EventProvider.Mapping = appointmentMappingInfo;
               dataSource.EventProvider.DataSource = _bindingsource;
 
               _bindingsource.DataSource = SourceDal.getAppointments(monthCalendar1.SelectionRange.Start);
 
               appointmentMappingInfo.ResourceId = "ProviderID";
 
 
 
 
 
 
 
               Resource resource = new Resource();
               resource.Id = new EventId(0);
               resource.Name = "Robert Shoemate";
               resource.Color = Color.Blue;
               resource.Visible = true;
               sourceNetAppointments.Resources.Add(resource);
               this.sourceNetAppointments.Resources
 
 
               this.sourceNetAppointments.ElementProvider = new MyElementProvider(this.sourceNetAppointments);
 
               this.sourceNetAppointments.DataSource = dataSource;

 

 

 

 

 

david
Top achievements
Rank 1
 asked on 24 Dec 2017
0 answers
128 views

While this does work to sort out start time and end time I need the slots to show 15 mins like the old app does 

Old App Screen shot Does anybody no how to get the ticks not only to display hours but also the 15 mins segments as shown. Must be able to do this.

 

private void CustomizeCurrentSchedulerView()
{
    this.sourceNetAppointments.FocusedDate = currentDate;
    SchedulerDayViewBase dayViewBase = null;
    if (this.sourceNetAppointments.ActiveViewType == SchedulerViewType.Day)
    {
        dayViewBase = this.sourceNetAppointments.GetDayView();
    }
    else if (this.sourceNetAppointments.ActiveViewType == SchedulerViewType.MultiDay)
    {
        dayViewBase = this.sourceNetAppointments.GetMultiDayView();
    }
    else if (this.sourceNetAppointments.ActiveViewType == SchedulerViewType.Week)
    {
        dayViewBase = this.sourceNetAppointments.GetWeekView();
    }
 
    if (dayViewBase != null)
    {
        dayViewBase.RulerFormatStrings.HoursFormatString = "HH";
        dayViewBase.RulerFormatStrings.MinutesFormatString = ":mm";
        dayViewBase.RulerStartScale = 7;
        dayViewBase.RulerEndScale = 20;
        dayViewBase.RulerWidth = 55;
        dayViewBase.RangeFactor = ScaleRange.QuarterHour;
    }
}
david
Top achievements
Rank 1
 asked on 24 Dec 2017
4 answers
212 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
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
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
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
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?