Telerik Forums
UI for WinForms Forum
1 answer
160 views
Hello!

I found a couple of problems with sorting in the latest WinForms RadGridView (2011.1.11.315). I use Visual Studio 2008 with .NET 3.5. 

I have created a single form with a RadGridView.

Form1.cs
using System.Collections.Generic;
using System.Windows.Forms;
  
namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
  
            List<DataItem> list = new List<DataItem>();
            list.Add(new DataItem() { Name = "Item 1" });
            list.Add(new DataItem() { Name = "Item 3" });
            list.Add(new DataItem() { Name = "Item 2" });
  
            radGridView1.DataSource = list;
        }
    }
  
    public class DataItem
    {
        public string Name { get; set; }
    }
}

Form1.Designer.cs

namespace Test
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
  
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
  
        #region Windows Form Designer generated code
  
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.Data.SortDescriptor sortDescriptor1 = new Telerik.WinControls.Data.SortDescriptor();
            this.radGridView1 = new Telerik.WinControls.UI.RadGridView();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).BeginInit();
            this.SuspendLayout();
            // 
            // radGridView1
            // 
            this.radGridView1.BackColor = System.Drawing.SystemColors.Control;
            this.radGridView1.Cursor = System.Windows.Forms.Cursors.Default;
            this.radGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.radGridView1.EnableCustomSorting = true;
            this.radGridView1.Font = new System.Drawing.Font("Segoe UI", 8.25F);
            this.radGridView1.ForeColor = System.Drawing.SystemColors.ControlText;
            this.radGridView1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.radGridView1.Location = new System.Drawing.Point(0, 0);
            // 
            // radGridView1
            // 
            gridViewTextBoxColumn1.FieldName = "Name";
            gridViewTextBoxColumn1.FormatString = "";
            gridViewTextBoxColumn1.HeaderText = "Name";
            gridViewTextBoxColumn1.Name = "Name";
            this.radGridView1.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
            gridViewTextBoxColumn1});
            sortDescriptor1.PropertyName = "Name";
            this.radGridView1.MasterTemplate.SortDescriptors.AddRange(new Telerik.WinControls.Data.SortDescriptor[] {
            sortDescriptor1});
            this.radGridView1.Name = "radGridView1";
            this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.radGridView1.Size = new System.Drawing.Size(284, 264);
            this.radGridView1.TabIndex = 0;
            this.radGridView1.Text = "radGridView1";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 264);
            this.Controls.Add(this.radGridView1);
            this.Name = "Form1";
            this.Text = "Form1";
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit();
            this.ResumeLayout(false);
        }
        #endregion
  
        private Telerik.WinControls.UI.RadGridView radGridView1;
    }
}

The grid sorting is set in the Property Builder. But when line

((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit();

is executed, the SortDescriptors collection is cleared and the grid becomes unsortable. This worked well in v.2010.3.10.1215.

Another problem concerns the custom sorting. I found that the CustomSorting handler is not called if the SortDescriptors collection is empty. I think this is not correct behavior, because the custom sorting logic is coded explitly and it should not depend on the grid sort descriptiors. If we note the first problem listed above, the CustomSorting handler is not called until the SortDescriptors collection is explicitly populated with the application code, or the column header is clicked by user.

Thank you.

Alexander
Telerik team
 answered on 21 Apr 2011
3 answers
197 views
In standard DataGridView i can get items value by this code : Ivalue = DataGridView1.Item(i, j).Value .
Please help me how to i do this by RadGridView.
Thank you.
Richard Slade
Top achievements
Rank 2
 answered on 20 Apr 2011
1 answer
151 views
Good Evening

I am using the 2010 Q3 controls and i have created some buttons within a Vertical Button Group.  However the controls that i have had on there and assigned code to and everything have suddenly vanished and keetp vanishing even when i recreate them however i have to create them with a different name.

They are in the designed code:
Me.btnSetVATFigure = New Telerik.WinControls.UI.RadLabelElement
and 
'
        'RadRibbonBarButtonGroup4
        '
        Me.RadRibbonBarButtonGroup4.Items.AddRange(New Telerik.WinControls.RadItem() {Me.RadButtonElement18,   Me.btnRemoveProject, Me.RadButtonElement17, Me.btnPricingRemoveProject, Me.btnPricingEditPrices, Me.RadButtonElement20, Me.btnSetVATFigure})
        Me.RadRibbonBarButtonGroup4.Name = "RadRibbonBarButtonGroup4"
        Me.RadRibbonBarButtonGroup4.Orientation = System.Windows.Forms.Orientation.Vertical
        Me.RadRibbonBarButtonGroup4.Text = "RadRibbonBarButtonGroup4"
note end of the first line me.btnSetVATFigure

However as you can see from the attached screen shot the button is not visible on the form.

Can someone please explain this to me as its getting very annoying now as I'm sure you will appreciate.

Thank you in advance

Luke Frost
Peter
Telerik team
 answered on 20 Apr 2011
1 answer
74 views
Hello All !

I want add 2 row blank on header of radGridView (image.png).
Who can help me?

Thank you!
Martin Vasilev
Telerik team
 answered on 20 Apr 2011
2 answers
197 views
hi, I couldn't know how to blur (cannot be selected anymore dates) and keep today's date and the following dates enabled and can be selected.
Ivan Todorov
Telerik team
 answered on 20 Apr 2011
5 answers
139 views
Hello;

I'm currently trying to dynamicaly change the orentation of my radDock1 's DocumentTabsTextOrientation.

Obviously i'm missing something because no matter how I get/set the information its not allowing change.

What would be the correct (and working) way to change the orientation from vertical to horizontal?

Thanks for your assistance.
Alexander
Telerik team
 answered on 20 Apr 2011
3 answers
240 views
Hello,
maybe somone can help me with this little problem.
I have a Groupbox with several RadioButtens in it. Then I added a RadShortCut to the GroupBox and I want the first RadioButton in that GroupBox to be focused.
This works in principle, the RadioButton gets the focus, but the cues are not shown for the focused RadioButton. This is not the expected behaviour, so the user cannot see that he has entered the GroupBox.
Only when using the TAB key to move to the GroupBox the cues are shown. I want to show the cues programmatically. Is there an option to do that?
I used the following code:
Imports Telerik.WinControls
Public Class Test4
     Private Sub Test4_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ThemeResolutionService.ApplicationThemeName = "Desert"
         RadGroupBox1.HeaderText = "<html><u>R</u>adGroupBox1"
        RadGroupBox1.RootElement.Shortcuts.Add(New RadShortcut(Keys.Alt, Keys.R))
        AddHandler RadGroupBox1.RootElement.Click, AddressOf RadGroupBox1_Click
    End Sub
     Private Sub RadGroupBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadGroupBox1.Click
        RadRadioButton1.Focus()
    End Sub
End Class

Thank you for any hint.
Cheers Roberto
Jack
Telerik team
 answered on 20 Apr 2011
8 answers
208 views
I need to cancel the CurrentRowChanging event when the user clicks on the expander (the plus / minus sign), but have not figured out how to when the expander is clicked. CellClick event is not fired when clicking on the expander.

Thank you in advance for any tips.

Andy
Andy
Top achievements
Rank 1
 answered on 20 Apr 2011
5 answers
163 views
Hi.. how are you

          Is there a method or a work around to Export the heirarchial RadGridView data to Excel?

I tried the following methods:
  1. Using Telerik.Data.RadGridViewExcelExporter 
  2. Using RadGridReportingLite. sample code using RadLite.

            (RadGridReport rep = new RadGridReport(strFileName);

 

            rep.ReportFormShow(

this, this.radGridView1);

 

 

 

 

both of them are exporting only MasterTable Data. child Table data is not exported.

Please suggest any solution.

Thank you,
Regards
Elver Emilio

Richard Slade
Top achievements
Rank 2
 answered on 20 Apr 2011
1 answer
128 views
Hi team,

I am using telerik Datagridview.

I have colums.Name ,  Age ,Place ,DoB,

On form loading i have hidden DoB column.With the help of context menu column chooser i can see the hidden column DoB.

However i want to hide the DoB Column in Column chooser Dialog also.

Thanks
suresh,

Richard Slade
Top achievements
Rank 2
 answered on 20 Apr 2011
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?