Telerik Forums
UI for WinForms Forum
0 answers
8 views

message error: La référence d objet n'est pas définie à une instance d'un objet.

Hello,
In my Frame, I use a RadDock with documentContainer and two toolwindows.
I would like the toolWindowFamily to dock automatically when I select it, rather than having to press the “pin” image.

On the “stabstripItem_click”, I put: oToolwindow:DockState=  Telerik.WinControls.UI.Docking.DockState:Docked.

Here is my code:

 

METHOD PRIVATE VOID TabStripItem_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):

        DEFINE VARIABLE oTabStripItem AS Telerik.WinControls.UI.TabStripItem       NO-UNDO.
        DEFINE VARIABLE oToolwindow   AS Telerik.WinControls.UI.Docking.ToolWindow NO-UNDO.
        DEFINE VARIABLE cValeur       AS CHARACTER                                 NO-UNDO.        

        oTabStripItem = CAST(sender, Telerik.WinControls.UI.TabStripItem) NO-ERROR.
        IF oTabStripItem NE ? THEN 
        DO:
            oToolwindow = CAST(oTabStripItem:TabPanel, Telerik.WinControls.UI.Docking.ToolWindow) NO-ERROR.

            IF VALID-OBJECT(oToolwindow) THEN DO:

                IF oToolwindow NE ? THEN 
                DO:

                    IF THIS-OBJECT:DockPrincipal:ActiveWindow NE oToolwindow THEN 
                    DO:                     
                        oActiveWindow = THIS-OBJECT:DockPrincipal:ActiveWindow.
                        cValeur = THIS-OBJECT:oongFamilleListe:GetToolwindowFurtifValeur( oToolwindow:NAME ).

                        InitialiseToolWindow( oToolwindow:NAME ).
                        CASE oToolwindow:Name:                        
                            WHEN gcToolWindowNomAide[1] THEN DO:
                                IF cValeur NE "?" AND cValeur NE 'OFF'
                                    THEN THIS-OBJECT:oongCodeAnalytiqueAide:Initialisation(cValeur).                                
                                    ELSE THIS-OBJECT:oongCodeAnalytiqueAide:Initialisation("").

                                oToolwindow:Enabled = ( cValeur NE "?" AND cValeur NE 'OFF').        
                            END.
                            WHEN gcToolWindowNomFiltre[1] THEN DO:   

                               glDockParCode= YES.            
                               oToolwindow:DockState=  Telerik.WinControls.UI.Docking.DockState:Docked.
                               glDockParCode= NO.

                                oToolwindow:Enabled = YES.      
                                gcNoeudCourant = 'C000'.
                                glFiltreVisibleFamille = YES.  
                                oongFamilleArborescence:SelectionNoeud(gcNoeudCourant).

                                IF glRafraichir THEN DO:
                                    SetEtatObjet("BtnSupprimer", NO).                                    
                                    //SetEtatObjet("BtnCopier", NO).
                                    //SetEtatObjet("BtnColler", NO).
                                    //SetEtatObjet("BtnCollerInserer", NO).
                                    oongFamilleListe:SetParamFiltreFamille ( glFiltreVisibleFamille ,gcNoeudCourant ).  
                                    oongFamilleListe:Rafraichir( ).

                                END.

                            END.                                               
                        END CASE.

                        THIS-OBJECT:DockPrincipal:ActiveWindow = oToolwindow.

                    END.
                    ELSE 
                    DO:
                        THIS-OBJECT:DockPrincipal:CloseAutoHidePopup().
                        oToolwindow:AutoHideTab:Click:UnSubscribe(THIS-OBJECT:TabStripItem_Click) NO-ERROR.
                        oToolwindow:AutoHideTab:Click:Subscribe(THIS-OBJECT:TabStripItem_Click) NO-ERROR.
                        IF THIS-OBJECT:DockPrincipal:ActiveWindow NE oActiveWindow THEN
                            THIS-OBJECT:DockPrincipal:ActiveWindow = oActiveWindow.
                    END.
                END.
            END.
            ELSE DO:
                MESSAGE 'ERR - TabStripItem_Click '
                VIEW-AS ALERT-BOX.
                RETURN.
            END. 
        END.             
      /*                   
      IF lFlgDocked THEN DO:                      
          //oToolwindow:AutoHideTab:Click:UnSubscribe(THIS-OBJECT:TabStripItem_Click) NO-ERROR.
                           glDockParCode = YES.
                           oToolwindow:DockState=  Telerik.WinControls.UI.Docking.DockState:Docked NO-ERROR.  
                           oToolwindow:Tag = "ON".
                           glDockParCode = NO.
                       //    oToolwindow:AutoHideTab:Click:Subscribe(THIS-OBJECT:TabStripItem_Click) NO-ERROR.
      END.  
      */              
        RETURN.
    END METHOD.

 

                                                                                                                                                                                                                                                                                                                                                                                                           
Laurent
Top achievements
Rank 1
Iron
Iron
 asked on 25 Sep 2025
0 answers
7 views

Hi;

I have a problem that I don't know how to solve.

I have a grid with several columns and rows containing different data types (text, numbers, images, etc.). Some of the cells are formatted using the RowFormatting event.

The grid also allows filtering by column.

I noticed that when my grid has many rows and is filtered, scrolling becomes very slow. If it's not filtered, it works perfectly with the same number of rows.

After investigating further, I realized that the FilterChanged event is being triggered multiple times when scrolling.

Furthermore, the value of MasterView.Rows.Count is different each time the event is executed. Sometimes it shows the filtered count, and other times it shows the unfiltered count.

This, in addition to the slowness, is a serious problem. For example, if I have a thread running that performs an action on filtered rows, I encounter issues with indexing and incorrect row selection.

I've attached a sample project. If you filter by a column and then scroll, the number of rows in the MasterView will be displayed in the text box.

Could you help me to solve this problem?

Thank you so much.

Regards

Cesar
Top achievements
Rank 1
 asked on 25 Sep 2025
1 answer
11 views

Hi,

What is the best approach to adding a simple button to some cells (not all) in a grid view text box column? My column is read only and contains html text. I should also add that the button should overlay any text that might appear underneath it... So cell cannot contain stacked or docked sub elements.

I simply want to be able to show and handle a button at the top right hand corner of the cell. This cell is only added based on a some other algorithm in my code.

 

I thought aboutusing ButtonRenderer in a CellPaint but the text and button outline appear in 2 different places, so it seems that ButtonRenderer does not consider e.Graphics suplied to cell paint!

Any ideas?
Cheers
Toby

Dinko | Tech Support Engineer
Telerik team
 answered on 22 Sep 2025
1 answer
17 views
I have some customized functionality I am using in a grid which depends on AddNewBoundRowBeforeEdit which works perfectly when the grid id bound to a flat list of my business objects. I have a requirement now to nest these records in the grid in hierarchy mode, where my same functionality will be used in the child template. It seems that this property is only available on a MasterGridViewTemplate and can not be set on GridViewTemplate instances that are added through a manual relation. Is there a technical reason why child templates can't have this flag and functionality? Is there any way to effectively get that behavior in child template where the bound data object gets created and attached to the row's DataBoundItem property before editing a new row?
Hristo
Telerik team
 answered on 12 Sep 2025
3 answers
34 views

Hi there,


I have written a component that resides within a column of a RadGridView. Based on the provided source code, I need the cell events like CellBeginEdit, CellEndEdit, and CellValueChanged in the RadGridView to be handled intelligently and reliably for columns of the AdvancedRadMultiColumnComboPlus type.

In other words, how can I get events like CellBeginEdit, CellEndEdit, and CellValueChanged to fire for columns of the AdvancedRadMultiColumnComboPlus type?

Please guide me.

Thank you.

Abbas
Top achievements
Rank 1
Iron
 answered on 22 Aug 2025
0 answers
18 views

I'm experiencing a bizarre issue with RadGridView.

I had a grid on a form that displays the results of a List collection. Pretty simple, but there was one column that refused to display the data. The column itself appeared but the data didn't display. I moved everything to another form and it worked fine.

Now I added another column to the grid and now that won't display data. The data is in the list collection, the FieldName property is correct  (I even copied it from the POCO to make sure.). Then  I added another column to the grid and it won't display at all at runtime even though it shows in the designer. Here is the code from the designer:

Any ideas on this one. I've never had a grid act like this before. Unfortunately I can't send you demo code s if I copy it to another form it will work.

Carl

           gvMemos.MasterTemplate.AllowAddNewRow = false;
           gvMemos.MasterTemplate.AllowColumnHeaderContextMenu = false;
           gvMemos.MasterTemplate.AllowDeleteRow = false;
           gvMemos.MasterTemplate.AllowEditRow = false;
           gvMemos.MasterTemplate.AllowRowHeaderContextMenu = false;
           gvMemos.MasterTemplate.AllowRowResize = false;
           gvMemos.MasterTemplate.AllowSearchRow = true;
           gvMemos.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
           gridViewTextBoxColumn1.EnableExpressionEditor = false;
           gridViewTextBoxColumn1.FieldName = "MemoOptionsDescription";
           gridViewTextBoxColumn1.HeaderText = "column1";
           gridViewTextBoxColumn1.Name = "column1";
           gridViewTextBoxColumn1.ReadOnly = true;
           gridViewTextBoxColumn1.Width = 284;
           gridViewTextBoxColumn2.DataType = typeof(DateTime);
           gridViewTextBoxColumn2.EnableExpressionEditor = false;
           gridViewTextBoxColumn2.FieldName = "DateTimeStamp";
           gridViewTextBoxColumn2.HeaderText = "Date/Time";
           gridViewTextBoxColumn2.Name = "Date";
           gridViewTextBoxColumn2.Width = 284;
           gridViewTextBoxColumn3.EnableExpressionEditor = false;
           gridViewTextBoxColumn3.FieldName = "MemoText2";
           gridViewTextBoxColumn3.HeaderText = "Memo Description";
           gridViewTextBoxColumn3.Name = "Memo Description";
           gridViewTextBoxColumn3.ReadOnly = true;
           gridViewTextBoxColumn3.Width = 284;
           gridViewTextBoxColumn4.EnableExpressionEditor = false;
           gridViewTextBoxColumn4.FieldName = "AssignedTo";
           gridViewTextBoxColumn4.HeaderText = "Assigned To";
           gridViewTextBoxColumn4.Name = "Assigned To";
           gridViewTextBoxColumn4.ReadOnly = true;
           gridViewTextBoxColumn4.Width = 284;
           gridViewTextBoxColumn5.FieldName = "MemoTypeDescription";
           gridViewTextBoxColumn5.HeaderText = "Type";
           gridViewTextBoxColumn5.Name = "Memo Type";
           gridViewTextBoxColumn5.Width = 284;
           gridViewTextBoxColumn6.EnableExpressionEditor = false;
           gridViewTextBoxColumn6.FieldName = "MemoOptionsDescription";
           gridViewTextBoxColumn6.HeaderText = "Options";
           gridViewTextBoxColumn6.Name = "Options";
           gridViewTextBoxColumn6.ReadOnly = true;
           gridViewTextBoxColumn6.Width = 284;
           gridViewTextBoxColumn7.EnableExpressionEditor = false;
           gridViewTextBoxColumn7.FieldName = "OperID";
           gridViewTextBoxColumn7.HeaderText = "User";
           gridViewTextBoxColumn7.Name = "User";
           gridViewTextBoxColumn7.ReadOnly = true;
           gridViewTextBoxColumn7.Width = 282;
           gvMemos.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn1, gridViewTextBoxColumn2, gridViewTextBoxColumn3, gridViewTextBoxColumn4, gridViewTextBoxColumn5, gridViewTextBoxColumn6, gridViewTextBoxColumn7 });
           gvMemos.MasterTemplate.EnableAlternatingRowColor = true;
           gvMemos.MasterTemplate.EnablePaging = true;
           gvMemos.MasterTemplate.ShowGroupedColumns = true;
           gvMemos.MasterTemplate.ViewDefinition = tableViewDefinition1;
           gvMemos.Name = "gvMemos";
           gvMemos.Size = new System.Drawing.Size(1767, 229);
           gvMemos.TabIndex = 4;
           gvMemos.CellFormatting += OnCellFormattingMemos;
           gvMemos.ViewCellFormatting += OnViewCellFormattingMemos;
           gvMemos.ContextMenuOpening += OnContextMenuOpeningMemos;
           gvMemos.DoubleClick += gvMemos_DoubleClick;

 

Carl
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 21 Aug 2025
1 answer
24 views

Hello!
I had a chance to notice some strange behavior with setting CurrentColumn.

For instance I would like to change focused column, in case someone tries to focus on the wrong column. 

Let's review 2 cases:
Case #1 (without an issue):

1) User clicks on any cell (different from the current, for instance user cicked on column 2).
2) Grid tries to set Cell from column 2 as current.
3) RadGridView.CurrentCellChanged event is being triggered.
4) Method subscribed on RadGridView.CurrentCellChanged event sets CurrentColumn (for instance it sets 3 if Current one is not 3).
5) Grid sets Cell from third column as current.
6) Nothing is looped.

Case #2 (with issue):
1) Some Method from code sets CurrentColumn as 2 (different from the current one)
2) Grid tries to set Cell from column 2 as current
3) RadGridView.CurrentCellChanged event is being triggered.
4) Method subscribed on RadGridView.CurrentCellChanged event sets CurrentColumn (for instance it sets 3 if Current one is not 3).
5) Grid sets Cell from third column as current.
6) Loop has formed
6.1) Every RadGridView.CurrentCellChanged call it changes the input params:
call 1:
e.CurrentCell = (cell from column 2)
e.NewCell = (cell from column 3)
call 2:
e.CurrentCell = (cell from column 3)
e.NewCell = (cell from column 2)
call 3:
e.CurrentCell = (cell from column 2)
e.NewCell = (cell from column 3)
...

Code:

public partial class Form1 : Form
{
    private BindingSource bindingSource;
    public Form1()
    {
        InitializeComponent();
        InitializeGrid();

        radGridView1.CurrentCellChanged += RadGridView1_CurrentCellChanged;
    }

    private void RadGridView1_CurrentCellChanged(object sender, CurrentCellChangedEventArgs e)
    {
        if (radGridView1.CurrentColumn != radGridView1.Columns[2])
            radGridView1.CurrentColumn = radGridView1.Columns[2];
    }

    private void InitializeGrid()
    {
        bindingSource = new BindingSource();

        DataTable table = new DataTable();
        table.Columns.Add("Id", typeof(int));
        table.Columns.Add("Name", typeof(string));
        table.Columns.Add("Age", typeof(int));

        table.Rows.Add(1, "Alice", 30);
        table.Rows.Add(2, "Bob", 25);
        bindingSource.DataSource = table;
        radGridView1.DataSource = bindingSource;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        radGridView1.CurrentColumn = radGridView1.Columns[1];
    }
}
Telerik version: 2025.2.520.48

Is the any restriction of using CurrentCellChanged event?
Is there any other way we can provide such functionality?

Thank You!
Nadya | Tech Support Engineer
Telerik team
 answered on 19 Aug 2025
1 answer
13 views

Hello,
I want to use the following commands:
F9 and Shift+F9.
F9: OK.
Shift+F9: no response?
Do you have a solution?

Here is my code.

METHOD PRIVATE VOID GridFamille_KeyDown( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.KeyEventArgs ):

IF e:Shift THEN DO:
            CASE e:KEYCODE :
                WHEN System.Windows.Forms.Keys:F9 THEN DO:
                             MESSAGE 'SHITF + F9' e:KEYCODE:ToString()    VIEW-AS ALERT-BOX.
                END.                   
            END CASE.
        END. 
        ELSE DO: 
            CASE e:KEYCODE:   

                WHEN System.Windows.Forms.Keys:F9 THEN DO:

                      MESSAGE 'F9' e:KEYCODE:ToString()    VIEW-AS ALERT-BOX.

                END.                   
            END CASE.
        END.                                 
Nadya | Tech Support Engineer
Telerik team
 answered on 18 Aug 2025
2 answers
21 views

Hello,

I want to add drawstring (watermark) to datagridview for some help information (for example: "double click to add new item" etc)

Can you help me?

 

 

Radek
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 11 Aug 2025
2 answers
18 views

Hi,

in datagridview I have set AllowRowReorder to True and works well.

But I want to copy row (not move) when I hold Ctrl key, it is possible?

Radek
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 11 Aug 2025
Narrow your results
Selected tags
Tags
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
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
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
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
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
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?