This is a migrated thread and some comments may be shown as answers.

EditForm opens on web site load

4 Answers 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dimitrios
Top achievements
Rank 1
Dimitrios asked on 01 Sep 2014, 06:50 AM
I would appreciate any help/info on the following.

I have a WebUserControl used for an edit form on a RadGrid.

Everything works fine. The editing is ok, the insert is ok and the delete is ok.

However, even if I leave the page with the edit form closed (by either cansel or update), when the user re-opens the web site, that form is opened on the last row which was selected in the previous session!

I can not come up with a reasonable explanation.

Thanks

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Sep 2014, 07:48 AM
Hi Dimitrios,

The described behavior is strange, indeed. Can you please check your code-behind whether you have any logic which may lead to this, such as RadGrid1_PreRender in this live sample?
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx

Looking forward to your reply.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dimitrios
Top achievements
Rank 1
answered on 03 Sep 2014, 10:18 AM
Hello Eyup,

I do appreciate your taking the time for this post.

Ok, there are two grids.
One shows orders and the other one shows the detail lines (ordered products) of the selected order.

There is no editing on the first grid (at least not in this phase)

The in place editing with a webusercontrol is done on the order details grid.

So, lets say that the user selects an order and opens the second row of the details of that order, for editing.

If the user does not update or cancels the editing session, but instead selects another order,
the details of the new selected order are shown and the edit form opens the second row of that new selected order for editing automatically!

So, it seems that the status of radgrid.MasterTableView.Items(1).edit remains true.   (1) means the second row
...and also, the public property DataItem contains all the field values of the "abandoned" Item!!

The question is: How do I reset the edit status of that GridEditableItem when the user selects another order and also, how do I get the new field values in Dataitem?

Please let me know if you need me to send you any/which code.

Thanks
0
Dimitrios
Top achievements
Rank 1
answered on 04 Sep 2014, 05:45 AM
UPDATE

Good morning Eyup,

I can set the "radgrid.MasterTableView.Items(x).edit" to false for all the rows (order details) of the selected order, by hooking on the SelectedIndexChanged event of the first grid (orders). Now, the first problem is solved.

BUT, the second problem remains!

In that same situation (no update/cancel), lets say that the user selects another order. The order details are shown on the second grid and because of the above, the WebUserControl remains closed for all rows. If however, the user tries to edit any row od the current selected order, the WebUserControl does open, but the public property DataItem contains all the field values of the "abandoned" row of the previous selected order!

It seems that everything runs smoothly, only if the user updates, or cancels the editing session.

But, I am sure you understand, that this is not really realistic in a web environment, where that control is not really "modal" (as it would have been in a .Net application), even if I have set it so, as below:

<EditFormSettings UserControlName="OrderDetails.ascx"
  EditFormType="WebUserControl">
  <EditColumn ButtonType="ImageButton"/>   
  <PopUpSettings Width="800px" Modal="true"/>
</EditFormSettings>

I would appreciate any help on the above.

Thanks





0
Eyup
Telerik team
answered on 08 Sep 2014, 08:35 AM
Hello Dimitrios,

Do you use AJAX on your page? Please temporarily remove any ajaxification which may affect this behavior and see whether there are server or client-side errors interfering.

Looking forward to hearing from you.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Dimitrios
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Dimitrios
Top achievements
Rank 1
Share this question
or