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

[Solved] Different Custom Commands

1 Answer 142 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.
Denisas
Top achievements
Rank 1
Denisas asked on 03 Jul 2012, 05:44 AM
Dear Sirs,

Is it possible (like in your example) 
.Columns(columns => columns
   {
      columns.Command(commands => 
         commands
            .Custom("viewDetails")
            .Text("Customer Details")
            .DataRouteValues(route => route.Add(o => o.OrderID)
               .RouteKey("orderID"))
            .Ajax(true)
            .Action("ViewDetails", "Grid")    
            ));
   }
)
in the same column (dependign on cell value) to have different commands (with different text, icons and images). Exactly what I want is to make column with buttons, depending on value in Column 1 (IsLockedOut) when cell value == true, i need a custom command with custom HTML format .Text("Ubnlock")  .Action("UnblockUser", "Users") 
when cell value == false, i need a custom command with custom HTML format
	.Text("Bnlock") 
	.Action("BblockUser", "Users") 

Please advise is it possibe and how coud I make grid this way? Thank you in advance.

1 Answer, 1 is accepted

Sort by
0
Ankit
Top achievements
Rank 1
answered on 28 Aug 2012, 11:04 PM
I am looking for the same. Basically I want to set the Custom() attribute based on the value of other column.

For example:

Row 1:
Column1: Peter
Column2: Single
Column3: 34

Custom Command: Single

Row 2:
Column1: Jason
Column2: Married
Column3: 38

Custom Command: Married

Tags
Grid
Asked by
Denisas
Top achievements
Rank 1
Answers by
Ankit
Top achievements
Rank 1
Share this question
or