Current filter:
                                You should refresh the page.
                                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.

                                aspxgridview1.jpg
                                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

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.