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.

How to maintain view state of all syncfusion controls

Thread ID:

Created:

Updated:

Platform:

Replies:

119807 Aug 4,2015 03:22 AM May 26,2016 04:36 AM ASP.NET Web Forms 5
loading
Tags: Grid
abhijeet
Asked On August 4, 2015 03:22 AM

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


Gowthami V [Syncfusion]
Replied On August 5, 2015 08:21 AM

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.


Gabriel Obando
Replied On May 23, 2016 04:32 PM

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?


Venkatesh Ayothi Raman [Syncfusion]
Replied On May 24, 2016 06:51 AM

  
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. 


Gabriel Obando
Replied On May 25, 2016 12:49 PM

thanks, this helped me.


Venkatesh Ayothi Raman [Syncfusion]
Replied On May 26, 2016 04:36 AM

Hi Gabriel, 

Thanks for your feedback. 

We have happy to hear that your requirement is achieved. 

Thanks, 
Venkatesh Ayothiraman. 


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.

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.

;