PC Review


Reply
Thread Tools Rate Thread

How to diable edit mode in the datagrid

 
 
=?Utf-8?B?TWFyZHk=?=
Guest
Posts: n/a
 
      17th Aug 2005
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
 
Reply With Quote
 
 
 
 
Grant Merwitz
Guest
Posts: n/a
 
      17th Aug 2005
One way to do it, would be on the ItemDataBound event, where you could
disable the edit button as you said.

Not sure about doing it for a whole grid at once though.



"Mardy" <(E-Mail Removed)> wrote in message
news:EB7161D6-CF41-4DDF-84FA-(E-Mail Removed)...
>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



 
Reply With Quote
 
=?Utf-8?B?TWFyZHk=?=
Guest
Posts: n/a
 
      17th Aug 2005
I found this solution and it works pretty well..just thought I'd pass it along

<aspataGrid 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>
</aspataGrid>


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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set the datagrid in edit mode David Sagenaut Microsoft ASP .NET 1 16th Oct 2005 10:13 PM
DataGrid edit mode JezB Microsoft ASP .NET 1 22nd Jun 2005 12:13 PM
How do I know when I am in edit mode on a datagrid? =?Utf-8?B?QmlsbEc=?= Microsoft Dot NET 1 5th May 2005 08:23 AM
CheckBoxList in DataGrid Edit-Mode CodeCowboy Microsoft ASP .NET 0 2nd Mar 2005 05:54 PM
Datagrid Edit Mode Alexandre Martins Microsoft ASP .NET 0 15th Oct 2003 10:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.