Hi
2010 Q2 SP2
I have grid with 500 rows and enabled multiselection.
I select first row and start multiselection (SHIFT and arrow down buttons). During selecting rows between 1 and 7 or 8 everything is fine (rows are selected – notification by orange background).
When I cross row 7 or 8 my one CPU core jumps to 50% and there is no notification that next rows are selected.
I have to stop multiselection to see orange background for selected rows.
I tested this for bound and unbound mode.
Is there any way to improve performance of this simple functionality?
I am more interested about unbound mode because in ma case I have variable number of columns.
Here you can read my simple source code:
public class MySample { public string Property1 { get; set; } public string Property2 { get; set; } public string Property3 { get; set; } public string Property4 { get; set; } public string Property5 { get; set; } public string Property6 { get; set; } public string Property7 { get; set; } public string Property8 { get; set; } public string Property9 { get; set; } public string Property10 { get; set; } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Telerik.WinControls.UI; namespace PerformanceIssue { public partial class Form1 : Form { List<MySample> _list; public Form1() { InitializeComponent(); _list = this.GenerateList(); } private void btnPopulateBound_Click(object sender, EventArgs e) { radGridViewBound.DataSource = _list; foreach (GridViewDataColumn col in radGridViewBound.Columns) { col.Width = 100; } radGridViewBound.MultiSelect = true; radGridViewBound.Columns[0].IsPinned = true; } private void btnPopulateUnbound_Click(object sender, EventArgs e) { GridViewTextBoxColumn col = null; GridViewRowInfo row = null; for (int index = 1; index <= 10; index++) { col = new GridViewTextBoxColumn(); radGridViewUnbound.Columns.Add(col); col.Width = 100; } foreach (MySample item in _list) { row = radGridViewUnbound.Rows.AddNew(); row.Cells[0].Value = item.Property1; row.Cells[1].Value = item.Property2; row.Cells[2].Value = item.Property3; row.Cells[3].Value = item.Property4; row.Cells[4].Value = item.Property5; row.Cells[5].Value = item.Property6; row.Cells[6].Value = item.Property7; row.Cells[7].Value = item.Property8; row.Cells[8].Value = item.Property9; row.Cells[9].Value = item.Property10; } radGridViewUnbound.MultiSelect = true; radGridViewUnbound.Columns[0].IsPinned = true; } private List<MySample> GenerateList() { List<MySample> list = new List<MySample>(); MySample item = null; for (int index = 0; index < 500; index++) { item = new MySample() { Property1 = string.Format("Row: {0}, Col: {1}", index, 1), Property2 = string.Format("Row: {0}, Col: {1}", index, 2), Property3 = string.Format("Row: {0}, Col: {1}", index, 3), Property4 = string.Format("Row: {0}, Col: {1}", index, 4), Property5 = string.Format("Row: {0}, Col: {1}", index, 5), Property6 = string.Format("Row: {0}, Col: {1}", index, 6), Property7 = string.Format("Row: {0}, Col: {1}", index, 7), Property8 = string.Format("Row: {0}, Col: {1}", index, 8), Property9 = string.Format("Row: {0}, Col: {1}", index, 9), Property10 = string.Format("Row: {0}, Col: {1}", index, 10) }; list.Add(item); } return list; } } }
Regards
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************System.UnauthorizedAccessException: Access to the path 'D:\Dev\CMS4\Executables\MyApp\MyApp.vbproj' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding) at System.Xml.XmlDocument.Save(String filename) at Tools.ProjectConverter.ConvertVS2005ProjectFile(String projectPath, String directoryName, String fileName, XmlNode rootNode) at Tools.ProjectConverter.Upgrade(String projectPath, String fileName) at Tools.ApplicationUpgradeForm.Upgrade(DirectoryInfo directory) at Tools.ApplicationUpgradeForm.radButton1_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at Telerik.WinControls.RadControl.OnClick(EventArgs e) at Telerik.WinControls.UI.RadButton.ButtonElement_Click(Object sender, EventArgs e) at Telerik.WinControls.RadItem.OnClick(EventArgs e) at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e) at Telerik.WinControls.RadItem.DoClick(EventArgs e) at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e) at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e) at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at Telerik.WinControls.RadControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)************** Loaded Assemblies **************mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------Upgrade Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/Program%20Files/Telerik/RadControls%20for%20WinForms%20Q3%202010/Bin/Upgrade.exe----------------------------------------System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------Telerik.WinControls.UI Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.UI/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.UI.dll----------------------------------------Telerik.WinControls Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.dll----------------------------------------TelerikCommon Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/TelerikCommon/2010.3.10.1215__5bb2a467cbec794e/TelerikCommon.dll----------------------------------------System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------ihwgdr62 Assembly Version: 2010.3.10.1215 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------Telerik.WinControls.Themes.Office2007Black Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2007Black/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2007Black.dll----------------------------------------xmlrd_oa Assembly Version: 2010.3.10.1215 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll----------------------------------------Telerik.WinControls.RadChart Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.RadChart/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.RadChart.dll----------------------------------------Telerik.WinControls.RadMarkupEditor Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.RadMarkupEditor/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.RadMarkupEditor.dll----------------------------------------Telerik.WinControls.GridView Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.GridView/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.GridView.dll----------------------------------------Telerik.WinControls.Scheduler Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.Scheduler/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.Scheduler.dll----------------------------------------Telerik.WinControls.RadDock Assembly Version: 2010.3.10.1215 Win32 Version: 2010.3.10.1215 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.RadDock/2010.3.10.1215__5bb2a467cbec794e/Telerik.WinControls.RadDock.dll----------------------------------------************** JIT Debugging **************To enable just-in-time (JIT) debugging, the .config file for thisapplication or computer (machine.config) must have thejitDebugging value set in the system.windows.forms section.The application must also be compiled with debuggingenabled.For example:<configuration> <system.windows.forms jitDebugging="true" /></configuration>When JIT debugging is enabled, any unhandled exceptionwill be sent to the JIT debugger registered on the computerrather than be handled by this dialog box.
warning MSB3245: Could not resolve this reference. Could not locate the assembly "TelerikCommon, ...
warning MSB3245: Could not resolve this reference. Could not locate the assembly "Telerik.WinControls, ...Version 2010.3
In the GridView/self-referencing WinForms VB.NET demo sample,how to:
1.To get sum(Size) of "RadControls for Winforms", "RadControls for Silverlight", "RadControls for WPF" and "RadControls for ASP.NET AJAX", then write the Sum(Size) to Size cell of "Telerik RadControls".
2.To get sum(Size) of "bin" and "READEME.txt", then write the Sum(Size) to Size cell of "Visual Studio 2010".
3.To get sum(Size) of "Visual Studio 2010" and "Telerik RadControls" ,then write the Sum(Size) to Size cell of "Program Files".
4.And so on...
5.When any Size cell of a child changed,an event trigger and update it's parent /grantparent Size cell.
Best Regards.
Me.RadGridView1.ColumnCount = 2
Me.DataGridView1.ColumnCount = 2
Dim heterow0 As DataGridViewRow = New DataGridViewRow Dim textBoxCell As DataGridViewTextBoxCell = New DataGridViewTextBoxCelltextBoxCell.Value = "Turn Over Based On"Dim comboCell As DataGridViewComboBoxCell = New DataGridViewComboBoxCell()comboCell.Items.Add("Chip Transaction")comboCell.Items.Add("Win/Loss")Dim botonCell As DataGridViewButtonCell = New DataGridViewButtonCellheterow0.Cells.Add(textBoxCell)heterow0.Cells.Add(comboCell)Me.RadGridView1.Rows.Add(heterow0)
Me.DataGridView1.Rows.Add(heterow0)