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
20
Disable delete button in some rows
posted

Hello All,

We are using Ultrawebgrid in our page and are using the delete column to delete each record.

Now I have a new requirement that some of the rows should not be possible to delete and so the delete button should be disabled indicating the user that these rows cannot be deleted.

Please let me know how to do this.

Thanks,

Param 

 

 

 

Parents
No Data
Reply
  • 8680
    posted

    Here's a snippet I use to change the text displayed in a button.  You can use similar logic to hide the button.

    Private Sub ApplicationListUltraWebGrid_InitializeRow(ByVal sender As Object, _
       
    ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) _
       
    Handles ApplicationListUltraWebGrid.InitializeRow

        Dim lButtonCell As Infragistics.WebUI.UltraWebGrid.UltraGridCell
       
    Dim lIsEditable As Boolean

        Try
           
    lButtonCell = e.Row.Cells.FromKey("BUTTON_COLUMN")
            lIsEditable =
    CBool(e.Row.Cells.FromKey("IS_EDITABLE").Value)

            If lIsEditable Then

                lButtonCell.Text = WEBGRID_EDIT_BUTTON_TEXT

            Else

                lButtonCell.Text = WEBGRID_VIEW_BUTTON_TEXT

            End If

        Catch ex As Exception
            ReportException(<WhatEver>
    )
       
    End Try

    End Sub

Children