Telerik Forums
UI for WinForms Forum
1 answer
252 views
I can hide a layout item using HideItem() method but then how do I make it visible again?
Dimitar
Telerik team
 answered on 09 May 2018
4 answers
2.7K+ views

I think I read how to do this but searching 'FormClosing' in this forum didn't find anything much.

I simply need to cancel the closing of a form (after user dialog confirmation). Is this the correct approach?

private void OnFormClosing(object sender, FormClosingEventArgs e)
{
    var dlg = new DlgConfirmUnsavedForm();
    var result = dlg.ShowDialog();
    if (result == DialogResult.Cancel)
    {
        e.Cancel = true;
        OnClosing(e);
        return; //??
    }
    else if (result == DialogResult.Yes)
    {
        SaveForm();
    }
     
    ...
}

 

By the way, post editing is terrible!

Dimitar
Telerik team
 answered on 09 May 2018
3 answers
127 views

Hi,

I've a problem (again) when the MCCB is used in an Excel addin environment.

If the MCCB is used on a normal form (non modal) and you scroll (mouse wheel) inside the dropdown (grid) then the complete addin hangs.

If you do the same in an modal form, everything works fine.

Sample project is attached (rename to zip)

Steps to reproduce:

    button2 -> opens modal form (OK)
    button1 -> opens non modal form (not OK)
    open dropdown and then scroll inside grid with mouse wheel

Is there any workaround? (even if I have to disable mouse scrolling, would be better than an hanging application)

 

 

 

 

 

 

 

 

 

 

Dimitar
Telerik team
 answered on 08 May 2018
5 answers
136 views
Isn't there any way to add an extra button to the caption form like the help button without making the form border style (None)
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 08 May 2018
3 answers
94 views

I'm using two RadTreeView to Drag and Drop Nodes from Right to Left. When "Node 1" is Drag from Right and Drop to Left RadTreeView a Dialog is shown.
If I Drag and Drop other Node before "Node 1" the Dialog stuck and I cannot write on the TexBoxes.

How can I solve this issue?

Main Form 

https://i.stack.imgur.com/Qf1QM.png

public partial class Main : RadForm
{
    public Main()
    {
        InitializeComponent();
    }
 
    private void RightRadTreeView_DragEnded(object sender, RadTreeViewDragEventArgs e)
    {
        if (e.Node.Text == "Node 1")
        {
            new RadForm1().ShowDialog();
        }
    }
 
    private void Form1_Load(object sender, EventArgs e)
    {
        //Right
        this.RightRadTreeView.Nodes.Add(new RadTreeNode { Text = "Node 1" });
        this.RightRadTreeView.Nodes.Add(new RadTreeNode { Text = "Node 2" });
        this.RightRadTreeView.Nodes.Add(new RadTreeNode { Text = "Node 3" });
        this.RightRadTreeView.Nodes.Add(new RadTreeNode { Text = "Node 4" });
    }
}

 

Dialog Form

https://i.stack.imgur.com/hH7Ln.png

 

Hristo
Telerik team
 answered on 08 May 2018
3 answers
238 views

Hello there,

I have a telerik tree view with tens of thousands of nodes (around 190k). When I load this in most computers, it works ok, sometimes it takes a few seconds to open nodes, but that's acceptable for the number of nodes.

But, in some Windows 10 computers (not all of them), the tree takes more than 20 min to respond, if it ever does. This happens when clicking anywhere in the tree component (expand buttons, nodes, scrollbar...).

One of the computers details where it hangs is:

  • Windows 10 Enterprise (64 bit). Version 1703.
  • .NET 4.7.1
  • Telerik 2018.1.116.40
  • The laptop has a touch screen

After debugging I found the tree is stuck in GetChild() method (it loops through all the nodes, several times), from RadTreeViewAccessibleObject (attached call stack). This seems to come from windows messages.

Checking in computers where the tree doesn't hang, this call never happens, which makes me think it's a problem with the implementation of windows messages, in some specific version of windows + hardware.

Any ideas on how to fix or bypass this?

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 May 2018
2 answers
90 views

 Isn't there any way to add an add (+) button to the pageview so that the user can add pages from the pageview itself

please help me with a code and a screenshot.

thanks In advance

 

Ahmed
Top achievements
Rank 1
 answered on 07 May 2018
1 answer
467 views

I have been populating my treeviews programmatically but would like to change to binding.

I read data from db and build a data model. I'd like to bind the data model to my treeview. so that when collections of objects and objects' properties themselves change they should automatically update in the treeview.

Which binding method would be the best way to achieve this? I've attached a simple mockup diagram to show the hierarchical structure. (Node types are abbreviated and I've removed the N level shown in the diagram from the code, as it doesn't really add to my question). The first part shows the model, and below shows some sample data.

I did a quick test like below which works, but doesn't allow for the collection of Table objects in Form (sibling to the Elements collection) to be populated. I hope this makes sense.

// pseudocode         
class DataModel { public List<Form> forms; }
class Form { public string Name { get; set;} public List<Element> Elements; public List<Table> Tables; }
class Element { public string Name { get; set;} }
class Column { public string Name { get; set;} }
class Table { public string Name { get; set;} public List<Column> Columns; }
            
// not showing creation of data model; see diagram for structure

// var DataModel sampleData;

_view.DataSource = new BindingList<Form>(sampleData.forms);
_view.DisplayMember = "Name\\Name";
_view.ChildMember = "Forms\\Elements";

 

As a side question, I'd like to have the T objects and the F objects (for example) in their own visual 'folder' in the treeview. Can this be still achieved with data binding, or should I stick my manual population method (which has lots of overhead trying to keep data model and tree view in synch with events, etc.).

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 May 2018
2 answers
88 views
I connected the database to the "CardView".
I made the changes in the "CardView" field.

How can I make changes saved in the database?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 May 2018
2 answers
183 views

What is the scope of setting RadGridLocalizationProvider please?

When setting it, it doesn't seem to be assigned to anything eg a particular window. So I'm a bit confused whether it should be set once on startup or if it should be set per form.

On the surface the function "CurrentProvider" appears to be setting.a static variable somewhere, so does the function add the new instance to a list? or does it override a single instance and need resetting after a child form is disposed?

Sorry if this seems like a dumb question.

  public class GeneralRadGridLocalizationProvider : RadGridLocalizationProvider
  {
    public override string GetLocalizedString(string id)
    {
      switch (id)
      {
        case RadGridStringId.ConditionalFormattingPleaseSetValidCellValue: return GuiResources.Please_set_a_valid_cell_value;
//foo bar the remaining ids
        case RadGridStringId.ExpressionFormNotButton: return string.Empty; //if empty, default button image is used
      }
      return string.Empty;
    }
  }// class
 
public function FooBar()
{
  RadGridLocalizationProvider.CurrentProvider = new GeneralRadGridLocalizationProvider();
}

Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 04 May 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)
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
+? 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?