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

[Solved] if condition in DetailView ClientTemplate

2 Answers 41 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.
Madan Mohan Venkat
Top achievements
Rank 1
Madan Mohan Venkat asked on 23 Jan 2012, 11:10 AM
Hi,
I want to write the if condition in DetailView ClientTemplate

I have bolded the text  where to write the if condition

Here is my grid
<%Html.Telerik().Grid<eButtonPaymentDetailViewModel>()
 
                 .Name("Grid")
                 .Columns(column =>
                 {
                    
  column.Bound(item => item.eButtonId).Title("ButtonId").Width(50);

                     column.Bound(item => item.PaymentType).Title(
"Type");                      column.Bound(item => item.Status);                  })                      
.DetailView(detailView => detailView.ClientTemplate(
                          //Here i want to write the if condoition based on ButtonId some thing like if(ButtonId == "1"){

                          "<ul>" +                               "<li>Name On Card: <#= NameOnCard #></li>" +                               "<li>Card Number: <#= CardNumber #></li>" +                               "<li>Expiration Date: <#= ExpirationDate #></li>" +                               "<li>Transaction Amount: <#= Amount #></li>" +                           "</ul>"                              ))
                 .DataBinding(binding => binding.Ajax().Select("EbuttonPayments""Dashboard"))                  .Pageable(page => page.PageSize(20))                  .Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn))                  .Filterable()                  .Groupable()                  .Render();                 %>

2 Answers, 1 is accepted

Sort by
0
teddy
Top achievements
Rank 1
answered on 13 Apr 2012, 03:15 AM
Hi 

Any reply from the expert? I'm looking for this kind of answer too.
Thanks in advance for your help.
0
teddy
Top achievements
Rank 1
answered on 13 Apr 2012, 03:59 AM
Hi there,

I just use JQuery to check the condition and then hide it or show it after the DataBound event occurred.
Hope it help.

Cheers
Tags
Grid
Asked by
Madan Mohan Venkat
Top achievements
Rank 1
Answers by
teddy
Top achievements
Rank 1
Share this question
or