Telerik Forums
UI for WinForms Forum
3 answers
739 views

Hi,

I am trying to set the backcolor of the DateTimePicker and TimePicker when disabled. I am already overriding the OnEnabledChanged event to replace the TextBoxElement with our custom text box so I can update the forecolor and this is all working OK and the backcolor of the textbox is correct, however the control border, dropdown arrow, etc. are still using the old color and I am unable to work out what properties I need to update to access these items.

How do i update the backcolor of all of the visible items for the entire DateTimePicker and for a TimePicker?

 

Thanks,

 

Mark.

Dimitar
Telerik team
 answered on 25 Apr 2016
5 answers
163 views

Hi, i'm using the latest Telerik release.

Only on some machines I got this error:

An exception was uncaught System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
   at Telerik.WinControls.UI.RadTreeViewElement.SynchronizeNodeElements()
   at Telerik.WinControls.UI.RadTreeViewElement.Update(UpdateActions updateAction)
   at Telerik.WinControls.UI.RadTreeView.OnGotFocus(EventArgs e)
   at System.Windows.Forms.Control.WmSetFocus(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at Telerik.WinControls.UI.RadTreeView.WndProc(Message& m)

Here's my Code, where am I doing something wrong?

//user control Load event

this.Load += new System.EventHandler(this.TreeView_Load);

private void TreeView_Load(object sender, EventArgs e)
{
radTreeView1.BeginEdit();
PatientEpicrisis epicrisis = MyAdapter.ReadPatientEpicrisis();
var currentNode = this.radTreeView1.Nodes["EpicrisiNode"];
currentNode.Nodes.Clear();
if (!string.IsNullOrEmpty(epicrisis.Note))
{
currentNode.Nodes.Add(epicrisis.EpicrisisSynthesis);
var lastNode = currentNode.LastNode;
lastNode.Tag = epicrisis;
lastNode.EndEdit();
}
else
{
currentNode.ContextMenu = radContextMenuEpicrisis;
}
currentNode.EndEdit();
radTreeView1.EndEdit();
}
Dimitar
Telerik team
 answered on 25 Apr 2016
1 answer
142 views
Hi I have a problem with a custom cell of a gridview, I'm using a PopupEditor I associate one popupcontainer controls but this when launching the event EditorRequired out empty someone could help me I would appreciate it very much add the code of the custom editor class

Public Class PopUpEditor
    Inherits BaseGridEditor

    Public Overrides Property Value () As Object
      Get
        As editor Dim Telerik.WinControls.UI.RadPopupEditorElement = CType (Me.EditorElement, Telerik.WinControls.UI.RadPopupEditorElement)
        Return editor.Value
      End Get
      Set (ByVal value As Object)
        As editor Dim Telerik.WinControls.UI.RadPopupEditorElement = CType (Me.EditorElement, Telerik.WinControls.UI.RadPopupEditorElement)
        If value AndAlso value isnot isnot Nothing Then DBNull.Value
          If Not IsNumeric (editor.Value) Then
            editor.Value = Convert.ToInt32 (value)
          End If
        else
          editor.Value = 0
        End If
      End Set
    End Property

    Public Overrides Sub BeginEdit ()
      MyBase.BeginEdit ()
      Me.EditorElement.Focus ()
      'AddHandler (CType (EditorElement, TrackBarEditorElement)). TrackPositionChanged, AddressOf TrackBarEditor_TrackPositionChanged
    End Sub

    Public Overrides Function EndEdit () As Boolean
      'RemoveHandler (CType (EditorElement, TrackBarEditorElement)). TrackPositionChanged, AddressOf TrackBarEditor_TrackPositionChanged
      Return MyBase.EndEdit ()
    End Function

    'Private Sub TrackBarEditor_TrackPositionChanged (ByVal sender As Object, ByVal e As EventArgs)
    'OnValueChanged ()
    'End Sub

    Protected Overrides Function CreateEditorElement () As Telerik.WinControls.RadElement
      CPOP Dim As New Telerik.WinControls.UI.RadPopupEditor
      Dim text As New Telerik.WinControls.UI.RadTextBoxControl
      Dim container As New Telerik.WinControls.UI.RadPopupContainer
      contenedor.PanelContainer.Controls.Add (text)
      texto.Dock = DockStyle.Fill
      texto.Text = "Hello"
      cpop.Name = "EditorPopUp"
      cpop.AssociatedControl = container
      Return cpop.PopupEditorElement 'Telerik.WinControls.UI.RadPopupEditorElement
    End Function
  End Class
Daniel
Top achievements
Rank 1
 answered on 23 Apr 2016
5 answers
220 views

Hello,

I use a hierarchical grid in my application.

I like to use an Excel like filter for the child rows, but the grid is filled with data by data binding or load on demand so the automatic filter selections are not provided by the grid. (See attached file). Now I like to manually add some filter checkboxes under the "All" checkbox, but I can't figure out how to achieve that.

I know this has to be done in the FilterPopupRequired event......

 

Thanks for Your help!

Regards

Ingo

Hristo
Telerik team
 answered on 20 Apr 2016
1 answer
228 views

My radGridView numerical columns have thousand separator so I have to put a ',' when I search the grid cells using search row. How can I setup the grid so its search cell has thousand separator when I am looking for numerical values?

My numerical columns values are 5 decimal point:

123.12345

123.1234

123.123

123.12

123.1

123

0.123

and so fourth...

Hristo
Telerik team
 answered on 20 Apr 2016
11 answers
429 views

Hi,

I recently read that self-referencing hierarchy is now supported by the radGridView.  Unfortunately, I have been unable to locate any demos, tutorials, or sample code to look at.  Is this information available?

Here is my current code that I'm working with:

private void SetupElementsGrid()  
{  
    radGvElements.Columns.Clear();  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ElementID"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ProtocolTemplateID"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ParentElementID"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ElementNumber"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ElementDesc"));  
 
    radGvElements.Columns["ElementID"].IsVisible = false;  
    radGvElements.Columns["ProtocolTemplateID"].IsVisible = false;  
    radGvElements.Columns["ParentElementID"].IsVisible = false;  
 
    radGvElements.Columns["ElementNumber"].HeaderText = "Element Number";  
    radGvElements.Columns["ElementDesc"].HeaderText = "Element Description";  
 
    radGvElements.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;  
 
    GridViewTemplate childTemplate = new GridViewTemplate();     
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ElementID"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ProtocolTemplateID"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ParentElementID"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ElementNumber"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ElementDesc"));  
 
    //childTemplate.Columns["ElementID"].IsVisible = false;  
    //childTemplate.Columns["ProtocolTemplateID"].IsVisible = false;  
    //childTemplate.Columns["ParentElementID"].IsVisible = false;  
 
    //childTemplate.Columns["ElementNumber"].HeaderText = "Element Number";  
    //childTemplate.Columns["ElementDesc"].HeaderText = "Element Description";  
 
    childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;  
      
    if(radGvElements.MasterGridViewTemplate.ChildGridViewTemplates.Count == 0)  
    {                     
        radGvElements.MasterGridViewTemplate.ChildGridViewTemplates.Add(childTemplate);  
    }  
      
    GridViewRelation relation = new GridViewRelation(radGvElements.MasterGridViewTemplate);  
    relation.ChildTemplate = childTemplate;  
    relation.RelationName = "ParentChild";  
    relation.ParentColumnNames.Add("ElementID");  
    relation.ChildColumnNames.Add("ParentElementID");  
    radGvElements.Relations.Add(relation);  
 
    ProtocolTemplate = (ProtocolTemplate)ProtocolTemplatesBindingSource.CurrencyManager.List[ProtocolTemplatesBindingSource.CurrencyManager.Position];  
    ElementsBindingSource.DataSource = ProtocolTemplate.Elements;  
    radGvElements.DataSource = ElementsBindingSource;  
                  
    radGvElements.DataSource = ElementsBindingSource;  
    childTemplate.DataSource = ElementsBindingSource;  

Sample data would look like this:

ElementID -- ProtocolTemplateID -- ParentElementID -- ElementNumber -- ElementDesc
1 -- 1 -- 1 -- 1.0 -- ParentLevel1
2 -- 1 -- 1 -- 1.1 -- ChildLevel1
3 -- 1 -- 1 -- 1.2 -- ChildLevel2
4 -- 1 -- 4 -- 2.0 -- ParentLevel2

With my current code, this displays as:

Row 1
-- Row1
-- Row2
-- Row3
Row 2
Row 3
Row 4
-- Row 4

It should be:

Row 1
-- Row 2
-- Row 3
Row 4

Also, another problem is with the portion of code I have commented out.  This code causes a NullReferenceException error to be thrown and I don't know why.

 

If anyone could help me out with the above code, or even point me in the direction of some reading material, I would be very grateful.

Thanks,

Robert

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 Apr 2016
1 answer
132 views
I am facing issue with RadDateTimePicker.Is it possible to enter only two digit in the year part like if i enter 16 than it will be consider as 2016 not to enter 2016? If i enter 16 than it will consider as 2016 and if i enter 2016 than it will consider same 2016. please check below code i used for RadDateTimePicker

Public Sub New()
        Me.New()
        Me.CustomFormat = "MM/dd/yyyy"
        AddHandler Me.LostFocus, AddressOf radDateTimePicker1_LostFocus
        Me.Font = New System.Drawing.Font("Tahoma", 8.25!)
        Me.Format = System.Windows.Forms.DateTimePickerFormat.Custom
        Me.NullText = "  /   /"
        Me.Size = New System.Drawing.Size(80, 19)
        Me.Value = New Date(CType(0, Long))
        CType(Me.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar).Calendar.FirstDayOfWeek = FirstDayOfWeek.Monday
        CType(Me.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider).AutoSelectNextPart = True
    End Sub

Private Sub radDateTimePicker1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs)
        Try
            If (Me.Value = "#12:00:00 AM#" Or Date.MinValue = Me.Value.ToShortDateString() Or Me.Value.Year <= 1900) Then
                Me.NullableValue = Date.MinValue
                Me.NullText = "  /  /"
            End If
        Catch ex As Exception
        End Try
    End Sub
 
Hristo
Telerik team
 answered on 20 Apr 2016
3 answers
182 views

I am using a scatter chart now, and trying to allow the user to select multiple points to turn them on or off. Using the selection mode of "MultipleDataPoints" doesn't seem to work for scatter charts the way the "documentation" implies for the pie charts. When I get the "SelectedPointChanged" event, either I don't understand the purpose of the "NewSelectedPoint" and "OldSelectedPoint", or they aren't working. Basically if I have 5 points 1,2,3,4, and 5, if I click on point 2 and then 3 it gives me new point 3 and old point 2. I would expect not to get an old point called out until I "deselect" a point. Otherwise I don't see how to accomplish what the example shows, with two points offset from the center when the multiple points is selected. Rather than banging my head against the wall on this, I used the custom renderer and hit test method on mouse down method that you showed me to fix the multiple pie selection issue, so I have it been able to accomplish what I need but I would still like to know what I am supposed to do in that situation, or if multiple data point selection is just not supported for scatter charts.

 

My more pressing issue is that I am now trying to use the lasso selection. However I don't want to zoom. I would like to override the behavior to get the lasso but then do my own action on the lasso'd points (the selection I am doing above, actually). I tried inheriting the class but all of the obvious calls that I could override had no effect.

 

Alternatively, or perhaps in addition to, I would like to know how to determine what points are in the zoomed area once lasso'd. For double bonus, I would like to be able to lasso a circle with the radius emanating from the moused down point (the radius at the mouse up point).

Hristo
Telerik team
 answered on 20 Apr 2016
2 answers
265 views

Hi,

 

I have a dataGrid with a threestate Checkbox-Column. Off = 0, On = 1, Indeterminate = 2.

State Off and On ok, but Indeterminate only the last is show correctly.

After fill the dataGrid On and Indeterminate always the same. I don't know what is wrong.

 

Database Columns are:

Code varchar(10)
Description varchar(50)
Sort tinyint  (0=off,1=on,2=indeterminate)

 

Fill datagrid:

private bool LoadStreets()
        {
            bool bOk = true;
            try
            {
                context.Street.Load();
                bindingSourceStreet.DataSource = context.Strassen.Local.ToBindingList();
            }
            catch (DbEntityValidationException ex)
            {
                bOk = false;
            }

            return bOk;
        }

Please can you tell me what is wrong?

Thank you

Andreas

Andreas
Top achievements
Rank 1
 answered on 20 Apr 2016
3 answers
211 views

it is super weird. I spend over 4 hours 

my project has very simple data table :

date,quantitysold,AverageQuantity,  in datatime, int, int

date will be X

quantitysold, averageQuantity, will be Y1 and Y2

first, user will get the product ID table into gridview and when choosing the product to show the chart,

the radchartview should popup/update the chart based on the product PID

I could make it work when I click the first product ID, erverything is ok, but more I click the datagrid to view the product sales data , the chartview becomes more smaller, please refer to the screenshots

everytime I click the data, I first make series.clear(), and tested area clear(), chart refresh, update.

 

 

   private void radGridView_197_data_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            this.radChartView_197_chart.Series.Clear();
            this.radChartView_197_chart.Area.Series.Clear();
            this.radChartView_197_chart.Refresh();
            this.SetChartViewData();
         //   if (gridview_197_firstClick)
            this.SetupChartView();

....more other code here ,

....

 

               CartesianArea area = this.radChartView_197_chart.GetArea<CartesianArea>();
                area.ShowGrid = true;
                CartesianGrid grid = area.GetGrid<CartesianGrid>();
                grid.DrawHorizontalStripes = true;

 

 

...............more code here to update the table which is every time different because product id changed.

 this.radChartView_197_chart.DataSource = table;
         
            this.radChartView_197_chart.Update();
            this.radChartView_197_chart.Refresh();

 

 

 

}
          

there is no zoom related setup , I tried almost everything, but there is very limited source online to bind the new data source.

 

please let me know how to do this.

 

 

 

 

 

 

 

Richard
Top achievements
Rank 1
 answered on 20 Apr 2016
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?