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
hellbinder said:But do you know a way to make it look disabled .. ?
One thing you can do is style the buttons differently, and then handle the ClickCellButton event on the server side. (And for all I know, there's a client-side equivalent.)
To illustrate, here is the handler I use in conjunction with the above snippet:
Private Sub FundingSourceListUltraWebGrid_ClickCellButton( _ ByVal sender As Object, _ ByVal e As Infragistics.WebUI.UltraWebGrid.CellEventArgs) _ Handles FundingSourceListUltraWebGrid.ClickCellButton
Select Case e.Cell.Text Case WEBGRID_EDIT_BUTTON_TEXT Me.PageModeChange("FundingSourceEdit") Case WEBGRID_VIEW_BUTTON_TEXT Me.PageModeChange("FundingSourceView") End Select
End Sub
Ok.. you talk about hiding the button. But do you know a way to make it look disabled so you wont be able to edit? In my case I all th buttons to be visible but not be able to be clicked ( disable them). Anyone know how to do this?
Here's a snippet I use to change the text displayed in a button. You can use similar logic to hide the button.
Dim lButtonCell As Infragistics.WebUI.UltraWebGrid.UltraGridCell Dim lIsEditable As Boolean
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