The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I currently use the following code to make certain rows readonly. My problem is that the richtext cell type still is editable. Is there a way to make it readonly? Thanks
Private Sub grdNotes_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs) Handles grdNotes.PrepareViewStyleInfo
Dim row As DataRow
Dim grid As GridDataBoundGrid = sender
Dim r As Integer = 1
For Each row In Me.DsAgencyReg.Notes.Rows
If Not row.RowState = DataRowState.Deleted Then
If Not IsDBNull(row("TypeID")) AndAlso (row("TypeID") = 1 Or row("TypeID") = 2) Then
If e.RowIndex = r Then
e.Style.ReadOnly = True
e.Style.BackColor = System.Drawing.SystemColors.Control
End If
End If
If Not IsDBNull(row("Active")) AndAlso row("Active") = True Then
If e.RowIndex = r Then
e.Style.BackColor = Color.Yellow
End If
End If
r += 1
End If
Next
End Sub
ADAdministrator Syncfusion Team August 31, 2005 10:24 PM UTC
In general, you should use Model.QueryCellInfo to set ReadOnly propertiues instead of PrepareViewStyleInfo. Here is a KB link.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=95
But for the dropdown CellType = "RichText", event if you set style.ReadOnly = true for the cell, you can drop it, and it looks like you can try to edit the dropdown, it is just that the changed value will not save. It woul be more friendly not to drop the cell. To do this, you could handle the CurrentCellShowingDropdown event, and if grid.CurrentCell.RowIndex/ColIndex point to the cell you do not want to edit, set e.cancel = true. This will prevent the cell from dropping.