RE: How to diable edit mode in the datagrid
- From: "Mardy" <Mardy@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 10:10:01 -0700
I found this solution and it works pretty well..just thought I'd pass it along
<asp:DataGrid id="DataGrid1" runat="server">
<Columns>
<asp:TemplateColumn HeaderText ="Product Information" >
<ItemTemplate >
<asp:Button CommandName="Status" Text ="Status" Runat =server
Enabled
=<%#CheckStatus(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,"AuditStatusID")))%> ID="Button1" >
</asp:Button>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
VB.NET
Protected Function CheckStatus(ByVal StatusID As Boolean) As Boolean
If StatusID = 1 or StatusID = 2 Then
Return True
Else
Return False
End If
End Function
"Mardy" wrote:
> I have a datagrid that allows users to eidt/update detail records. The grid
> shows detail records for a master record. Once the status of the master
> record changes to "closed", I need to ensure that the users can't update the
> detail records. The easiest way to do this may be to disable the edit button
> on the detail grid.
>
> How can I dynamically disable the edit mode for the entire datagrid based on
> status of the master record or is there a better alternative?
>
> Thank you
.
- References:
- How to diable edit mode in the datagrid
- From: Mardy
- How to diable edit mode in the datagrid
- Prev by Date: Re: ASP.NET Javascript Modal Popup won't fire Page Load on second go
- Next by Date: Re: ASP.NET Javascript Modal Popup won't fire Page Load on second
- Previous by thread: Re: How to diable edit mode in the datagrid
- Next by thread: Textarea to sql 2000 text datatype
- Index(es):
Relevant Pages
|