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.
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
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
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.
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;
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];
}
}
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.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?
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?