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

How to maintain view state of all syncfusion controls

Sir,

When i do post back of any event of any control previous values of all controls get vanished..
can you please tell me how to maintain view state or selected values in control.in asp.net c# application.




Thanks


5 Replies

GV Gowthami V Syncfusion Team August 5, 2015 12:21 PM UTC

Hi Abhijeet,

Thanks for using Syncfusion products.

Before proceeding we need the below details of the controls that you have used in your application.


1.       You have mentioned in the query as “any controls”, whether you have mentioned Syncfusion controls alone or any other controls.

2.       If you are using Syncfusion controls then share us the details of the controls in which the values get vanished after every post back.

For now we have checked the Grid control (with main features like Grouping, Sorting, Paging and Selection) and Tools controls with server side post back. Its working fine for us.

Please let us know if you have any queries.

Regards,
Gowthami V.



GO Gabriel Obando May 23, 2016 08:32 PM UTC

Hello, when i do a postback on selecting a row in the grid control, I lose the data on the grid.

Do I have to bind the data to the control on every page_load?
Doesn't the grid control keep the data if its a postback?

normally what i would do on the page_load event, i put the following

if(!IsPostback)
{
      GridDataBind();
}

So the first time the page loads the grid loads the data fine, but when i select a row on the server side, on the postback the grid is empty, but i can grab the info from selected row on the selected row event.

How do I set up the controls to maintain their data and state?



VA Venkatesh Ayothi Raman Syncfusion Team May 24, 2016 10:51 AM UTC

  
Hi Gabriel, 

Thanks for the update. 

We have achieved your requirement by setting the DataSourceCachingMode property as View state in the ejGrid and created a sample for your convenience. Please refer to the code example and sample, 

Code example: 
<ej:Grid ID="Grid1"    AllowPaging="True" 
            EnableRowHover="true"     AllowCellMerging="false"  
 
               DataSourceCachingMode="ViewState" 
  
             AllowReordering="false" Locale="en-US" AllowMultiSorting="false"  
              AllowSelection="True" Selectiontype="Single"  OnServerRowSelected="DefaultEvents_OnServerRowSelected"  
               runat="server"> 
            <Columns> 
             . . . . . . .  
            </Columns> 
                     </ej:Grid> 




Regards, 
Venkatesh Ayothiraman. 



GO Gabriel Obando May 25, 2016 04:49 PM UTC

thanks, this helped me.



VA Venkatesh Ayothi Raman Syncfusion Team May 26, 2016 08:36 AM UTC

Hi Gabriel, 

Thanks for your feedback. 

We have happy to hear that your requirement is achieved. 

Thanks, 
Venkatesh Ayothiraman. 


Loader.
Live Chat Icon For mobile
Up arrow icon