Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
How do I take off pencil icon from the grid rows.
posted

Hi,

How can i remove pencil icon form the grid rows on cell vaclue change.

i have some  requiremnet to change the grid cell value on enter mode. when i done this i am gettting the pencil symbol on the grid row staring. how can i revome this.

  Private Sub grdSample_AfterEnterEditMode(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdDailyPricesFactors.AfterEnterEditMode

       

        DirectCast(DirectCast(grdSample.ActiveCell, Infragistics.Win.UltraWinGrid.UltraGridCell).EditorResolved, Infragistics.Win.EmbeddableEditorBase).Value = grdSample.ActiveCell.OriginalValue

      grdSample.UpdateData()

                    End Sub

 

 Even after giving the  grdSample.UpdateData() still i am getting the pencil symbol .  Please help me .

Thanks

Subbu.

 

 

Thanks,

Subbu.

  • 918
    Suggested Answer
    posted

    If you want it off all the time them use this draw filter.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Imports

     

     

    Infragistics.Win

    Imports

     

     

    Infragistics.Win.UltraWinGrid

    Public

     

     

    Class

    clsRemovePencil

     

     

    Implements

    IUIElementDrawFilter

     

     

     

    Public Function GetPhasesToFilter(ByRef drawParams As

    _

    Infragistics.Win.UIElementDrawParams)

     

    As

    Infragistics.Win.DrawPhase _

     

     

    Implements

    Infragistics.Win.IUIElementDrawFilter.GetPhasesToFilter

     

     

    ' Drawing RowSelector Call DrawElement Before the Image is Drawn

     

     

    If TypeOf drawParams.Element Is

    _

    Infragistics.Win.UltraWinGrid.RowSelectorUIElement

     

    Then

     

     

    Return

    DrawPhase.BeforeDrawImage

     

     

    Else

     

     

    Return

    DrawPhase.None

     

     

    End

    If

     

     

    End

    Function

     

     

     

    Public Function DrawElement(ByVal drawPhase As

    _

    Infragistics.Win.DrawPhase,

     

    ByRef drawParams As

    _

    Infragistics.Win.UIElementDrawParams)

     

    As Boolean Implements

    _

    Infragistics.Win.IUIElementDrawFilter.DrawElement

     

     

    ' If the image isn't drawn yet, and the UIElement is a RowSelector

     

     

    If drawPhase = drawPhase.BeforeDrawImage And TypeOf

    _

    drawParams.Element

     

    Is

    _

    Infragistics.Win.UltraWinGrid.RowSelectorUIElement

     

    Then

     

     

    ' Get a handle of the row that is being drawn

     

     

    Dim row As

    UltraGridRow = _

     

     

    CType(drawParams.Element.GetContext(Type.GetType("UltraGridRow"

    )), _

    UltraGridRow)

     

     

    'Debug.Print(row.Cells("txtVendorName").Value)

     

     

    ' If the row being draw is the active row

     

     

    If row.IsActiveRow

    Then

     

     

    ' Draw an arrow

    drawParams.DrawArrowIndicator(ScrollButton.Right, _

    drawParams.Element.Rect, _

    UIElementButtonState.Indeterminate)

     

     

    ' Return true, to stop any other image from being drawn

     

     

    Return

    True

     

     

    End

    If

     

     

    End

    If

     

     

    ' Else return false, to draw as normal or true to stop pencil

     

     

    'Return False

     

     

    Return

    True

     

     

    End

    Function

     

    End

     

     

    Class

  • 469350
    Suggested Answer
    Offline posted

    Hi Subbu,

    My guess is that the UpdateData call cannot be honored while the cell is in the process of entering edit mode. If that's the case, then you might be able to work around it by calling this method using a BeginInvoke, rather than directly inside the event.

    If that does not work, then I don't see any way to do this just for this one situation. In other words, I don't see a way to turn off the pencil only when a cell enters edit mode. You can turn off the images in the RowSelectors entirely by setting RowSelectorAppearance.ImageAlpha to Transparent, of course.