| Private Sub Grid_CellFormatting(ByVal sender As Object, _ |
| ByVal e As CellFormattingEventArgs) _ |
| Handles grid.CellFormatting |
| Dim f As New System.Drawing.Font("Arial", My.Settings.Grid_FontSize, _ |
| System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) |
| e.CellElement.Font = f |
| End Sub |
| Public Property FontSize() As Single Implements IReportGridView.FontSize |
| Get |
| Return My.Settings.Grid_FontSize |
| End Get |
| Set(ByVal value As Single) |
| My.Settings.Grid_FontSize = value |
| My.Settings.Save() |
| My.Settings.Reload() |
| End Set |
| End Property |
Hi
I am using an example you provided in a previous reply to implement drag and drop from a radgridview. When using the mouse down event to pass row information into an array if the row being dragged is being edited the application crashes completely. How do I handle this (test for the row edit state) to prevent the crash?
Regards
Joe
Private Sub RadGridView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles SubContractgrd.MouseDown
Try
downpoint = e.Location
rowtodrag = GetRowAtPoint(Me.SubContractgrd, e.Location)
ContArray(0, 0) = (rowtodrag.Cells(0).Value)
ContArray(0, 1) = (rowtodrag.Cells(1).Value)
ContArray(0, 2) = (rowtodrag.Cells(2).Value)
If Not IsNothing(rowtodrag.Cells("Text").Value) Then
ContArray(0, 2) = Replace(StrConv(rowtodrag.Cells("Text").Value, VbStrConv.Uppercase), " ", "")
Else
ContArray(0, 2) = (rowtodrag.Cells(1).Value)
End If
If Not IsNothing(rowtodrag.Cells("D").Value) Then
ContArray(0, 3) = "SD"
End If
If Not IsNothing(rowtodrag.Cells("V").Value) Then
If Not IsNothing(ContArray(0, 3)) Then
ContArray(0, 3) = "SDV"
Else
ContArray(0, 3) = "SD"
End
End If
End If
End If
Catch ex As Exception
If Err.Number = 91 Then
Err.Clear()
Exit Sub
Else
MsgBox(Err.Description & Err.Number)
End If
End Try
End Sub