Telerik Forums
UI for WinForms Forum
0 answers
148 views

Hey guys, I've inherited RadDateTimePicker to do a better handling of null value with databinding and the problem is when it got focused by Tab key it borders don't change as it should be. Ive tried setting focus to DateTimePickerElement when my picker got focus, but it didn't solve as well. 

 

 public partial class NossoRadDateTimePicker : RadDateTimePicker
    {
        public NossoRadDateTimePicker()
        {
            InitializeComponent();
            TabStop = true;
            this.ValueChanged += NossoRadDateTimePicker_ValueChanged;
            this.GotFocus += NossoRadDateTimePicker_GotFocus;
        }

        private void NossoRadDateTimePicker_GotFocus(object sender, EventArgs e)
        {
            base.DateTimePickerElement.Focus();
        }

        private void NossoRadDateTimePicker_ValueChanged(object sender, EventArgs e)
        {
            if (ShowCheckBox && checking == false)
                this.Checked = true;

        }

        [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public new DateTime? NullableValue
        {
            get
            {
                throw new Exception("Use Value");
            }
            set
            {
                throw new Exception("Use Value");
            }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        /// <summary>
        /// Poderá retornar null caso use o checkbox e ele não esteja checkado
        /// </summary>
        public new DateTime? Value
        {
            get
            {
                DateTime? valor = base.Value;

                if (ShowCheckBox && Checked == false)
                    valor = null;

                return valor;
            }
            set
            {
                //garantir que essa bosta n sete valor fora do range de datas
                if (value != null)
                {
                    value = value > MaxDate ? MaxDate : value;
                    value = value < MinDate ? MinDate : value;
                    Checked = true;
                }
                else if (ShowCheckBox)
                    Checked = false;

                checking = true;
                base.Value = value ?? DateTime.Now;
                checking = false;

            }
        }

        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyData == Keys.Space)
            {
                this.Checked = !this.Checked;
            }
            else
            {
                base.OnKeyDown(e);

            }
        }

        bool checking;
    }

Leandro
Top achievements
Rank 1
 asked on 05 Sep 2018
2 answers
502 views

Hello!

I need to deselect only one cell once selected.
I have tried the following code in the SelectionChanged and SelectionChanging events. But it does not work.

Any suggestions?

RadGridView1.CurrentCell.IsSelected  = false

 

 

Thanks.

 

 

 

Esteban
Top achievements
Rank 1
Iron
Iron
 answered on 05 Sep 2018
14 answers
1.5K+ views
I have a docked RADSplitContainer with 3 panels, 2 horizontal splitters. I only want the middle panel to resize when the form is resized the top & bottom are can not be resized. Will an absolute size take care of that, or do I need to do something else (and what would that be?)?

Thanks

:)
jr
Hristo
Telerik team
 answered on 05 Sep 2018
3 answers
118 views

I am trying to set the color of the bar , when a value goes below a certain amount. I have tried the below, but none of them change the color of the bar from Green to red. :

      barBat.BackColor = Color.Yellow
                        barBat.GaugeElement.BackColor = Color.Yellow
                        barBat.GaugeElement.BackColor2 = Color.Yellow
                        barBat.GaugeElement.BackColor3 = Color.Yellow
                        barBat.GaugeElement.BackColor4 = Color.Yellow

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Sep 2018
15 answers
1.2K+ views
Hi,

Is it possible to get the selected text value of a GridViewComboBoxColumn for a set cell in a row?

thanks

David
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Sep 2018
1 answer
383 views
There's a way to remove the border around the tree view control?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Sep 2018
2 answers
214 views

Hi, 

I'm struggling for something that perhaps is very easy...

I have assigned a DataTable as Datasource for my GridView.

The data is correcly shown and the boolean values are mapped on checkboxes.

I save back the values to the database getting the new values from the DataTable.

However sometimes the user open the form, click on checkboxed value, and then click on the Save button.

It seems that if you don't deselect the modified Row, the new value of the checkbox is not stored into the DataTable, so I save the old value, while in the GridView you see the new value.

Is there a way to force the sync right after the click on the checkbox?

I've tried with something like this, but without success.

private void RadGridView1OnCellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
            e.ActiveEditor.EndEdit();
            e.ActiveEditor.Validate();
}
Dimitar
Telerik team
 answered on 03 Sep 2018
2 answers
168 views

 Hi there, I've searched internet for info for a long time but I couldn't get much answers, this why I'm asking here.

I have a simple UserControl with 2 radtextbox inside, one with dock left and other with dock fill.

What I wanna do is the same u do with Textbox height. Example: if u change the Textbox Font or ThemeName it's height will be resized.

This is exactly what I want to do, change my UserControl height to be exactly the same TextBox height when I change Font or ThemeName.

I've already tried:  

-> override void SetBoundsCore();

-> inherit ControlDesigner to override SelectionRules.

-> overriding Size property do half work, because the UC keeps reseting location to 0,0 when used, every build 

And, of course I'm setting those TextBox Font and Theme when change it on UserControl.

And it should work the same way on the designer.

Sorry for bad english. And hope u could understand what I'm trying to achieve.

 

Hristo
Telerik team
 answered on 03 Sep 2018
0 answers
118 views

Good morning.
I have a DataGrid with cells whose wallpaper is red, green or orange.
I must allow the selection of certain cells that have the same color background.
I am testing with the "SelectionChanging" and "SelectionChanged" events, as well as with "ViewCellFormatting", but I can not avoid selecting any cell.
Any suggestions?

Thanks!

Esteban
Top achievements
Rank 1
Iron
Iron
 asked on 31 Aug 2018
3 answers
182 views

Add a button in RichTextEditor demo project, and this code in its event handler:

var editor = new RadDocumentEditor(radRichTextEditor1.Document);
var startA = new DocumentPosition(editor.Document);
var endA = new DocumentPosition(editor.Document);
 
Span a = new Span("A");
editor.InsertInline(a);
 
startA.MoveToStartOfDocumentElement(a);
endA.MoveToEndOfDocumentElement(a);
 
System.Diagnostics.Debug.Assert(startA != endA);

 

Why this last line asserts? I would like to set a DocumentPosition to the end of newly added "A" text (or just select it), but don't know how.

Tanya
Telerik team
 answered on 31 Aug 2018
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
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
CollapsiblePanel
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
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?