Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • 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?

                                0

                                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

                                0

                                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.

                                0

                                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

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners