Telerik Forums
UI for WinForms Forum
5 answers
797 views

I'm trying to highlight just one column header.
I would also like the whole column to have a different border to the others.
But I have not managed to modify any element of the header either.
This is the code I am using:

Private Sub RadGridView1_CellFormatting(sender As Object, e As UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting
 
        If TypeOf e.CellElement Is GridHeaderCellElement Then
            e.CellElement.Font = myCustomFont
            e.CellElement.BorderBoxStyle = BorderBoxStyle.OuterInnerBorders
 
        End If
End Sub

 

Thanks!

Dimitar
Telerik team
 answered on 26 Jul 2018
5 answers
279 views

How can I get a click event over an annotation label?

And change mouse pointer like this?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Jul 2018
7 answers
172 views

I'm using RowPaint event to "merge" cells. But when Printing it is not using the RowPaint event.

I tried to use PrintCellPaint event. But Row of event args are different. One is GridDataRowElement and other is GridViewDataRowInfo.

How can I use the same code to both events?

private void radGridView2_RowPaint(object sender, GridViewRowPaintEventArgs e)
{
    var dataRow = e.Row as GridDataRowElement;
    if (dataRow == null)
        return;
 
    var value = Convert.ToInt32(dataRow.RowInfo.Cells["Group"].Value);
    if (value == -1)
        return;
 
    var startCell = e.Row.VisualCells[2];
 
    var leftPos = startCell.PointToControl(startCell.Bounds.Location).X + (startCell.TableElement.CellSpacing * startCell.ColumnIndex);
 
    var msgLocation = new Rectangle(leftPos + 1, 1, e.Row.Bounds.Width - leftPos - 2, e.Row.Bounds.Height - 2);
 
    e.Graphics.FillRectangle(new SolidBrush(Color.White), msgLocation);
    e.Graphics.DrawString(EventLogs[value], e.Row.Font, new SolidBrush(Color.Black), msgLocation);
 
    var textSize = e.Graphics.MeasureString(EventLogs[value], e.Row.Font, msgLocation.Width);
    //if (textSize.Height > dataRow.Size.Height)
        startCell.RowInfo.Height = (int)textSize.Height;
}
Hristo
Telerik team
 answered on 26 Jul 2018
5 answers
115 views

Hi,

I'm working with a RadGridView to show dynamically some event come on my app. The RadGridView use a GridViewTemplate to show some children events and the relation is made with a GridViewRelation.
I do some tests to try to customize the display on the event ViewCellFormatting but I still have problem on the RadPageViewStripElement where like on the sample because I cannot remove the Yellow line (define on the RadPageViewContentAreaElement).

I would like know if it's possible to remove this yellow line?

 

private void GridView_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridDetailViewCellElement childCell = e.CellElement as GridDetailViewCellElement;
            GridGroupExpanderCellElement expanderCell = e.CellElement as GridGroupExpanderCellElement;
 
            if (childCell != null)
            {
                childCell.Padding = Padding.Empty;
                 
                RadPageViewStripElement stripElement = childCell.PageViewElement as RadPageViewStripElement;
                if (stripElement != null)
                {
                    stripElement.DrawBorder = false;
                    stripElement.Padding = Padding.Empty;
                     
                    RadPageViewContentAreaElement contentArea = stripElement.ContentArea as RadPageViewContentAreaElement;
                    contentArea.DrawBorder = false;
                    contentArea.BackColor = Color.Yellow;
                    contentArea.Padding = Padding.Empty;
 
                    foreach (RadPageViewItem item in stripElement.Items)
                    {
                        item.Size = new Size(0, 1);
                        item.Visibility = ElementVisibility.Hidden;
                        item.DrawBorder = false;
                    }
                }
                 
            }
          
            else if ((expanderCell != null) && (expanderCell.RowElement is GridDataRowElement))
            {
                expanderCell.Expander.Visibility = ElementVisibility.Hidden;
            }
        }
Hristo
Telerik team
 answered on 26 Jul 2018
1 answer
405 views

Hello, I am getting the below exception and I was wondering if there is any way to intercept the GridViewRowInfoComparer.CompareRows method to check for null values instead of throwing exception.

 

System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.GridViewRowInfoComparer.CompareRows(GridViewRowInfo x, GridViewRowInfo y, SortDescriptorCollection context)
   at Telerik.WinControls.UI.GridViewRowInfoComparer.Compare(GridViewRowInfo x, GridViewRowInfo y)
   at System.Collections.Generic.ArraySortHelper`1.InternalBinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
   --- End of inner exception stack trace ---
   at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
   at System.Array.BinarySearch[T](T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
   at System.Collections.Generic.List`1.BinarySearch(Int32 index, Int32 count, T item, IComparer`1 comparer)
   at System.Collections.Generic.List`1.BinarySearch(T item, IComparer`1 comparer)
   at Telerik.Collections.Generic.HybridIndex`1.PerformWithQuickSort()
   at Telerik.Collections.Generic.HybridIndex`1.Perform()
   at Telerik.Collections.Generic.HybridIndex`1.get_Items()
   at Telerik.WinControls.Data.RadDataView`1.get_Items()
   at Telerik.WinControls.Data.RadCollectionView`1.GetEnumerator()
   at Telerik.WinControls.UI.GridViewInfo.Refresh()
   at Telerik.WinControls.UI.GridViewInfo.get_ChildRows()
   at Telerik.WinControls.UI.GridViewTemplate.get_ChildRows()
   at Telerik.WinControls.UI.BaseGridNavigator.ProcessViewChangedEvent(GridViewEvent eventData)
   at Telerik.WinControls.UI.BaseGridNavigator.ProcessEventCore(GridViewEvent eventData)
   at Telerik.WinControls.UI.BaseGridNavigator.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(GridViewEvent eventData)
   at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode)
   at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(GridViewEvent gridEvent)
   at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent)
   at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()
   at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent)
   at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI)
   at Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(GridViewEvent gridEvent, Boolean postUI)
   at Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(Object sender, DataViewChangedEventArgs args)
   at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e)
   at Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewTemplate.CollectionView_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify)
   at Telerik.WinControls.Data.RadDataView`1.RefreshOverride()
   at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnNotifyPropertyChanged(String propertyName)
   at Telerik.WinControls.Data.RadCollectionView`1.set_FilterExpression(String value)
   at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.ApplyFilter()
   at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Collections.Generic.NotifyCollection`1.ClearItems()
   at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.ClearItems()
   at System.Collections.ObjectModel.Collection`1.Clear()
   at Telerik.WinControls.UI.GridViewTemplate.RefreshFilterDescriptors(GridViewTemplate template)
   at Telerik.WinControls.UI.GridViewTemplate.RefreshHierarchyProvider(GridViewTemplate template)
   at Telerik.WinControls.UI.GridViewTemplate.set_DataSource(Object value)
   at Telerik.WinControls.UI.RadGridView.set_DataSource(Object value)

Many thanks.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jul 2018
4 answers
466 views
I have a grid with grouped rows, I call ExpandAllGroups, then I'd like the first row of the first group to be selected. (currently the grid scrolls to display the first row of the datasource, I think).
How could I do that?

 

Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 23 Jul 2018
2 answers
157 views

I'm changing the Row Height at event RowPaint() according to my needing.

But I need to know the "normal" or "default" row height to apply according to the used theme.

Rodrigo Cesar
Top achievements
Rank 1
 answered on 23 Jul 2018
1 answer
599 views

I am new to Telerik controls.

I have a radbutton with image, currently when I set the button with ENABLE = FALSE, the image is the same, it is hard to recognize it is Enable or Disable.

When I use regular microsoft button control, the Disabled button is easy to see.

Please advise how to archive it.

 

Regards,

Patrick

Dimitar
Telerik team
 answered on 23 Jul 2018
3 answers
131 views

Hi

I followed the following link to implement custom grouping sorting in my app, however after using the search on the property grid the names of the groups revert to the unformatted names (see the attached Image)

https://www.telerik.com/forums/custom-grouping-in-propertygrid

Any Help would be appreciated

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 Jul 2018
4 answers
518 views
HI,
I need to hide the row indicator in my RadGridView.
i am using them in Window Forms.

I need this because the left most column of the grid is transparent and when i do the horizontal scroll, the text appears to go back behind the indicator and hinders the visibility.

I actually wanted to make the opacity of his column, maximum so that it should not allow the user to see whats scrolling behind the indicator.

I am currently using Vista Theme for these controls.

Thanks.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 Jul 2018
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
ProgressBar
CheckedDropDownList
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?