Telerik Forums
UI for WinForms Forum
1 answer
165 views
Hi,

I can't get the pan/scroll functionality to work when reloading the chartview.

Please see the code below. When I call the LoadChart function for the first time in form load event, it works fine. When it is called for the second time in button click event, the pan/scroll does not work (zoom works, however). As You can see, I clear the series and axes in the beginning, I tried both axes.clear and axes.purge, neither of them helps.

Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
 
     rcvSchedule.ShowPanZoom = True
     LoadChart()
 
  End Sub
 
  Private Sub LoadChart()
   
     rcvSchedule.Series.Clear()
     rcvSchedule.Axes.Purge()
     rcvSchedule.Area.View.Palette = KnownPalette.Metro
 
     Dim horizontalAxis As New CategoricalAxis
     horizontalAxis.LabelFitMode = Telerik.Charting.AxisLabelFitMode.Rotate
 
     Dim bar1DataSource As New List(Of CustomObject)()
     bar1DataSource.Add(New CustomObject() With {.Value1 = 250, .Category = "19.09.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 200, .Category = "30.09.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 25, .Category = "06.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "17.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "18.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "19.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "20.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "21.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "22.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "23.10.2013"})
     bar1DataSource.Add(New CustomObject() With {.Value1 = 300, .Category = "24.10.2013"})
 
     Dim bar1 As New BarSeries()
     bar1.ValueMember = "Value1"
     bar1.CategoryMember = "Category"
     bar1.LegendTitle = "Tot."
     bar1.DataSource = bar1DataSource
     bar1.HorizontalAxis = horizontalAxis
     rcvSchedule.Series.Add(bar1)
 
    
  End Sub
 
  Private Sub RadButton1_Click(sender As System.Object, e As System.EventArgs) Handles RadButton1.Click
     LoadChart()
  End Sub

Regards,
Pirjo
George
Telerik team
 answered on 29 Oct 2013
2 answers
134 views
Hello,

I used to validate the presence of the scrollbars in the DataGridView by doing this:


var scrollBar = gvBrand.Controls.OfType<VScrollBar>().First();


but with the RadGridView I'm unable to do this... 

Is there an alternative ?

Thank you
Nuno
Top achievements
Rank 1
 answered on 28 Oct 2013
2 answers
97 views
Hi,

I've noticed that the RadTreeView font in the latest Q3 2013 release seems different to previous releases.  It's almost as if it's not anti-aliased (see attached screenshot of both Q2 and Q3 2013 treeviews in the Telerik demo app).

Any info would be much appreciated.

Regards,

Frazz 
Ralitsa
Telerik team
 answered on 28 Oct 2013
3 answers
241 views
hi
i want to filter the grid of multicolumncombobox by using filtering row so i use this code
 DataTable dt = new DataTable();
            dt.Columns.Add("id");
            dt.Columns.Add("Name");
            dt.Rows.Add("1", "a");
            dt.Rows.Add("2", "b");
            dt.Rows.Add("3", "c");
            radMultiColumnComboBox1.DataSource = dt;
            radMultiColumnComboBox1.EditorControl.EnableFiltering = true;
            radMultiColumnComboBox1.EditorControl.EnableCustomFiltering = true;
            radMultiColumnComboBox1.EditorControl.ShowFilteringRow = true;    ///by using this we only can see the filtering row

so i can see the filteringrow but it dosent work .i cant filter the grid of multicolumn and i cant do customfiltering like some thing we do in radgridviews.
please help me if you know a way to do it
Stefan
Telerik team
 answered on 28 Oct 2013
6 answers
346 views
Hello, 
I am using RadControls for WinForms 2011 Q3 
RadGridView,  it is in unbound mode.
 
I want to reorder the row. Say I drag the row 1 and drop it to row 4. 
but it does not work. I guess somehow I must miss something, please help.  thanks !

public init()
{
            InitializeComponent();
            InitializePreviewGrid();
            SubscribeForGridEvents(radGridViewPreview);    
}
        List<PreviewItem> _previewLists = new List<PreviewItem>();
        private void InitializePreviewGrid()
        {
            radGridViewPreview.AutoGenerateColumns = false;
            var imageCol = new GridViewImageColumn("DeleteIcon", "DeleteIcon");
            imageCol.HeaderText = "";
            imageCol.Width = 30;
            radGridViewPreview.Columns.Add(imageCol);

            var col = new GridViewTextBoxColumn("DisplayStr", "DisplayStr");
            col.Width = 350;
            radGridViewPreview.Columns.Add(col);

            col = new GridViewTextBoxColumn("ValueStr", "ValueStr");
            col.IsVisible = false;
            radGridViewPreview.Columns.Add(col);

            radGridViewPreview.AllowDeleteRow = false;
            radGridViewPreview.AllowAddNewRow = false;
            radGridViewPreview.AllowEditRow = false;
            radGridViewPreview.AutoScroll = true;
            radGridViewPreview.AllowAutoSizeColumns = true;

            radGridViewPreview.MasterTemplate.AllowRowReorder = true;
            radGridViewPreview.ReadOnly = true;
            radGridViewPreview.MultiSelect = true;
            radGridViewPreview.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

            radGridViewPreview.GridBehavior = new CustomGridBehavior();
        }

        private void SubscribeForGridEvents(RadGridView grid)
        {
            dragDropService = grid.GridViewElement.GetService<RadDragDropService>();
            dragDropService.PreviewDragOver += dragDropService_PreviewDragOver;
            dragDropService.PreviewDragDrop += dragDropService_PreviewDragDrop;
            dragDropService.PreviewDragHint += dragDropService_PreviewDragHint;
            dragDropService.PreviewDropTarget += dragDropService_PreviewDropTarget;
            dragDropService.PreviewDragStart += dragDropService_PreviewDragStart;
        }

       void dragDropService_PreviewDragStart(object sender, PreviewDragStartEventArgs e)
        {
            //throw new NotImplementedException();
        }

        void dragDropService_PreviewDropTarget(object sender, PreviewDropTargetEventArgs e)
        {
            //throw new NotImplementedException();
        }
        
        private void dragDropService_PreviewDragDrop(object sender, RadDropEventArgs e)
        {
            var rowElement = e.DragInstance as GridDataRowElement;
            if (rowElement == null)
            {
                return;
            }

            var dropTarget = e.HitTarget as RadItem;
            var targetGrid = dropTarget.ElementTree.Control as RadGridView;
            if (targetGrid == null)
            {
                return;
            }

            var dragGrid = rowElement.ElementTree.Control as RadGridView;
            if (targetGrid != dragGrid)
            {
                e.Handled = true;

                var behavior = (CustomGridBehavior)dragGrid.GridBehavior;
                var dropTargetRow = dropTarget as GridDataRowElement;
                int index = dropTargetRow != null ? GetTargetRowIndex(dropTargetRow, e.DropLocation) : targetGrid.RowCount;
                MoveRows(targetGrid, dragGrid, behavior.SelectedRows, index);
            }
        }

        private void dragDropService_PreviewDragOver(object sender, RadDragOverEventArgs e)
        {
            if (e.DragInstance is GridDataRowElement)
            {
                e.CanDrop = e.HitTarget is GridDataRowElement || e.HitTarget is GridTableElement || e.HitTarget is GridSummaryRowElement;
            }
        }

        private void dragDropService_PreviewDragHint(object sender, PreviewDragHintEventArgs e)
        {
            GridDataRowElement dataRowElement = e.DragInstance as GridDataRowElement;

            if (dataRowElement != null && dataRowElement.ViewTemplate.MasterTemplate.SelectedRows.Count > 1)
            {
                //e.DragHint = new Bitmap(this.imageList1.Images[6]);
                e.UseDefaultHint = false;
            }
        }

        private void MoveRows(RadGridView targetGrid, RadGridView dragGrid, IList<GridViewRowInfo> dragRows, int index)
        {
            for (int i = dragRows.Count - 1; i >= 0; i--)
            {
                GridViewRowInfo row = dragRows[i];

                if (row is GridViewSummaryRowInfo)
                {
                    continue;
                }

                GridViewRowInfo newRow = targetGrid.Rows.NewRow();
                this.InitializeRow(newRow, row);
                targetGrid.Rows.Insert(index, newRow);
                row.IsSelected = false;
                dragGrid.Rows.Remove(row);
                index++;
            }
        }

        private void InitializeRow(GridViewRowInfo destRow, GridViewRowInfo sourceRow)
        {
            destRow.Cells["DisplayStr"].Value = sourceRow.Cells["DisplayStr"].Value;
            destRow.Cells["ValueStr"].Value = sourceRow.Cells["ValueStr"].Value;
        }

        private int GetTargetRowIndex(GridDataRowElement row, Point dropLocation)
        {
            int halfHeight = row.Size.Height / 2;
            int index = row.RowInfo.Index;

            if (dropLocation.Y > halfHeight)
            {
                index++;
            }

            return index;
        }
Stefan
Telerik team
 answered on 28 Oct 2013
1 answer
138 views
Hi,

I'm trying to intercept the paste event when the user has pressed control -v, to paste the clipboard contents as plain text.
But I can't work out where to start ?

Thanks
Euan
Dimitar
Telerik team
 answered on 28 Oct 2013
6 answers
662 views
I have what I hope is a simple problem.   I have a simple WinForms application in which I'm providing a generic ObservableCollection<> of a simple public business object type as a data source for a RadGridView (version Winforms 2011_1_11_419), .  

For whatever reason, i cannot get it to auto-sort by clicking on the column headers.  (My understanding after reading the Help is that this should be automatic if the "GridView.EnableSorting" and "GridView.MasterTemplate.EnableSorting" properties are both true).   I do have AutoGenerateColumns also set to True, since the business object is still evolving and gaining/adding/changing properties in between builds..

I've tried setting the grid's DataSource property directly to the ObservableCollection<MyObjectType>.  I've tried creating an intermediate BindingSource and setting the grid's DataSource to that.   I've tried creating several SortDescriptors for the columns on which I most need to sort.   I've tried removing all such SortDescriptors.   I've tried creating a custom SortableObservableCollection (which works in binding in WPF) instead of the ObservableCollection.   Etc. 

The data always displays correctly in the GridView; but doesn't sort or show sort direction indicators in the column headers.

There has to be something simple I'm missing.

Thanks!
-Bob
Michael
Top achievements
Rank 1
 answered on 27 Oct 2013
2 answers
133 views
from
Demo Application - RadControls for WinForms.
Gridview -> Custom Painting.

I want to move the drawing image in grid view.
- change cursor on mouse over
- drag and drop drawing
- show image moving 

please help me...
Lek
Top achievements
Rank 1
 answered on 26 Oct 2013
1 answer
164 views
Hello,

We currently trying the controls and encountered some bugs..
On the form load event, when setting image list to the toolbar and imagekey to a specific menu button some of the buttons does not get refresh and some do..

Is there a way to force refresh to all the buttons after changing the image key?

Thank you
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Oct 2013
12 answers
1.4K+ views
With RadControls 2008 Release 3 1204 (control version 8.1.0.0) I'm facing the following issue:

I handle the ValueChanging and ValueChanged events of a GridViewComboBoxColumn in a data bound GridView control. I set e.Cancel=true in the ValueChanging event handler to prevent modification of the cell value. I would expect not to receive the ValueChanged event in this case - but I'm wrong: The event will be fired although I requested to cancel the changes. Is this intended?

The second thing I don't understand is: why are the Changing / Changed events actually fired even if the cell value did not change at all?

Assume the following scenario: As I said above I have a data bound GridView with an also data bound GridViewComboBoxColumn. I drop down a cell's editor and select the entry with the same value as the cell already contains. The Changing / Changed events will be fired. Even worse, the bound data source (in my case a DataSet/DataTable) will also be changed and contains changed data rows after this - but all values of the row are obviously the same as before.

Now I could at least try to compare the old and new values of the cell manually and cancel the editing if I find that they are equal - but this won't work because of the behaviour described on top.

So could tell my if this is a bug - or at least how I can cancel the cell editing and - more important - the modification of the bound data source?

Regards,
ReneMT


Nikolay
Telerik team
 answered on 25 Oct 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)
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?