Telerik Forums
UI for WinForms Forum
5 answers
231 views
How do i select multiple items from code in a list box or combo box?
Veselin Vasilev
Telerik team
 answered on 19 Jan 2010
1 answer
191 views
I'm posting a source code solution to force the RadComboBox to act like a Windows Forms ComboBox when the DropDownStyle is DropDownList.  This is common functionality that has been missing for far too long.  This works with 2009 Q2 SP1.  The code I'm supplying is a wrapper class.

using System; 
using System.Collections.Generic; 
using System.Linq; 
using Telerik.WinControls; 
using Telerik.WinControls.UI; 
 
 
/// <summary> 
/// Wrapper class to make RadComboBox act like a WinForms ComboBox  
/// when DropDownStyle is DropDownList 
/// </summary> 
/// <!--Author: Michael Gerety--> 
public class WorkingDropDownList : RadComboBox 
    private char _lastChar; 
    private int _lastIndex; 
    private Dictionary<char, List<RadComboBoxItem>> _cache; 
 
    public override string ThemeClassName 
    { 
        get 
        { 
            return "Telerik.WinControls.UI.RadComboBox"
        } 
        set 
        { 
            base.ThemeClassName = value; 
        } 
    } 
 
    public WorkingDropDownList() 
    { 
        KeyPress += ComboBox_KeyPress; 
        _cache = new Dictionary<char, List<RadComboBoxItem>>(); 
        Items.ItemsChanged += new ItemChangedDelegate(Items_ItemsChanged); 
    } 
 
    void Items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation) 
    { 
        //If the items collection changes, we need to remove the cache for the character affected. 
        if(target.Text != null
        { 
            var changedChar = Char.Parse(target.Text.Substring(0, 1)); 
            if(_cache.ContainsKey(changedChar)) 
            { 
                _cache.Remove(changedChar); 
            } 
        } 
    } 
 
    void ComboBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) 
    { 
        if (DropDownStyle == RadDropDownStyle.DropDownList) 
        { 
            if (Char.IsLetter(e.KeyChar)) 
            { 
                if (Char.ToUpper(e.KeyChar) != _lastChar) 
                { 
                    _lastChar = Char.ToUpper(e.KeyChar); 
                    _lastIndex = 0; 
                    if (!_cache.ContainsKey(_lastChar)) 
                    { 
                        var list = (from i in Items 
                                    where (i as RadComboBoxItem).Text.ToUpper().StartsWith(_lastChar.ToString()) 
                                    select (RadComboBoxItem)i).ToList(); 
                        _cache.Add(_lastChar, list); 
                    } 
                } 
 
                if (_lastIndex >= _cache[_lastChar].Count) 
                { 
                    _lastIndex = 0; 
                } 
                if (_cache[_lastChar].Count > 0) 
                { 
 
                    SelectedItem = _cache[_lastChar][_lastIndex]; 
                } 
                _lastIndex++; 
            } 
 
        } 
    } 
 
 


Note: I'm using LINQ to build the cache lists so this requires .net 3.5.  This can be changed to work with .net 2.0 by replacing the LINQ query with a custom "Get entries starting with 'X'" type of function that iterates through the collection.


Note 2: Updated code to deal with list items changing.

I'm also assuming that you're using this code with a databound combo box where the bound items are not changing.  If they are subject to change, make sure that you

I hope this helps out anyone with the same issue.

Victor
Telerik team
 answered on 19 Jan 2010
1 answer
120 views
Hello,

Is there a way to remove time slots entirely from the day view.  I don't want to see the slots whether they are blank or filled.  For instance I don't want to display times from 8am - 12pm time on my day view whether there is an appointment or not.

Any help appreciated!
Thanks in advance.

Dobry Zranchev
Telerik team
 answered on 19 Jan 2010
1 answer
101 views
Hi,

Is it possbile to change the selected index on the datagrid view, I've tried to modify RadAlertsPanel.CurrentRow.ViewInfo.CurrentIndex But had no luck....

I'm new to this so any help would be appreciated.

Thanks Hayden
Jack
Telerik team
 answered on 19 Jan 2010
1 answer
281 views
Hi,
Can you explain the correct usage of the RadMultiColumnComboBox SelectedValue and Text properties.  It seems that they are not always in sync.  For example when the DataSource is set, the SelectedIndex == 0, SelectedValue == value of Item[0], but the Text property == "".

I'm trying to determine when I should (or could) use the Text property.  If I use it to "set" the Text property does the SelectedIndex/Item/Value also get set?

What event causes the Text property to be set?  Is it after an event is finished?

Thanks,
Mike
Deyan
Telerik team
 answered on 19 Jan 2010
1 answer
85 views
Hello,

I have RadScheduler working with WeekView and MonthView, but when I click on DayView nothing shows.  Any ideas?

Any help appreciated!
Thanks in advance.
Dobry Zranchev
Telerik team
 answered on 19 Jan 2010
2 answers
342 views
Hello,

I've used the Rad Scheduler for a while now the navigation popup calendar is not causing the date of the scheduler to change.  I believe this began shortly after changing to the 2009Q3 release.

Anything you can do to help is greatly appreciated.

Key Points:
1. Data Binding: The data is bound to the scheduler on the server side code where data is retrieved from the database and looped through to create a list<appointment> of appointment objects.
2. Navigation Arrows:  These were not working either, but after we made the setting of the startdate, enddate, and timezone offset be in an If(!IsPostback) block, the arrows now work (not the calendar)
3. The control has been placed on a page with no other controls and the problem persists

Below is the client code:

<pro:RadAjaxManager ID="RadAjaxManager1" EnableAJAX="true" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
    <AjaxSettings> 
        <pro:AjaxSetting AjaxControlID="CalendarRadScheduler"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="CalendarRadScheduler" LoadingPanelID="RadAjaxLoadingPanel1" /> 
            </UpdatedControls> 
        </pro:AjaxSetting> 
    </AjaxSettings> 
</pro:RadAjaxManager> 
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" /> 
 
        <pro:RadScheduler  
            ID="CalendarRadScheduler"  
            runat="server"  
            EnableAjaxSkinRendering="false" 
            Height="750px"  
            Width="578px"  
            ShowAllDayRow="False"  
            AllowDelete="False"  
            AllowEdit="False" 
            AllowInsert="False"  
            Skin="Office2007" 
            HoursPanelTimeFormat="h:mm tt"  
            MinutesPerRow="15"  
            ShowFullTime="True" 
            StartEditingInAdvancedForm="false" 
            DataKeyField="ID"  
            DataSubjectField="Subject"  
            DataStartField="Start"  
            DataEndField="End" 
            DataRecurrenceField="RecurrenceRule"  
            DataRecurrenceParentKeyField="RecurrenceParentID" 
            DayEndTime="18:30:00"  
            DayStartTime="08:00:00"  
            ShowFooter="false"  
            OnClientAppointmentInserting="AppointmentInserting" 
            OnClientAppointmentDoubleClick="AppointmentDoubleClick"  
            OnAppointmentCreated="CalendarRadScheduler_AppointmentCreated"  
            OnAppointmentDataBound="CalendarRadScheduler_AppointmentDataBound"  
            CustomAttributeNames="NetworkId"  
            OnAppointmentCommand="CalendarRadScheduler_AppointmentCommand"  
            OnFormCreating="CalendarRadScheduler_FormCreating"
             
             
            <AppointmentTemplate> 
                <div> 
                    <%# FormatCalendarMessage() %> 
                    <span style="text-align:right; vertical-align:top; width:100%;"
                     <asp:ImageButton Enabled="true" Visible="false" ID="ibtnEdit" runat="server" CommandName="EditMessage" 
                                ToolTip="Edit" AlternateText="Edit" CausesValidation="false" CssClass="linkButton" 
                                ImageUrl="~/images/edit.gif" OnClientClick="ChangeImg(this.id, 'loading');" /> 
                    &nbsp; 
                    <asp:ImageButton Enabled="true" Visible="false" ID="ibtnCopy" runat="server" CommandName="CopyMessage" 
                                ToolTip="Create Copy" AlternateText="Create Copy" CausesValidation="false" CssClass="linkButton" 
                                ImageUrl="~/images/copy.gif" OnClientClick="ChangeImg(this.id, 'loading');" /> 
                    </span> 
                </div> 
            </AppointmentTemplate> 
             
        </pro:RadScheduler> 

rjb227s
Top achievements
Rank 1
 answered on 18 Jan 2010
6 answers
282 views
hi,
i am opening google maps in a  browser control in radform. for this i need to to set com visibilty to true to communicate with javascript in locally hosted web page.
my code :

using System.Runtime.InteropServices;
using System.Security.Permissions;

    // Make COM Visible to communication with other App
    [ComVisibleAttribute(true)]
    // Set Security Level to Full Trust inorder to enable external Javascript function invokes and data passing
    [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]

works perfect in simple .net forms
but gives error in rad form....
error:
A QueryInterface call was made requesting the default IDispatch interface of COM visible managed class 'TcpMappingServer.LivePlayAVL'. However since this class does not have an explicit default interface and derives from non COM visible class 'Telerik.WinControls.UI.RadForm', the QueryInterface call will fail. This is done to prevent the non COM visible base class from being constrained by the COM versioning rules.


Anysolution Please, ineed it quickly, if radform wont work will the shaped form work...
or any other solution with radform.
thanks in advance!!!

Deyan
Telerik team
 answered on 18 Jan 2010
1 answer
136 views
Hi telerik ,
                Can you please tell me that on latest  release WIN Form Control 3d Graph have supported or not,

Thanks,
Khalid
Dwight
Telerik team
 answered on 18 Jan 2010
3 answers
296 views
I'm using the RadItem Collection editor to add items to my combobox.  I see a place to enter the display text but where can I enter a value that I can use within c#?  I'm trying to use my combobox's SelectedValue property but it comes back as null.  Why would selectedtext come back as "" when it has been selected?

Thank You
Victor
Telerik team
 answered on 18 Jan 2010
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?