This is a migrated thread and some comments may be shown as answers.

How to Disable a button in the grid

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Helmi
Top achievements
Rank 1
Helmi asked on 09 May 2012, 12:55 PM
Hello every one,
I want to know how i can disable a custom buttom in my grid.
columns.Command(commands =>
                        {
                            commands.Edit();
                            commands.Custom("ValidApproved")
                                        .Text("Approve Customer")
                                        .DataRouteValues(route => route.Add(o => o.DunsCustomerId).RouteKey("id"))
                                        .HtmlAttributes(new Dictionary<string, object> { { "class", "button-state" } });
         });
Best regards,
Helmi

1 Answer, 1 is accepted

Sort by
0
Arash
Top achievements
Rank 1
answered on 07 Nov 2012, 09:11 AM
Hi,

you can add t-state-disabled class to your custom command. But, it does not disable it's action so you should handle it manually.

commands.Custom("DeleteBtn")
                    .ButtonType(GridButtonType.ImageAndText)
                    .HtmlAttributes(new { id = "DeleteBtn",@class="t-state-disabled" })
                    .Text("Delete")
                    .Action("DeleteBtnSelected", "PersonnelManagement")
                    .DataRouteValues(route => route.Add(m => m.PersonCode).RouteKey("personCode"))
                    .Ajax(true);
Tags
Grid
Asked by
Helmi
Top achievements
Rank 1
Answers by
Arash
Top achievements
Rank 1
Share this question
or