Telerik Forums
UI for WinForms Forum
1 answer
2.1K+ views

My grid view has 2 handlers, that should handle cell and row formatting.

grid.RowFormatting += gridViewRaces_RowFormatting;

grid.CellFormatting += gridViewRaces_CellFormatting;

And this is their code:
private void gridViewRaces_RowFormatting(object sender, RowFormattingEventArgs e) {

      e.RowElement.DrawFill = true;

      e.RowElement.GradientStyle = GradientStyles.Solid;

      e.RowElement.RowInfo.Cells[2].Style.BackColor = Color.Blue;

}

 

private void gridViewRaces_CellFormatting(object sender, CellFormattingEventArgs e) {

      e.CellElement.DrawFill = true;

      e.CellElement.GradientStyle = GradientStyles.Solid;

      e.CellElement.BackColor = Color.Black;

}

}
But i've 2 problems:
1. Event CellFormatting doesn't fire on filling of Grid
2. RowFormatting is firing on filling of Grid, but color of cell doesn't change.
How to change cell color on GridView refresh/setting datasource?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Jul 2017
1 answer
106 views
I have a gridview with CellValueChanged event on checkbox checked changed, and filtering is enabled
When i try to filter using checkbox column, it gives me exception???
I want some example to implement this scenario.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Jul 2017
1 answer
290 views

I want to update grid row and show the selected value highlighted in GridViewComboBoxColumn so that i can change value from there.

Initially i try so many times but it will display only System.Data.DataRowView in GridViewComboBoxColumn.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Jul 2017
4 answers
82 views

Hi 

I've got a radGridView like this below

Now I wanna drag a cell and it's value, like that is significanted by red line, and drop it into a vacant cell

would you please help me .. It's very essential and emergency

 

Mohammad
Top achievements
Rank 1
 answered on 16 Jul 2017
1 answer
1.0K+ views

Hi,

How can i make application responsive UI ? with gridview i can make it with dock. But with textbox form data. Which approach for it ? 

Thanks.

Dimitar
Telerik team
 answered on 14 Jul 2017
2 answers
129 views

Hi ,

I am working with Treeview, i want to add columns behind the node to select. But i found out it does not support Treeview multi columns. and i found the solution RadGridView self-referencing. But my problem now is i want to have the behavior add children look like in Treeview. How can i do with RadGridView self-referencing ?

 

Thanks.

Bao
Top achievements
Rank 1
 answered on 14 Jul 2017
4 answers
194 views

Hi,

 

I'm using ItemDrag event to drag&drop items from a RadTreeView to another control.

When a drag an item from the RadTreeView, the ItemDrag event is raised multiple times (While item moving) and the item is dropped multiple times on the control.

The same code with System.Windows.Forms works fine.

Is there a solution to achieve the same result as System.Windows.Forms ?

 

Here is my code of a test project which compares Telerik et System.Windows.Forms:

        #region Telerik Drag&Drop

        private void radTreeView1_ItemDrag(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("radTreeView1_ItemDrag : {0}", e.Node.Name));
            DoDragDrop(e.Node, DragDropEffects.Move);
        }

        private void radTreeView2_DragEnter(object sender, DragEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("radTreeView2_DragEnter : {0}", e.Effect));
            if (e.Data.GetDataPresent("Telerik.WinControls.UI.RadTreeNode", true) == true)
            {
                e.Effect = DragDropEffects.Move;
            }
        }

        private void radTreeView2_DragDrop(object sender, DragEventArgs e)
        {
            RadTreeNode node = e.Data.GetData(typeof(RadTreeNode)) as RadTreeNode;
            if (node != null)
            {
                if (e.Effect == DragDropEffects.Move)
                {
                    System.Diagnostics.Debug.WriteLine(String.Format("radTreeView2_DragDrop : {0}", e.Effect));
                    this.radTreeView2.Nodes.Add((node.Clone() as RadTreeNode));
                }
            }
        }

        #endregion Telerik Drag&Drop

        #region System.Windows.Forms Drag&Drop

        private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("treeView1_ItemDrag : {0}", (e.Item as TreeNode).Text));
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

        private void treeView2_DragEnter(object sender, DragEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("treeView2_DragEnter : {0}", e.Effect));
            if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", true) == true)
            {
                e.Effect = DragDropEffects.Move;
            }
        }

        private void treeView2_DragDrop(object sender, DragEventArgs e)
        {
            TreeNode node = e.Data.GetData(typeof(TreeNode)) as TreeNode;
            if (node != null)
            {
                if (e.Effect == DragDropEffects.Move)
                {
                    System.Diagnostics.Debug.WriteLine(String.Format("treeView2_DragDrop : {0}", e.Effect));
                    this.treeView2.Nodes.Add((node.Clone()) as TreeNode);
                }
            }
        }

        private void bindingSource1_BindingComplete(object sender, BindingCompleteEventArgs e)
        {

        }

        private void bindingSource1_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
        {
            this.treeView1.Nodes.Clear();
            for (int i = 0; i < this.bindingSource1.Count; i++)
            {
                TreeNode node = new TreeNode((this.bindingSource1[0] as DataRowView).Row["C1"].ToString());
                this.treeView1.Nodes.Add(node);
            }
        }

        #endregion System.Windows.Forms Drag&Drop

 

Alexandre
Top achievements
Rank 1
 answered on 13 Jul 2017
1 answer
74 views

Hello all!

I'm trying to create a custom GridViewRow so I can build in several of my own properties that will make my maintenance screens far easier to manage...so I went about doing this (in vb.net)

 

Friend Class DPSRow
   Inherits GridViewRowInfo

   Private _AttachmentType As AttachmentType

   Public Property AttachmentType() As AttachmentType
       Get
          Return _AttachmentType
       End Get
       Set(ByVal value As AttachmentType)
          _AttachmentType = value
       End Set

   End Property

   Public Sub New(viewInfo As GridViewInfo, ByVal pAttachmentType As AttachmentType)
       MyBase.New(viewInfo)
       _AttachmentType = pAttachmentType
    End Sub
End Class

 

My problem is the GridViewInfo.  I'm pretty sure this object is part of the Grid hierarchy but for the life of me I can't figure out where it would be.  Here's a sample of what I mean when trying to use the above - please note, my GridViewInfo reference is total garbage - I'm just putting it in here to illustrate my question:

 

Sub something()

   Dim myAttachmentType as New AttachmentType(_ProjectID)

   Dim myRow as New DPSRow(ATGrid.Something.Something.LastThing, myAttachmentType)

   ATGrid.Rows.Add(myRow)

End Sub

In this code snippet, the object "LastThing" would be a GridViewInfo object which is required by the constructor of a GridViewRowInfo

Can anyone point me to where I can find this object among the pyramid that is my GridView control?

Any assistance would be very much appreciated!

 

Kindest regards,

CMS

 

 

 

Dimitar
Telerik team
 answered on 12 Jul 2017
1 answer
139 views

I've got a grid cell that is painted with (or contains) an array of 0 - 4 icons which represent the methods in which a customer was contacted during a certain period.

At first I wanted to create an image and assign it to the cell's image property (seemed the easiest option) but it gave me 2 problems.

1) The cell insisted on displaying the image in the centre of the cell even though I'd told the image content to align left.

2) I couldn't think of a safe method to make sure the images are disposed of when no longer in use eg after paging/filtering/sorting etc.

So I thought that I'd use the cell paint event and paint an image to e.cell.graphics as I'd not need to do any memory management.

But there's little info in your help files about how to paint all the default parts of a cell. ie if one wanted to paint a default cell, but draw an image onto it so that selected colours, text fonts, back colour, theming etc etc etc looked the same on the cell. (Multi themed app)

In the microsoft grid view CellPaint event, there's a flag that the dev sets to say that painting has been done, to prevent infinite recursing. I've noticed that flag isn't in your grid view. I wondered how that effected the cell paint if you only wanted to paint a single column of the grid for example.

Dimitar
Telerik team
 answered on 12 Jul 2017
10 answers
142 views
Hello all,

I have designed a Gridview chich has a datasource and contains 2 combobox columns.
the first combobox column is for Department, ValueMember=ID and DisplayMember = Name.
The second combobox column is for operations, valuemmember=id and displaymember=operation.

no what happenes, when the gridview is loaded, the department combobox and operations combobox both are filled with all the values,

i want to fill the Operations Combobox Column based on the value of the Department combobox column.

How to achieve this?

Thanks in Advance.
Muhammad Naveed
Top achievements
Rank 1
 answered on 11 Jul 2017
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?