We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

richtext dropdown

Thread ID:





34053 Aug 31,2005 09:43 PM UTC Aug 31,2005 10:24 PM UTC WinForms 1
Tags: GridControl
Asked On August 31, 2005 09:43 PM UTC

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

Administrator [Syncfusion]
Replied On 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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon