Telerik Forums
UI for WinForms Forum
14 answers
1.5K+ views
I have a need to allow the user to delete multiple rows in a grid that is unbound based on their selection. The problem is that even though the grid is set with the following attributes:

SelectionMode: FullRowSelect
MultiSelect: True

And the rows appear selected via the control key + the mouse click on the row, the row .IsSelected property does not get set to true, it is always false. However, display wise on the screen the rows selected by the user appear to be selected with the orange highlight for the row.

The code that handles the deletion looks like this, the method that calls this block is via a context menu:

           int rowSelected = radGridView.SelectedRows.Count;

            if (rowSelected > 0)
            {
                int rowCount = radGridView.Rows.Count();
                for (int x = rowCount - 1; x >= 1; x--)
                {
                    if (radGridView.Rows[x].IsSelected)
                        radGridView.Rows[x].Delete();
                }
            }    

If the rows are set programmatically via the radgridview.Rows[x].IsSelected value to true, but of course I don't know what the user is going to select or unselect prior to the code running, so that is not an option when loading of information into the grid. Is there some other event that should be called to set the row when the user clicks on the row header, if so what is the property or event that needs to be handled?

I also tried this on handling the SelectChanged event on the grid. But no matter what happens the row.IsSelected property remains false:

private void radGridView_SelectionChanged(object sender, EventArgs e)
        {
            GridViewRowInfo ri = radGridView.CurrentRow;
            int rowIndex = ri.Index;
            if (rowIndex >= 0)
            {
                bool selectedRowState = radGridView.Rows[rowIndex].IsSelected;
                bool updatedSelection = (!selectedRowState);                                                   // sanity check for value
                radGridView.Rows[rowIndex].IsSelected = updatedSelection;                            // value stays false even after setting to true?
            }
        }



Thank you.
Stefan
Telerik team
 answered on 28 Feb 2013
4 answers
192 views
I created a RadContextMenu and added it to my RadGridView, but the menu appears to have no theme. It doesn't look anything like the default menu and the ThemeName is blank.

I tried this but the the RootElement doesn't seem to have a ForceApplyTheme() method anymore.
Jay
Top achievements
Rank 1
 answered on 27 Feb 2013
6 answers
559 views
Hi guys,
This is how I use this event. It worked fine in Q3 2011.
this.radGridView1.ContextMenuOpening += new Telerik.WinControls.UI.ContextMenuOpeningEventHandler(this.radGridView1_ContextMenuOpening);

private void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
       {
          //implementation code here
              e.ContextMenu = radContextMenu1.DropDown;
         
       }
Since I started using Q3/2012, this event doesnt seem to work anymore. Any suggestion?
Helen
Top achievements
Rank 2
 answered on 27 Feb 2013
1 answer
141 views
Hi.  I'm working with the winforms chartview and exploring what it can do.  I've noticed that If I scroll and zoom my chart with control/mouse-wheel and click/drag operations, the labels fly off the X axis and start scrolling with the chart... I've attached a pic and some code.

Ideas?

ChartPanZoomController panZoomController = new ChartPanZoomController();
panZoomController.PanZoomMode = ChartPanZoomMode.Both;
chart.Controllers.Add(panZoomController);
private void DrawChart(string ticker)
{
    chart.Series.Clear();
    chart.ShowPanZoom = true;
 
    CandlestickSeries series = new CandlestickSeries();
    List<DailyOHLCV> prices = hStocks[ticker];
    foreach (DailyOHLCV dayPrice in prices)
        series.DataPoints.Add(
            new OhlcDataPoint(dayPrice.open, dayPrice.high, dayPrice.low, dayPrice.close, dayPrice.date));
 
    DateTimeCategoricalAxis axis = new DateTimeCategoricalAxis();
    axis.LabelFormat = "{0:dd-MMM-yy}";
    axis.LabelRotationAngle = 90;
    axis.LabelFitMode = AxisLabelFitMode.Rotate;
    axis.MajorTickInterval = chart.Width / 10;
    series.HorizontalAxis = axis;
    chart.Series.Add(series);
}
Ivan Petrov
Telerik team
 answered on 27 Feb 2013
1 answer
528 views
How do I get the RadTextBox to respond to the Return key by moving to the next control on the form?
Stefan
Telerik team
 answered on 27 Feb 2013
3 answers
117 views
I have a grid anchored on all sides in its container (radPageViewPage).

I have set 
    AutoSizeColumnsMode = Fill
    AutoSizeRows = False or True
    HorizontalScrollState = AlwaysShow or AutoHide

However, the Horizontal Scroll Bar is *never* shown.

However, when I set
    AutoSizeColumnsMode = None

The HSB is displayed. However, the behaviour is erratic when I also set 
    AutoSizeRows = True

because when I change the size of a column, the width of the grid changes.

Because some of the columns have a minimum width, the fact that the HSB *never* is displayed with
   AutoSizeColumnsMode = Fill
even when some of the columns are hidden, seems like a bug to me.

Helen
Anton
Telerik team
 answered on 27 Feb 2013
1 answer
508 views
How can I sort the child nodes of a particular node?
Svett
Telerik team
 answered on 27 Feb 2013
1 answer
180 views
I want my RadTextBox to undo the current changes when the user hits the Esc key.  I am using the OnKeyUp event of the RadTextBox.

However, unlike the standard Windows Forms text box, there is no Undo method on the RadTextBox.  Really???

Curiously, there is a CanUndo property on the RadTextBox...

How do I get the behavior I want?
private void radTextBox_Base_KeyUp(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Escape)
        (sender as RadTextBox).????
}

Stefan
Telerik team
 answered on 27 Feb 2013
7 answers
1.0K+ views
I need to create one RadDropDownList control in which user can enter only digits but not characters.
Hope I Will get answer soon, Thanks
Stefan
Telerik team
 answered on 27 Feb 2013
6 answers
237 views
e.NodeElement.BackgroundImage = myImage;

See attached image. I want to place this extra icon to the right. Something like "Right-align background image!". Is this possible?
Kristoffer
Top achievements
Rank 1
 answered on 26 Feb 2013
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
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?