Telerik Forums
UI for WinForms Forum
4 answers
154 views
Hi.

I have found an issue in RadGridView when using multiselect and menu.
What i want to do is: select multiple lines, right click on RadGridView and execute some action on each line.
Apparently no big deal, done it with this code:

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private RadMenuItem mnuAdd = new RadMenuItem("Add");
 
 
        private void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            e.ContextMenu.Items.Add(mnuAdd);
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            mnuAdd.Click += new EventHandler(mnuAdd_Click);
 
            radGridView1.Rows.AddNew().Tag = false;
            radGridView1.Rows.AddNew().Tag = false;
        }
 
        void mnuAdd_Click(object sender, EventArgs e)
        {
            foreach (GridViewRowInfo row in radGridView1.SelectedRows)
            {
                row.Tag = !((bool)row.Tag);
                row.Cells[0].Value = row.Tag;
            }
        }
    }
}

I only drag and drop a RadGridView control to my form,  changed MultiSelect property to true and added a column.
Now, when i select multi lines (or just one line) i right click and the menu show up with my menu (and others... but also no big deal). If i chose my menu, the row value change from false to true and from true for false. Simple.


The real problem is when i order the column. After that, if i select more than one row and i select my menu, it is thrown this exception:
"InvalidOperationException: Collection was modified; enumeration operation may not execute."

According my visual studio the error it is in the foreach iteration, more exactly in the "in":
foreach (GridViewRowInfo row in radGridView1.SelectedRows)


Ok... its a foreach problem. I try replace the foreach with a for statement:

for (int a = 0; a < radGridView1.SelectedRows.Count; a++)
{
    radGridView1.SelectedRows[a].Tag = !((bool)radGridView1.SelectedRows[a].Tag);
    radGridView1.SelectedRows[a].Cells[0].Value = radGridView1.SelectedRows[a].Tag;
}


With this solution, after i select both rows and right click and select my menu, i found out that radGridView1.SelectedRows only have one row, the one where i right click and is the only one that got changed.

Think this is one bug in RadGridView (or i am doing someting really wrong...).

I would like some help/answer.

Kind Regards,

Bruno Almeida
bruno
Top achievements
Rank 1
 answered on 13 Oct 2010
3 answers
181 views
hello to all

i m making a project in vb.net (window application)  using radcontrols(telerik) now i want to create setup of my project but problem is that project is working fine if radcontrol_winfrom .exe is install in conputer otherwise project is not working.
so what should i have to add in the setup.
Richard Slade
Top achievements
Rank 2
 answered on 13 Oct 2010
3 answers
243 views
I need that control but is not in Component.

Help me.

I must use it !!
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
1 answer
121 views
Hi,
maybe this is an ridiculous question, but I can't solve it...
I have a dropdownlist..and I setting the font size 12..then I'm running it and looks ugly like this link below:
bingung

I already tried change some property like dropdown height, etc...but doesn't solve the problem...
is there any solution??
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
2 answers
208 views
Hi,
Recently I have installed telerik 2010 controls for winform ,But after installing when i go to vs 2008 Ide , I cannot see the rad tabstrip control in tool box.
I tried to add all telerik dll to toolbox but still the tab strip control is not coming.

Please help me its very urgent.

Thanks,
Ajeesh
A2H
Top achievements
Rank 1
 answered on 13 Oct 2010
1 answer
105 views
hi:
I need disable the contextmenu of the radgridview.
as I do?

thanks
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
4 answers
271 views
Hi,
I am new to GridView control for Windows Application.

I have some doubts.

How to apply theme to a Grid View.
Problem I am facing: When I apply themes to grid,outer border  are disapperaing and + symbol for expanding and collapsing Hierarchial grid is changing to some different control.Its make my grid looks odd.

How to set a GridView in Unbound Mode.
Which one will be the default mode for GridView.

Thanks,
A2H
Emanuel Varga
Top achievements
Rank 1
 answered on 12 Oct 2010
5 answers
120 views
I got the latest build  (dated 3/9) and while the new VSB is great, there are controls that are not listed as available for creating a theme. RadToolStrip, RadStatusStrip, RadPanel, and on and on and on. When can we expect all of the controls to be listed, or am I doing something wrong and there's already a way to get them listed and I'm missing it?
Peter
Telerik team
 answered on 12 Oct 2010
2 answers
94 views
I've created a custom GridViewColumn, along with a custom CellElement, inheriting from GridCommandCellElement, and by default, the GridCommandCellElement does not have DrawBorder set to true.  When I set it to true, it draws a border that is a different color than, say, a GridViewTextBoxElement within the same grid.  How does the GridViewTextBoxElement know to draw it's own border as the light blue color it is currently drawing it with, as opposed to the black color my custom element is being drawn with, and how can I fetch that value?

Thanks, 

David
David
Top achievements
Rank 1
 answered on 12 Oct 2010
2 answers
82 views
Hi
I am using Telerik WinForms controls
I Have a problem in RibBoonBar
Win I change any item in it or add new item ,all old item's size become zero
Peter
Telerik team
 answered on 12 Oct 2010
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
StatusStrip
CheckedListBox
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?