Telerik Forums
UI for WinForms Forum
6 answers
718 views
My application has a RadDateTimePicker at the top of most forms; often the forms require some scrolling.  When a user enters the form, the RadDateTimePicker gets focus, and then when he tries to scroll down the form, he instead will inadvertently scroll the date, then (when the month reaches 12, its highest value) the form will scroll.  The user often will not know that he accidently changed a value.

My users never want to scroll the date (they are always surprised when I point out to them that it does scroll), so I want to turn off that functionality.  My first thought was to get the event handler and set Handled to true ... but there is no such property on that event handler.  Then, even though I knew better, I tried to go down the road of removing the existing handlers ... but even Reflection balks at that.

So, is there a way for me to disable the MouseWheel event in the RadDateTimePicker?  Or do you have alternate suggestions?

Thanks!
Hristo
Telerik team
 answered on 04 Dec 2015
1 answer
382 views

Hi,

I'm formatting my RadGridView and changing its color based a cell value. It's working fine but if I scroll up or down It becomes to change all rows color.

Is it a bug, or I'm doing something wrong?

Here is my code:

 

Thank you.

Private Sub grid_RowFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.RowFormattingEventArgs)
    e.RowElement.RowInfo.MinHeight = 24
    If e.RowElement.RowInfo.Cells("Recusa").Value = "S" Then
      e.RowElement.ForeColor = Color.DarkRed
      e.RowElement.BackColor = Color.Coral
    End If
  End Sub

Ralitsa
Telerik team
 answered on 04 Dec 2015
7 answers
2.0K+ views
I have a gridview with one text column and five decimal columns. These decimal columns are editable. So inorder to edit this, the user can directly enter values or use the up and down buttons to increase or decrease values. My requirement is to restrict user from setting negative values by pressing the down button of the decimal column. How to achieve this?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 04 Dec 2015
1 answer
645 views

I have set the button's top border color to be red and bottom border color to be yellow by the below codes but the appearance never show the border colors when running.

            this.ButtonElement.BorderElement.BoxStyle = BorderBoxStyle.FourBorders;
            this.ButtonElement.BorderElement.TopColor = Color.Red;
            this.ButtonElement.BorderElement.TopWidth = 2;
            this.ButtonElement.BorderElement.BottomColor = Color.Yellow;
            this.ButtonElement.BorderElement.BottomWidth = 2;

Please help me to solve this problem.

Ralitsa
Telerik team
 answered on 03 Dec 2015
1 answer
174 views

Hi,

I am trying to add a tooltip to a RadDropDownListElement embedded in a Ribbonbar.

One may add tooltip text directly, to the ListElement or to the Textbox, but no one results in a tooltip being displayed.

I do not wish to add tooltip to individual items in the dropdownlist, but just one tooltip to the entire control.

Any advice?

/Brian

 

  

 

Hristo
Telerik team
 answered on 03 Dec 2015
1 answer
117 views

I am trying to create a GridViewCheckedDropDownListColumn. I have some of it working.

It is creating the column and the drop-down is displaying as it should. However, the main cell does not show the checked items after the drop-down is no longer displayed. Nor does it remember which items had previously been checked when the drop-down is displayed a second time.

 

I wasn't able to attach my project, so here is the important code:

public class Foo
{
    public int Id { get; set; }
 
    public string Value { get; set; }
 
    public bool IsSelected { get; set; }
}
public class Boo : Foo
{
    public List<Foo> Foos { get; set; }
 
    public Boo()
    {
        this.Foos = new List<Foo>();
    }
}

 

public class RadCheckedDropDownListEditorElement : RadCheckedDropDownListElement
{
    ...
}

public class RadCheckedDropDownListEditor : BaseGridEditor
{
    public string ValueMember { get; set; }
 
    public string DisplayMember { get; set; }
 
    public string CheckedMember { get; set; }
 
    public override object Value
    {
        get
        {
            var listEditorElement = (RadCheckedDropDownListElement) this.EditorElement;
            return listEditorElement.DataSource;
        }
        set
        {
            var listEditorElement = (RadCheckedDropDownListElement) this.EditorElement;
            listEditorElement.ValueMember = this.ValueMember;
            listEditorElement.DisplayMember = this.DisplayMember;
            listEditorElement.CheckedMember = this.CheckedMember;
            listEditorElement.DataSource = value;
        }
    }
     
    [AttributeProvider(typeof(IListSource))]
    [RadDescription("DataSource", typeof(RadListElement))]
    [Category("Data")]
    [RadDefaultValue("DataSource", typeof(RadListElement))]
    public object DataSource
    {
        get
        {
            var listEditorElement = (RadCheckedDropDownListElement)this.EditorElement;
            return listEditorElement.DataSource;
        }
        set
        {
            var listEditorElement = (RadCheckedDropDownListElement)this.EditorElement;
            listEditorElement.DataSource = value;
        }
    }
     
    protected override RadElement CreateEditorElement()
    {
        return new RadCheckedDropDownListEditorElement();
    }
}
public class GridViewCheckedDropDownListColumn : GridViewComboBoxColumn
{
    private RadCheckedDropDownListEditor _editor;
    private string _checkedMember;
 
    [Browsable(true)]
    [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
    [Category("Data")]
    [DefaultValue(null)]
    [Description("Gets or sets a string that specifies the property or database column from which to get values that correspond to the items in the RadDropDownListEditor.")]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
    public string CheckedMember
    {
        get
        {
            return this._checkedMember;
        }
        set
        {
            if (this._checkedMember == value) return;
            this._checkedMember = value;
            this.DispatchEvent(KnownEvents.ColumnDataSourceInitializing, GridEventType.UI, GridEventDispatchMode.Send, (object)null, (object[])null);
        }
    }
     
    public GridViewCheckedDropDownListColumn()
    {
    }
 
    public GridViewCheckedDropDownListColumn(string fieldName) : base(fieldName)
    {
    }
 
    public GridViewCheckedDropDownListColumn(string uniqueName, string fieldName) : base(uniqueName, fieldName)
    {
    }
 
    public override Type GetDefaultEditorType()
    {
        return typeof(RadCheckedDropDownListEditor);
    }
 
    public override IInputEditor GetDefaultEditor()
    {
        return new RadCheckedDropDownListEditor();
    }
 
    public override void InitializeEditor(IInputEditor editor)
    {
        var dropDownListEditor = (RadCheckedDropDownListEditor) editor;
 
        if (dropDownListEditor == null) return;
 
        dropDownListEditor.ValueMember = this.ValueMember;
        dropDownListEditor.DisplayMember = this.DisplayMember;
        dropDownListEditor.CheckedMember = this.CheckedMember;
        dropDownListEditor.DataSource = this.DataSource;
    }
 
    public virtual void RadGridView_EditorRequired(object sender, EditorRequiredEventArgs e)
    {
        if (e.EditorType == typeof(RadCheckedDropDownListEditor))
        {
            e.Editor = this._editor ?? (this._editor = new RadCheckedDropDownListEditor());
        }
    }
}

 

public partial class Form1 : Form
{
    private List<Boo> _boos;
 
    public Form1()
    {
        this.InitializeComponent();
        this.InitializeList();
        this.InitializeColumns();
        this.radGridView.DataSource = this._boos;
    }
 
    private void InitializeList()
    {
        this._boos = new List<Boo>();
 
        for (int i = 0; i < 10; i++)
        {
            Boo b = new Boo
            {
                Id = i,
                Value = $"Boo-{i}"
            };
 
            for (int j = 0; j < 10; j++)
            {
                Foo f = new Foo
                {
                    Id = j,
                    Value = $"Foo-{i}.{j}"
                };
                b.Foos.Add(f);
            }
 
            this._boos.Add(b);
        }
    }
 
    private void InitializeColumns()
    {
        var c1 = new GridViewTextBoxColumn(nameof(Boo.Id));
        var c2 = new GridViewTextBoxColumn(nameof(Boo.Value));
        var c3 = new GridViewCheckedDropDownListColumn(nameof(Boo.Foos))
        {
            ValueMember = nameof(Foo.Id),
            DisplayMember = nameof(Foo.Value),
            CheckedMember = nameof(Foo.IsSelected),
            Width = 500
        };
 
        this.radGridView.Columns.Add(c1);
        this.radGridView.Columns.Add(c2);
        this.radGridView.Columns.Add(c3);
 
        this.radGridView.EditorRequired += c3.RadGridView_EditorRequired;
    }
}

Hristo
Telerik team
 answered on 03 Dec 2015
7 answers
1.5K+ views
Hi,

I am using a RadTreeView to display a set of nodes where the text is very long. Is it possible to specify a max width for the treeview node and have the text wrap within the available space extending down (or clipping beyond the horizontal size). 

(I have read some other posts on this but there is nothing in there for this year)

Regards
James   
Stefan
Telerik team
 answered on 02 Dec 2015
1 answer
167 views
Hi,

I need to do some action when the user clicks with the right button on the radgridview, but ignoring header clicks.

How can I identify header clicks?

 

PS: I'm using MouseClick event.

Thank you.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Dec 2015
2 answers
143 views

Hi guys,

I don't understand how can I obtain rows of particular page (current page also), then get single cell and update it.

I would click to next page for example, view rows of this page and update specific column of these rows.

 

How can I do it?

Dario
Top achievements
Rank 2
 answered on 02 Dec 2015
1 answer
120 views
I want to change the font of Custom Filter Dialog (CustomFilterDialogCaption, CustomFilterDialogLabel,....) in radgridview.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Dec 2015
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
AI Coding Assistant
+? 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?