Telerik Forums
UI for WinForms Forum
1 answer
199 views

Hallo,

I have Winforms Application.

I created WPF-UserControl.

I'm trying to add this WPF-UserControl (per elementHost) to one of RadElement in my Winforms Form.

It could be RadPanelElement or my custom class extending RadElement.

Is it possible, and if it is possible how can i add, place WPF-UserControl on RadElement?

Or how can i prepare my custom radElement which will show WPF-UserControl?

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 06 Mar 2020
3 answers
89 views

Having a bizarre issue with RadGridView where it seems to randomly be selecting items in the grid when the underlying ObservableCollection is changed.  My desired behavior is the "CurrentItem" becoming null when the selected item is removed from the underlying collection, and obviously for the GridView not to select an item when added when the selection is blank.  My code is as follows:

radGridView1.AutoExpandGroups = true;
            var gd = new GroupDescriptor();
            gd.GroupNames.Add("RandomProp1", ListSortDirection.Ascending);
            radGridView1.GroupDescriptors.Add(gd);
            var sd1 = new SortDescriptor("RandomProp2", ListSortDirection.Descending);
            radGridView1.SortDescriptors.Add(sd1);
            var sd2 = new SortDescriptor("RandomProp3", ListSortDirection.Ascending);
            radGridView1.SortDescriptors.Add(sd2);
            radGridView1.MultiSelect = false;
            radGridView1.DataBindingComplete += RadGridView1_DataBindingComplete;
            radGridView1.DataSource = App.MasterList;

private void RadGridView1_DataBindingComplete(object sender, Telerik.WinControls.UI.GridViewBindingCompleteEventArgs e)
        {
            Log.WriteLine("RadGridView_DataBindingComplete");
            radGridView1.CurrentRow = null;
            radGridView1.CurrentRowChanged += RadGridView1_CurrentRowChanged;
        }

 

When the underlying collection is being changed, I'm doing the following:

BeginInvoke on the main thread

Locking the collection

Updating items as such:

DynamicCollection[i] = new CustomObject(fillerProperties);

 

Is the above possibly the issue?  I know this is the correct way to update ObservableCollections in WPF when bound to a GridView, not sure if WinForms behaves differently.

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 06 Mar 2020
2 answers
75 views

When using GridView in Hierarchy mode with a Template and binding to BindingList for Children:

 

public class Parent
{
    public Parent()
    {
        children = new BindingList<Child2>();
    }
 
    public int Id { get; set; }
 
    public string Prop1 { get; set; }
 
    public BindingList<Child2> children { get; set; }
}
 
 
public class Child2 : INotifyPropertyChanged
{
    public int Id { get; set; }
 
    public string Prop1 { get; set; }
 
    private int _Prop2;
    public int Prop2
    {
        get { return this._Prop2; }
        set
        {
            if (this._Prop2 != value)
            {
                this._Prop2 = value;
                if(PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("Prop2"));
            }
        }
    }
 
    public string Prop3 { get; set; }
 
    public event PropertyChangedEventHandler PropertyChanged;
}

 

If there is grouped columns in child template, changing properties is not reflected:

public partial class Form1 : Form
   {
 
       BindingList<Parent> data;
       public Form1()
       {
           InitializeComponent();
           InitGrid();
 
           data = new BindingList<Parent>();
 
           for (int i = 0; i < 3; i++)
           {
               Parent parent = new Parent() { Id = i, Prop1 = "testProp" + i };
               for (int j = 0; j < 4; j++)
               {
                   Child2 child = new Child2() { Id = i * j, Prop1 = "testProp" + i, Prop2 = j % 2, Prop3 = "another" };
                   parent.children.Add(child);
               }
 
               data.Add(parent);
           }
 
           this.radGridView1.DataSource = data;
           this.radGridView1.CellDoubleClick += radGridView1_CellDoubleClick;
 
       }
 
       void radGridView1_CellDoubleClick(object sender, GridViewCellEventArgs e)
       {
           Child2 child = e.Row.DataBoundItem as Child2;
           MessageBox.Show(child.Prop2.ToString());
       }
 
       private void InitGrid()
       {
           this.radGridView1.Columns.Add(CreateColumn("Id"));
           this.radGridView1.Columns.Add(CreateColumn("Prop1"));
 
 
           GridViewTemplate template = new GridViewTemplate();
           template.AllowAddNewRow = false;
           template.AllowDeleteRow = false;
           template.AllowEditRow = false;
           template.AutoGenerateColumns = false;
 
 
           template.Columns.Add(CreateColumn("Id"));
           template.Columns.Add(CreateColumn("Prop1"));
           template.Columns.Add(CreateColumn("Prop2"));
           template.Columns.Add(CreateColumn("Prop3"));
 
 
           GridViewRelation r = new GridViewRelation(this.radGridView1.MasterTemplate, template);
           r.ChildColumnNames.Add("children");
 
           template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
 
           template.EnableFiltering = false;
           template.EnableGrouping = true;
           template.ShowColumnHeaders = true;
           template.ShowRowHeaderColumn = false;
 
 
           this.radGridView1.EnableGrouping = false;
           this.radGridView1.EnableCustomGrouping = false;
 
 
           GroupDescriptor gd = new GroupDescriptor();
           gd.GroupNames.Add("Prop2", ListSortDirection.Ascending);
           gd.GroupNames.Add("Prop3", ListSortDirection.Ascending);
 
 
           template.GroupDescriptors.Add(gd);
 
 
           this.radGridView1.Templates.Add(template);
 
           this.radGridView1.Relations.Add(r);
           this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
       }
 
       GridViewTextBoxColumn CreateColumn(string Field)
       {
           GridViewTextBoxColumn col = new GridViewTextBoxColumn();
           col.Name = Field;
           col.FieldName = Field;
           col.HeaderText = Field;
           return col;
       }
 
       private void button1_Click(object sender, EventArgs e)
       {
           this.data.First().children.First().Prop2 = 1;
       }
   }

When I Click Button1 nothing happens

Is this a bug or am I doing something wrong?

 

 

 

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 06 Mar 2020
2 answers
134 views

Hello,

I have a list of items in a RadPageViewPage, in which I can select an item. A specific view for the selected item, depending on its type, is displayed in another RadPageViewPage. I then have to change the content of the panel in the second RadPageViewPage depending on the selected item, which is done simply with the following code:

           1 UserControl userControl = new UserControlRobotActionProcess();
           2 userControl.Parent = radPanel1;

I observed it took quite long to display the UserControl in the panel and measured the time of the line of code 2 above: 400ms. I then tested to display the same control, but with standard WinForms controls instead of the Telerik ones. The same line of code takes 1ms.

I think that the views I use could be optimized and could be loaded faster. I attach a screenshot of the view I have loading time issues with. Here is also the list of Telerik controls I use:

- RadSpinEditor

- RadPanel

- RadPageView

- RadPageViewPage

- RadLabel

- RadGroupBox

- RadButton

- RadRadioButton

- RadCheckBox

- RadTextBox

Do you know if I can improve the loading time of this UserControl?

 

Please feel free to tell me if you need more information.

 

Kind regards,

Antoine

Antoine
Top achievements
Rank 1
 answered on 06 Mar 2020
1 answer
434 views
     Hello, we have a program requirement where the user can select one or multiple rows and then choose to "highlight" those rows from a given set of colors.
This process can be repeated multiple times allowing the user to color code rows in different colors at a time.
The work flow ->
User selects rows
User then chooses the Highlight Rows menu option which is a drop down for different colors.
The rows background are then set to that color.

Rinse -> repeat as the user sees fit.

There is also a reset option that resets all the rows back to the default colors.

I did not see how to perform this specific type of background color assignment in either the Formatting Rows or Conditional Formatting Rows help sections.

If you could please help us understand how to perform this specific kind of row formatting, it would help us to be able to convert to the Telerik RadGridView from our previous 3rd party grid control.
Nadya | Tech Support Engineer
Telerik team
 answered on 05 Mar 2020
3 answers
178 views

Good Morning,

 

When generating a Crystal Theme Variation, there are several accent color palettes to choose from.

I accidentally overwrote the Blue one.   How can I restore the Blue Palette?

 

Thank you

 

Todor
Telerik team
 answered on 05 Mar 2020
6 answers
303 views
Hi,

Is it possible to databind a grid and exports it to excel from a ConsoleApplication project ?

I tried the LoadElementTree method, that doesn't work, I can't get my grid populated with data using the datasource member.
The only working method what the Grid.Rows.Add.

The other issue is that the  ExportVisualSettings can't be set to true or you'll get an exception.

Is there a clean way to get it to work ?

Thanks,
Deasun
Top achievements
Rank 3
Bronze
Bronze
Bronze
 answered on 05 Mar 2020
2 answers
87 views

If I have two pie charts next to each other how do I make their circumference the same size.

 

I have tried Chartview.View.Margin. Setting it to the same value does not make them the same size.

 

Nadya | Tech Support Engineer
Telerik team
 answered on 04 Mar 2020
3 answers
1.1K+ views

Hello

I have DateTimePicker with date in format dd-MM-yyyy. Initial date in this control is 01-02-2020. I want to write new date (31-01-2020) in MaskEdeditBox but after set day cursor correctly move to month section and day section changes walues to '01'. Could I define other behavior for this situations? For example when currently set month not has enough days month automatically decreases by 1.

 

Best wishes

Peter
Telerik team
 answered on 04 Mar 2020
2 answers
84 views

Hi,

I'm currently working with a chartview where the y-axis contains seconds. I',m trying to convert the seconds to minutes and/or hours, depending on rather the amount of seconds is more or equal one or more hour/s.

How can I achieve this behavior?

 

Thanks in advance!

Nicklas
Top achievements
Rank 1
Veteran
 answered on 03 Mar 2020
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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?