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.
Unfortunately, activation email could not send to your email. Please try again.

richtext dropdown

Thread ID:

Created:

Updated:

Platform:

Replies:

34053 Aug 31,2005 05:43 PM Aug 31,2005 06:24 PM Windows Forms 1
loading
Tags: GridControl
Greg
Asked On August 31, 2005 05:43 PM

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 06:24 PM

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.

CONFIRMATION

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.

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.

;