Telerik Forums
UI for WinForms Forum
3 answers
425 views

How to add a context menu by pressing a RadButton?

ContextMenuStrip mainMenu = new ContextMenuStrip();
RadButtonElement btn = new RadButtonElement();
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Jan 2021
1 answer
190 views

Hello,

I have a GridView with GroupComparer and it works fine, but if I add EnableCustomSorting true, the GroupComparer stops working, it's not called by GridView anymore. Could you please advise how to make it work together.

 

public Form1()
{
  InitializeComponent();
 
  DataTable dt = new DataTable();
  dt.Columns.Add( "A", typeof( string ) );
 
  this.radGridView1.Columns.Add( "A" );
  this.radGridView1.Columns.Add( "B" );
 
  this.radGridView1.Rows.Add( "1", "1");
  this.radGridView1.Rows.Add( "2", "2" );
  this.radGridView1.Rows.Add( "10", "10" );
 
  this.radGridView1.MasterTemplate.GroupComparer = new GroupComparer();
 
  this.radGridView1.CustomSorting += RadGridView1_CustomSorting;
  this.radGridView1.EnableCustomSorting = true; //if true, GroupComparer stop working
}
 
private void RadGridView1_CustomSorting( object sender, GridViewCustomSortingEventArgs e )
{
  //logic to sort columns.
}
 
public class GroupComparer : IComparer<Group<GridViewRowInfo>>
{
  public int Compare( Group<GridViewRowInfo> x, Group<GridViewRowInfo> y )
  {
    int parsedX;
    int parsedY;
    if ( int.TryParse( ( (object[])x.Key ).First().ToString(), out parsedX ) &&
        int.TryParse( ( (object[])y.Key ).First().ToString(), out parsedY ) )
    {
      int result = parsedX.CompareTo( parsedY );
      DataGroup xGroup = x as DataGroup;
      if ( xGroup != null && ( (DataGroup)x ).GroupDescriptor.GroupNames.First().Direction == ListSortDirection.Descending )
      {
        result *= -1;
      }
      return result;
    }
    return ( (object[])x.Key )[0].ToString().CompareTo( ( (object[])y.Key )[0].ToString() );
  }
}
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Jan 2021
1 answer
116 views

As title. Followed as my code and screen shot as attachment.

public partial class Form3 : Form
{
    public Form3()
    {
        this.InitializeComponent();
 
        this.label1.Text = this.radHScrollBar1.Minimum.ToString();
        this.label2.Text = this.radHScrollBar1.Maximum.ToString();
    }
 
    private void button1_Click(object sender, System.EventArgs e)
    {
        this.textBox1.Text = this.radHScrollBar1.Value.ToString();
    }
}
Nadya | Tech Support Engineer
Telerik team
 answered on 06 Jan 2021
4 answers
601 views
How do I allow only one row in a hierarchical RadGridView to expand at a time?
Nadya | Tech Support Engineer
Telerik team
 answered on 06 Jan 2021
2 answers
166 views

As title.

My xaxis is DateTimeCategoricalAxis and how to use ScatterSeries?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 Jan 2021
1 answer
172 views

         i would like to drag RadTreeView Node to  winform standard Panel, but when i drag and drop  to the panel , my mouse always busying

         my code as fellows 

         

          panel   is   System.Windows.Forms.Panel panel

           this.tree  is  RadTreeView

 

           this.panel.AllowDrop = true;
            this.tree.AllowDrop = true;
           

            this.tree.ItemDrag  += Tree_ItemDrag;
            this.tree.DragEnter += new DragEventHandler(this.tree_FunctionList_DragEnter);

            this.panel.DragEnter += Panel_DragEnter;
            this.panel.DragDrop  += Panel_DragDrop;

 

        private void Tree_ItemDrag(object sender, RadTreeViewEventArgs e)
        {
            RadTreeNode tn = e.Node as RadTreeNode;
            if (tn != null)
            {
                (this.tree).DoDragDrop(tn, DragDropEffects.Copy);
            }
        }

        private void tree_FunctionList_DragEnter(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.Copy;
        }



        private void Panel_DragDrop(object sender, DragEventArgs e)
        {
            RadTreeNode node = e.Data.GetData(typeof(RadTreeNode)) as RadTreeNode;
            Console.WriteLine(node.Text);
        }

        private void Panel_DragEnter(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.Copy;
        }

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 Jan 2021
10 answers
579 views
I'm using RadControls for WinForms 2008.3 1321.

I built an application, using a RadForm as main form. If I run it on a local computer everything looks good. But if I connect a remote computer via terminal services (remote desktop / RDP protocoll) which is running a "XP based" operating system (e.g. Windows XP oder Windows Server 2003) there is an issue:

The caption bar of the RadForm won't get drawn correctly. It is invisible, most time completely, sometimes just the left part (the one with the image). But it is there, obviously: if I click on the right place of the "invisible" caption bar I'm able to drag, minimize or close the window although I don't see the system menu buttons nor the whole bar itself. If I move the window outside the visible bounds of the screen and back to screen again the caption bar gets drawn correctly, with all images, titles, buttons and so on. But if I minimize/restore the window after this the drawing problems appear again.

As I said above the issue seems to occure only on XP based remote systems. On computers running a Vista derivative (like any Vista version or Windows Server 2008) the whole window gets drawn correctly. The problem is also independent from the RDP client. It occures the same if I use a XP station or a Vista station as client, which both have different RDP client versions. The RDP connection settings (as color depht oder performance settings) are also unimportant. Furthermore, only the caption bar of the form is affected but none of its contents (and I use a lot of RadControls in it), including main menu or status bar.

Can anybody confirm similar issues - and has a solution maybe?

Regards,
ReneMT
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Jan 2021
1 answer
145 views

I am using the built-in drag and drop service.   I have 3 grids.   

 

I am implementing it so I can drag and drop Grid 2 rows onto rows of either Grid 1 or Grid 2.

 

I have no problem of dragging the Grid 2 Rows to a row in Grid 1.  All is working fine.

However if I drag rows from Grid 2 to Grid 3, I cannot get the svc_PreviewDragDrop event to trigger.  It will trigger if I drop it on the grid in general, but not if I drop it on a row in Grid 3.  

 

Cannot figure out what I am doing wrong.  

 

Thank you

 

Nadya | Tech Support Engineer
Telerik team
 answered on 04 Jan 2021
1 answer
136 views

I would like to select all rows based on the text typed in the search box or create a collection  of rows that contain the search text. 

 

For example if the user types 'cat" into the search box. is there a way to auto select those rows so the user could drag and drop.  I have the drag and drop working for selected rows, just wanted a new way  in selecting rows.   

 

Nadya | Tech Support Engineer
Telerik team
 answered on 04 Jan 2021
2 answers
254 views

For a SelectionChanged event in a hierarchical RadGridView, how do I test to determine which template had a row selection change?

James
Top achievements
Rank 1
Veteran
 answered on 04 Jan 2021
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?