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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

126140 Sep 27,2016 01:00 AM UTC Sep 28,2016 04:40 AM UTC ASP.NET MVC 4
loading
Tags: Grid
Juan Acosta
Asked On September 27, 2016 01:00 AM UTC

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

Juan Acosta
Replied On September 27, 2016 07:30 AM UTC

I just fixed using a different approach.

Kind regards,

Juan

Ragavee U S [Syncfusion]
Replied On 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.  


Juan Acosta
Replied On 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

Ragavee U S [Syncfusion]
Replied On 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.   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;