Telerik Forums
UI for WinForms Forum
1 answer
135 views
I need to perform a custom sort that is different depending on which column the user selects for the sort.

I cannot seem to determine which column the user selected to sort within the CustomSorting event.

e.Column and e.GridViewTemplate are both deprecated.

How do I determine the column that the user selected for the sort within the CustomSorting event?
Stefan
Telerik team
 answered on 27 Apr 2011
7 answers
180 views
We recently updated to Q1 2010 SP2.

We have a RadLabel on a form with the the following for the text property:

<html><a href="about:blank">Advanced Mode</a></html>

This worked fine before SP2, but now it display with no underline where there is a space. In other words, instead of having Advanced Mode underlined as a link, only the 2 words are underline, making it appear as these are two different links.

How do I fix this?
Nikolay
Telerik team
 answered on 27 Apr 2011
3 answers
358 views
How can I programmatically change the checked/unchecked value in child row cells displayed as custom cells derived from RadCheckBoxElements? Here are details of my appliation:

I have an unbound Q1 2011 RadGridView control with a single hierarchical child level in a VB.Net 2010 Winforms application . There is a 1-to-many parent-child value relationship - ie a single parent row can have multiple child row values. When the RadGridView is expanded, the multiple child rows are made up of custom cells derived from a RadCheckBoxElement. I am using a custom cell derived from RadCheckboxElement rather than a GridViewCheckView column because I want to show a text value in the cell along with the checkbox.

Selecting a child row RadCheckBoxElement-derived cell updates a value in the parent row but also needs to uncheck any other checkboxes in the same child rows. My custom RadCheckBoxElement cell takes an EventHandler as a constructor parameter so the MouseUp event of the RadCheckBoxElement can call the parent form to update the desired parent row cell. I cannot figure out how to iterate through the other child row custom cells to uncheck any checked RadCheckBoxElements.

I have created my custom cell element class derived from GridDataCellElement. Here is the partial class definition:
Public Class CheckBoxCellElement
    Inherits GridDataCellElement
  
    Private chkBox As RadCheckBoxElement
    Private clickEvent As EventHandler
  
    Public Sub New(ByVal column As GridViewColumn, ByVal row As GridRowElement, ByVal extClickEvent As EventHandler)
        MyBase.New(column, row)
  
        clickEvent = extClickEvent
    End Sub

In the overridden CreateChildElements method I create the RadCheckboxElement and add a handler for the MouseUp event which in turn calls the passed in clickEvent. This clickEvent is passed in from the parent form in the RadGridView_CreateCell event thus:
Private Sub RadGridView1_CreateCell(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCreateCellEventArgs) Handles RadGridView1.CreateCell
          
            If Not TypeOf e.Column Is CheckBoxColumn OrElse Not TypeOf e.Row Is GridDataRowElement Then Return
  
            e.CellElement = New CheckBoxCellElement(e.Column, e.Row, New EventHandler(AddressOf CheckBoxElementClicked))

Here is the method in the parent form that updates the desired RadGridView.ParentRow value - note that CheckBoxCellEventArgs is inherited from EventArgs with some extra fields:

Private Sub CheckBoxElementClicked(ByVal sender As Object, ByVal e As EventArgs)
        If Not TypeOf sender Is RadCheckBoxElement OrElse Not TypeOf e Is CheckBoxCellEventArgs Then Return
  
        Dim evArgs As CheckBoxCellEventArgs = CType(e, CheckBoxCellEventArgs)
  
        RadGridView1.MasterTemplate.Rows(evArgs.ParentRowIndex).Cells(_ciParentRowOptionValueColIndex).Value = evArgs.NewValue
    End Sub

I've tried finding a way to iterate through the custom cells containing RadCheckBoxElements in both the custom cell class RadCheckBoxElement_MouseUp event handler and in the parent form method passed in to the custom cell constructor as an EventHandler. Guidance would be most welcome.

Thanks,

Frank
Alexander
Telerik team
 answered on 27 Apr 2011
9 answers
159 views

Hi,

I have downloaded the latest trial version of WinForms Q1 2011. I have added a new Telerik project and removed the original Form1 and added a RadForm. Then had added the Office2007Black theme. Added a SlitContainer with two horizontal panels. Now when I run the project and moved the form around the screen, it shows a trailing effect.

I have attached the screenshot with this.

Why is it so ?

Ivan Todorov
Telerik team
 answered on 27 Apr 2011
1 answer
143 views
I'm using 2011 Q1 Service Pack 1 release.
When MultiSelect is enabled, the rows unexpectedly get selected if (and it happens easily) the mouse gets out of the scrollbar area and into the grid area while scrolling up/down the grid. This is not a standard Windows behavior and is a huge problem for our customers.

We chose Telerik hoping it helps, but every time we try one of the features, we run into problems... really frustrating.

Below is a sample that shows the problem, and the attached image shows how the rows were incorrectly selected while scrolling. I hope there is a workaround for it.

Andy
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
using Telerik.WinControls.UI;
 
namespace RadControllTest
{
    public partial class Form5 : Form
    {
        RadGridView myGrid;
        MyGridBehavior myGridBehavior;
 
        public Form5()
        {
            InitializeComponent();
 
            SetupGrid();
        }
 
        private void SetupGrid()
        {
            myGrid = new RadGridView();
            myGrid.Dock = DockStyle.Fill;
            myGrid.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            myGrid.MultiSelect = true;
 
            GridViewTextBoxColumn nameColumn = new GridViewTextBoxColumn("Name");
            myGrid.Columns.Add(nameColumn);
 
            myGrid.ViewCellFormatting += new CellFormattingEventHandler(gridView_ViewCellFormatting);
            myGrid.ChildViewExpanding += new ChildViewExpandingEventHandler(gridView_ChildViewExpanding);
            myGrid.CurrentRowChanging += new CurrentRowChangingEventHandler(myGrid_CurrentRowChanging);
 
            myGridBehavior = new MyGridBehavior();
            myGrid.GridBehavior = myGridBehavior;
 
            GridViewTemplate childTemplate = new GridViewTemplate();
            myGrid.Templates.Add(childTemplate);
 
            GridViewDecimalColumn idColumn = new GridViewDecimalColumn("ID");
            childTemplate.Columns.Add(idColumn);
            GridViewTextBoxColumn childNameColumn = new GridViewTextBoxColumn("Name");
            childTemplate.Columns.Add(childNameColumn);
 
            GridViewRelation relation = new GridViewRelation(myGrid.MasterTemplate, childTemplate);
            relation.ChildColumnNames.Add("Children");
            myGrid.Relations.Add(relation);
 
            this.Controls.Add(myGrid);
 
            BindingList<MockParent> parents = new BindingList<MockParent>();
 
            for (int i = 0; i < 100; i++)
            {
                MockParent p = new MockParent("Parent " + i.ToString());
 
                if ((i % 2) == 0)
                {
                    BindingList<MockChild> children = new BindingList<MockChild>();
 
                    for (int j = 1; j < 5; j++)
                    {
                        children.Add(new MockChild(j, "Child " + j.ToString()));
                    }
 
                    p.Children = children;
                }
 
                parents.Add(p);
            }
 
            myGrid.DataSource = parents;
            myGrid.AutoGenerateHierarchy = true;
            childTemplate.ShowColumnHeaders = false;
            childTemplate.ShowRowHeaderColumn = false;
        }
 
        void myGrid_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("CurrentRowChanging");
 
            if (myGridBehavior.ExpanderClicked)
            {
                System.Diagnostics.Debug.WriteLine("CurrentRowChanging Canceled");
                e.Cancel = true;
            }
        }
 
        void gridView_ChildViewExpanding(object sender, ChildViewExpandingEventArgs e)
        {
            if ((e.ParentRow != null) && (e.ParentRow.ChildRows.Count < 1))
            {
                e.Cancel = true;
            }
        }
 
        void gridView_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridGroupExpanderCellElement cell = e.CellElement as GridGroupExpanderCellElement;
 
            if (cell != null && e.CellElement.RowElement is GridDataRowElement)
            {
                if ((cell.RowInfo.ChildRows != null) && (cell.RowInfo.ChildRows.Count > 0))
                {
                    cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Visible;
                }
                else
                {
                    cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
                }
            }
        }
 
 
        private class MyGridBehavior : BaseGridBehavior
        {
            public bool ExpanderClicked { get; set; }
 
            public override bool OnMouseDown(MouseEventArgs e)
            {
                System.Diagnostics.Debug.WriteLine("MouseDown");
 
                ExpanderClicked = false;
 
                if (this.CellAtPoint is GridGroupExpanderCellElement)
                {
                    GridViewRowInfo row = this.CellAtPoint.RowInfo;
                    if ((row != null) && (row.ChildRows.Count > 0))
                    {
                        ExpanderClicked = true;
                    }
                }
 
                return base.OnMouseDown(e);
            }
 
            public override bool OnMouseUp(MouseEventArgs e)
            {
                System.Diagnostics.Debug.WriteLine("MouseUp");
 
                ExpanderClicked = false;
                 
                return base.OnMouseUp(e);
            }
        }
 
 
        private class MockParent
        {
            public string Name { get; set; }
 
            public BindingList<MockChild> Children { get; set; }
 
            public MockParent(string s)
            {
                Name = s;
            }
        }
 
        private class MockChild
        {
            public int ID { get; set; }
            public string Name { get; set; }
 
            public MockChild(int id, string s)
            {
                ID = id;
                Name = s;
            }
        }
    }
}
Alexander
Telerik team
 answered on 27 Apr 2011
3 answers
185 views

Hi

I didn't see RadMessageBox listed in my toolbox ! From where can I add it ?

Stefan
Telerik team
 answered on 27 Apr 2011
1 answer
100 views
Go to the Buttons demo. Select the radio buttons demo.

Now pick one of the Office2010 themes.

The shaped checkboxes all become circles.

The non-office themes are OK though.

-- 
Stuart
Stefan
Telerik team
 answered on 26 Apr 2011
3 answers
114 views
I have a question for those of you that have updated your Telerik WinForms controls to the recently released SP1 version. Did you have manually set your projects referencing Telerik WinForms controls to be writable before you could do the update? I did and have had to do so for each version update.

My question to Telerik is this; why is this not accounted for in their Project Update Utility? To the best of my knowledge Visual Studio typically sets all project files to be read-only so that changes are less likely to be made outside of Visual Studio, especially when source control is used. Visual Studio has no trouble writing back to project files every time you save your changes. This leads me to believe that it would also be possible for the Project Update Utility to do so, as well.

Granted, Microsoft may "cheat" when it comes to saving changes to read-only files, as they do in other instances of needing to "fudge" permissions, but there should be a way for a third-party provider to do so as well. Any light that can be shed on this would be greatly appreciated!
Richard Slade
Top achievements
Rank 2
 answered on 26 Apr 2011
11 answers
226 views
Good Day,

I would like to know if this is currently possible with the RadGrid, Please see image link. I would like a statusbar type control but in the radgrid so when a user adds a filer he will be able to quickly cancel all the filters or just disable/enable the filter quickly.

If it's not possible can you please think of adding it to the next release as this will be a nice user experience addition.

FilterStatus_Image
Richard Slade
Top achievements
Rank 2
 answered on 26 Apr 2011
8 answers
189 views
HI i tried to Upgrade From Q3 2010 to q1 2011 to get advantage from new updates but it seems there is lot of code changes :
1. I am not able to use collapseall() anymore
2.i am not able to bind node tag like before cause i use to fill data from table fields inside tag so i can use them after cause i return always nothing
3.i am not able to take advantage from sorting and filtering the treeview since i need drag and drop also in the treeview so i have to choose either drag or either filtering and that is not a good choice for my project cause i need to use them both
4. i am not able to clear nodes anymore like i use to do before :tree.nodes.clear
5. i am having problems with the treeview when i refill the treeview with the datasource 
and lots of changes that has made me keep working on q3 2010 and not using the q1 2011

if there any solutions for these problems i will be glade to hear about and need to know what are the new coding changes and differences between the old version and the new one cause it seems some code that use to work on the previous version not working on the new one.
Regards 
Nikolay
Telerik team
 answered on 26 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)
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
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?