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

[Solved] Hide 'add new record' from detail grid

1 Answer 160 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.
Samantha
Top achievements
Rank 1
Samantha asked on 24 Jul 2012, 06:52 AM
I have a master / detail grid, I want to hide the 'Add new record' based when some condition occurs on master column
(say master column [Remarks] == 'done' etc).

I would also like to disable the edit and save on the detail grid if the Insert button is disabled

code in my detail grid

...//omitted the code 
 .DetailView(details => details.ClientTemplate(
                Html.Telerik().Grid<PurchaseOrderDetail>()
                .Name("DetailsPO_<#= PurchaseOrderID #>")
                .ToolBar(tb => {                        
                        //if ("") tb.Insert(); 
                        tb.Insert();<<<<<<<<<<<<<<< Disable this depends on the master column value             
                        })
.
.
.
if (1 == 1) <<<<<<<<<<<<<<Condition HERE
                            {
                                columns.Command(command =>
                                {
                                    command.Edit().ButtonType(GridButtonType.Image);
                                    command.Delete().ButtonType(GridButtonType.Image);
                                }).Title("Commands").Width(100);
                            }

Thanks

1 Answer, 1 is accepted

Sort by
0
Samantha
Top achievements
Rank 1
answered on 25 Jul 2012, 03:07 PM
anyone?
Tags
Grid
Asked by
Samantha
Top achievements
Rank 1
Answers by
Samantha
Top achievements
Rank 1
Share this question
or