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

Edit grid using FormTemplate

Hi, I am trying to make my Grid Editable using a Template Form I create within the TableDescriptor in Design Mode, and I have the corresponding Event Handler which is supposed to fire every time I click on the Edit button in the BarButton. What happens is my Page tries to refresh and it takes forever, because I never get to see the Grid with the newly entered values, all I get is the "Refreshing..." indicator at the Bottom left of the window borwser. thank you for your help

6 Replies

AD Administrator Syncfusion Team March 10, 2006 03:16 PM UTC

Hi Driss, To enable editing you need to have a primary key column, so make sure you have a PrimaryKeyColumn to the TableDescriptor before calling DataBind(). Have you taken a look at the Editing\EditingModesSample that ships with Essential Grid which illustrates FormEditMode - Custom FormEdit Template. Please let me know if you need furthur assistance. Thanks for choosing Syncfusion products. Regards, A.Sivakumar


DS Driss Selhoum March 10, 2006 03:20 PM UTC

Hi, In fact I have looked at the Samples, but I need futher details of what are ALL the steps in the codebehind file that need to be followed to edit my grid, using the DefaultForm thank you for your help


AD Administrator Syncfusion Team March 11, 2006 11:33 AM UTC

Hi Driss, For a grid to be editable please have a look at thisKB I was confused are you in need of UseDefaultform mode or UseTemplateForm mode for editing. I am illustrating both here. UseDefaultform mode ------------------- You don''t have to do anything for the editing to be done in UseDefaultForm mode Set the FormEditMode property to UseDefaultForm either in code or in designer property. UseTemplateForm mode -------------------- please have a look at this KB-Editing records in Form Mode I have attached a modified version of the FormEditModeSample that I was referring to in the earlier post. I took the existing sample and deleted the other Editing modes ,used the code related to only the UseTempalteForm and connected the grid to categories table from NWind database. For the sample to run on your system, you have to copy the NWind database in the App_Data folder,also if you are not using 4.1.0.50 version you will have to change the Version numbers appropriately in the register tags. Let me know if you have any furthur questions. Thanks, A.Sivakumar


AD Administrator Syncfusion Team March 11, 2006 11:41 AM UTC

Hi Driss , Sorry for the broken link(reg editing)and the attached sample in the previous post For a grid to be editable please have a look at this KB -Unable to edit a row in the Grid a> Thanks, A.Sivakumar

UseTemplateFormEditMode41718.zip


DS Driss Selhoum March 16, 2006 03:07 PM UTC

Hi, I still have some ambiguities about the ways to use the Update functionalities in the GridGroupingControl, I am trying to use the DefaultForm Edit, in you last message you mentined that I don''t have to add anything, only to handle the Save Button to ship the newly entred Data to the DB. But in your code (aspx file) you have an ItemTemplate that holds sone Controls, and these controls are referenced in a Method to get the Data From the user...can you please give all the details to get the Data from the user to the DataBase, and please do not point to any Samples as I red all of them and still ask for more clarifications. Thank you for your help


AD Administrator Syncfusion Team March 17, 2006 04:06 PM UTC

Hi Driss, Sorry for the confusion caused. As I have mentioned, the sample attached is for "UseTemplateForm" mode (as you had mentioned Template Form in the first post), If you are using Default Form mode, it''s very similar to editing the grid in the Normal mode. To save changes to the database, in the "BarButtonItemClicked Event", follow the below procedure. private void GridGroupingControl1_BarButtonItemClicked(object source, Syncfusion.Web.UI.WebControls.Grid.Grouping.ButtonBarItemClickEventArgs e) { //When the user clicks on the save button this gets triggered if(e.ButtonBarItem.ButtonBarItemType ==ButtonBarItemType.Save) { this.GridGroupingControl1.Table.EndEdit(); e.Handled=true; //To save the changes made to database this.oleDbDataAdapter1.Update(dataSet11); } } Also In "CurrentRecordContextChange" Event you can update the changes to database. For More details you can have a look at this KB-How can I save changes made in the Grid into the database Let us know if you have furthur questions Thanks, A.Sivakumar

Loader.
Live Chat Icon For mobile
Up arrow icon