Hi
We have an ASPxGridView that has the "Enable Editing", "Enable Inserting", and "Enable Deleting" properties set to TRUE at design time. During the initialization of the webpage we sometimes need to disallow editing/inserting/deleting. How can we achieve this using VB script?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello,
You can do the following:
ASPX:
<dxe:ASPxCheckBox ID="ASPxCheckBox1" runat="server">
<ClientSideEvents CheckedChanged="function(s, e) {
grid.PerformCallback(s.GetChecked());
}" />
</dxe:ASPxCheckBox>
C#:
protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
((GridViewCommandColumn)ASPxGridView1.Columns["CommandColumn"]).EditButton.Visible = Convert.ToBoolean(e.Parameters);
}
Regards,
Nathan
I don't think you understood my question, so let me try to explain a bit more. I have attached a picture of the "ASPxGridView Tasks" pane where we have checked the "Enable Editing", "Enable Inserting", and "Enable Deleting". We are looking for a control property like "ASPxGridView1.EnableEditing" that will allow us to modify those ASPxGridView properties, but we couldn't find them. As I explained in our my previous message we need to invoke this to allow/disallow users from inserting/editing/updating records.
Hi,
There are no such properties. When you turn on the 'Enable Editing' task, a command column is automatically created (if needed), and its EditButton.Visible property is set to true. The same occurs when you enable "Enable Inserting", and "Enable Deleting". To prevent end-users from inserting/editing/updating records at runtime, you need to hide required command buttons.
Thanks,
Nathan
See Also:
Option for AllowEdit, AllowDelete, AllowInsert