Grid with no records after form post

Hello,
I need to download a file when I press a button in a grid. The file is retrieved via a webservice and I would like this to be done server side.
Below is the code I wrote, the problem is that when I post by pressing the button the grid empties.

can you help me?

Thanks


<ejs-grid id="Grid" dataSource="@Model.documenti" allowFiltering="true" allowPaging="true" allowGrouping="true" toolbar="@(new List<string>() {"Search" })">
    <e-grid-filtersettings type="Excel"></e-grid-filtersettings>
    <e-grid-pagesettings pageCount="5"></e-grid-pagesettings>
    <e-grid-groupSettings showDropArea="false" captionTemplate="#captiontemplate" columns="@(new string[] { "DESCR_TIPO_DOC_DGT"})"></e-grid-groupSettings>
    <e-grid-columns>

        <e-grid-column field="DESCR_TIPO_DOC_DGT" headerText="ANNO"></e-grid-column>
        <e-grid-column field="R_ANNO_DOC" headerText="ANNO"></e-grid-column>
        <e-grid-column field="DATA_DOC" headerText="DATA" format="yMd"></e-grid-column>
        <e-grid-column field="R_NUMERO_DOC" headerText="NUM.DOC."></e-grid-column>
        <e-grid-column headerText="AZIONI" template="#azioniTemplate"></e-grid-column>
    </e-grid-columns>

</ejs-grid>
<script id="captiontemplate" type="text/x-template">
    ${key}
</script>

<script id="azioniTemplate" type="text/x-template">
    <form method="POST">
        <a rel='nofollow' href="@Url.Page("DocDgt", "DownloadFile", new { fileName = "file.pdf" })">Download</a>
    </form>
    
</script>

1 Reply

MS Manivel Sellamuthu Syncfusion Team May 19, 2021 08:17 AM UTC

Hi Alberto, 

Greetings from Syncfusion support. 

We have prepared a sample at our end based on the shared code example. But we did not faced the mentioned issue. Please find the below sample for more information. 


Could you please share the below details, which will be helpful for us to validate further about issue. 

  1. Share the screenshot or video demonstration of the issue.
  2. Please check our given sample and confirm whether the issue is reproduced or not.
  3. While the grid emptied, please share if you have faced any error in the console.
  4. If possible, please try to replicate the issue in the given sample or share the issue reproducible sample.

Regards, 
Manivel 


Loader.
Up arrow icon