Good morning
in a RadGridView in the event of a button I delete a row from the database and I would like to reposition and select the row after the deleted one. The problem is that I can't figure out how to get the id of the row after the deleted one. To complicate things I add that the rows are filtered by the filtering row of the RadGridView. I attach code to make it clearer.
I think the problem is that to delete the row I take the index from the first cell of the row. But I don't understand how to take the index of the row of the radgridview
Fabrizio
Private Sub btnEliminaLotto_Click(sender As Object, e As EventArgs) Handles btnEliminaLotto.Click
'Trova id selezionato con ChildRows
propIdLottoMateriale = gridLottoMateriale.ChildRows(gridLottoMateriale.CurrentRow.Index).Cells(0).Value
Dim result As DialogResult
If Not (propIdLottoMateriale = Nothing) Then
If gridLottoMateriale.SelectedRows.Count > 0 Then
result = MessageBox.Show(" Sei sicuro di voler eliminare il Test Report N° : " & propIdLottoMateriale & " ? ", "Elimina test Report in Database", MessageBoxButtons.OKCancel)
If result = DialogResult.Cancel Then
Exit Sub
End If
If result = Windows.Forms.DialogResult.OK Then
EliminaLottoMateriale(propIdLottoMateriale)
'Controllo se il filtro esiste ancora
If (gridLottoMateriale.IsInEditMode) Then
gridLottoMateriale.EndEdit()
End If
'Toglie il filtro
gridLottoMateriale.FilterDescriptors.Clear()
'PopolaGridLotto()
'Aggiorna il dataset binding con la grid
TblNumeroLottoMaterialeTableAdapter.Fill(DsNumeroLottoMateriale1.tblNumeroLottoMateriale)
'Riposiziona la griglia sulla riga dopo quella eliminata
gridLottoMateriale.CurrentRow = gridLottoMateriale.ChildRows(indexRigaPerAggiorna + 1)
gridLottoMateriale.CurrentRow.IsSelected = True
Else
Exit Sub
End If
Else
MessageBox.Show("Seleziona una riga !!")
End If
Else
End If
End Sub
Public Function EliminaLottoMateriale(ByVal id As Integer)
Dim deleteCommand As DbCommand = Nothing
Dim rowsAffected As Integer
Try
deleteCommand = _db.GetStoredProcCommand("spDeleteQueryLotto")
_db.AddInParameter(deleteCommand, "id", DbType.Int32, id)
rowsAffected = _db.ExecuteNonQuery(deleteCommand)
Catch ex As Exception
MessageBox.Show("Errore EliminaLottoMateriale : " & ex.Message)
End Try
Return rowsAffected
End Function
Hi,
I have just updated to the latest version of UI WinForms, and can no longer compiler. RbgColor and RbgColors can no longer be used and ZipArchive.Read no longer exists.
No issues were reported when upgrading my application.
Have I done something wrong?
Kind regards
Toby
I'd like to do something when the user double-clicks on a gridview column header without running the click handler and without setting the sort to that column.
Can I? How?

I am using the VisualStudio2022Light theme. I am not able to change the SignStyle of the Expander in a RadGridView.
Here it is the code.
This is the result. Both signs are there.

Hello
I am trying to fix some text when it is being inserted in a richtexteditor but each time I move the caret position to document end the font changes back to default. This is my code:
if (txtCorrections.Text[txtCorrections.Text.Length - 1] == ')' && txtCorrections.Text[txtCorrections.Text.Length - 2] == ' ')
{
txtCorrections.Text = txtCorrections.Text.Remove(txtCorrections.Text.Length - 2, 1);
txtCorrections.Document.CaretPosition.MoveToDocumentEnd();
}
I use this code in a textChanged.
Thank you for help.

Hello,
We are using radGridView in a winforms application. The last 4 columns visible in the screen shot have the property "IsVisible" set to false. When opening the window for the first time ,the list is empty and we are launching some synchronisation processes in the background to charge the information to display. However, the 4 last columns show up in the list and are filled with information as soon as the synchronization has finished. When closing and reopening the window, the columns disappear and everything is correct. What could be the reason for them to show up even though their visibility is set to false?
.NET version: 6
Telerik version: 2024.3.806
Thank you in advance!

Hello,
I am new to WinForms.
Is there a possibility to disable the Arrow for the RadDropDownList ?
When I set the component to readonly, I can still choose a new value via the arrow.
But then the value is never saved because it is read-only.
And wich property do I have to set for this?

I have a question about the RadGridView
I want to retrieve the new value of a cell that I have changed.
When I change a cell from value "AB" to "CD", how can I then get "CD" ?
Should I use the RowsChanged or CellValueChanged event?
In the RowsChanged, you have a property e:NewItems, but I don't know how you then can get value "CD" from e:NewItems.
Hi!
I have MdiParent Form which hosts multiple MdiChids. I would like to determine why the MidParent is being closed withing the MdiChild-ClosingEvent. The CloseReason in the MdiChild-ClosingEvent only says "MdiFormClosing". But I dont know if the MdiParent is closed due to user operation (eg. pressing X in upper right corner) or Windows is being shutdown.
How can I solve that?
background:
The MdiChild_FormClosing-Event either asks if this or all childs shall be closed. If all are confirmed, the static variable of "bool _ForceClosing" prevents the next child from asking again. So good so far. I would like to skip this confirmation stuff in case, windows is being shutdown. But this CloseReason in MdiChild only has UserClosing or MdiFormClosing.
System::Void
Form_Client::Form_Client_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
{
//-----------------------------------------------------------------------------------------------------------------------------
try
{
//-- mdi closing already confirmed --------------------------------------------------------------------
if (this->_ForceClosing == true)
{
e->Cancel = false;
return;
}
//-- windows shutdown ---------------------------------------------------------------------------------
else if (e->CloseReason == System::Windows::Forms::CloseReason::WindowsShutDown) // not working
{
this->_ForceClosing = true;
}
//-- user single closing (ask if connected) -----------------------------------------------------------
else if (e->CloseReason == System::Windows::Forms::CloseReason::UserClosing)
{
// ask if this child shall be closed
if (Result != System::Windows::Forms::DialogResult::OK)
{
e->Cancel = true;
return;
}
}
//-- mdi parent closing initiated ---------------------------------------------------------------------
else if (e->CloseReason == System::Windows::Forms::CloseReason::MdiFormClosing)
{
// ask if all childs shall be closed
if (Result != System::Windows::Forms::DialogResult::Yes)
{
e->Cancel = true;
return;
}
//-------------------------------------------------------------------------------
this->_ForceClosing = true;
}
//-- unknown reason -> just close all -----------------------------------------------------------------
else
{
this->_ForceClosing = true;
}
}
//----------------------------------------------------------------------------------------------------------------------------
catch (System::Exception^ ex)
{
System::Windows::Forms::MessageBox::Show( ex->ToString() );
}
}