We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Adding a button in dynamic templated column (depending on each row) lost class properties

Hi
I was checking the forums. I want to implement an additional  custom column with some detailed buttons. 
I found this post 
and the results worked fine. 

I added one specific class to modify the button and added an image. 

<style>
   .buttonDocumentDetails{
    background: url(../../Images/grid_DocumentDetails/options/documentDetails_20px.png) no-repeat;
    cursor:pointer;
    margin:2px 2px 2px 2px;
    min-width:22px;
    min-height:22px;
    /*border: none;*/
    }
</style>
and added that class to the additional header
 col.HeaderText("Options")
                        .Template("<input title='document details.' type='button' class='buttonDocumentDetails' value ='&nbsp'></input><input title='linked                  documents.' type='button' class='buttonDocumentDetails' value ='&nbsp'></input><input title='document history.' type='button' class='buttonDocumentDetails' value ='&nbsp'></input><input title=document security details.' type='button' class='buttonDocumentDetails' value ='&nbsp'></input>")
                        .TextAlign(TextAlign.Left).Width(120).Add();

The buttons work fine and load the image only if the 
eventClientSideEvents(eve => { eve.TemplateRefresh("RefreshTemplate"); })
is not added to the grid. However, I cannot used in that way because I lost the grid details in the selection row.

How can I have both, at the same time the custom class and the eventclient->Refresh ?

I have attached an example solution, to see the issue comment and uncomment line 44 in GridFeatures.cshtml. Also, I added some images to explain my point.

Kind regards, 

Juan Acosta





Attachment: SyncfusionMvcApplication14_ab68856.zip

4 Replies

JA Juan Acosta September 27, 2016 07:30 AM UTC

I just fixed using a different approach.

Kind regards,

Juan


RU Ragavee U S Syncfusion Team September 27, 2016 08:40 AM UTC

Hi Juan,  

We are glad that you have resolved your issue. Please let us know if you need any other assistance and we will be happy to assist you regarding the same  

Regards,  
Ragavee U S.  



JA Juan Acosta September 27, 2016 11:39 AM UTC

Hi Ragavee,

Could you give a hand checking this one

https://www.syncfusion.com/forums/126126/select-multiple-rows-lost-focus-when-right-click-in-custom-context-menu

Becuase, that issue more related to the grid internal behaviour.

Kind regards,

Juan


RU Ragavee U S Syncfusion Team September 28, 2016 04:40 AM UTC

Hi Juan, 
We have updated the response for the reported query in corresponding forum. So please refer to that forum for further follow up. 
Regards, 
Ragavee U S.   


Loader.
Live Chat Icon For mobile
Up arrow icon