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

RadGrid Edit

4 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zsolt
Top achievements
Rank 1
Zsolt asked on 03 Sep 2008, 01:31 PM
Hi,

We're having this strange problem with the RadGrid for ASP.NET AJAX Q1 2007.

We have an hierarchical grid with 3 levels. The grid is entirely defined in codebehind.
We want level 2 and 3 to always be in editmode. I have searched the Telerik formums and documentation and tried a few approaches, but cannot seem to make this work. Currently I am hooking on to the PreRender-event of the grid where I set all items to Edit and then rebind. I also tries overriding the pages OnPreRender and do it there, but got the same result.

It looks like one of the levels  is in some sort of editmode because the backcolor of the row changes to the correct backcolor for editing, but no editors are visible in the columns. This is onløy for level 2. Level 3 does not change.
The strange thing is that if I open a RadWindow, the editors in level 2 suddenly becomes visible.

I also created a smaller project to demonstrate the problem, but this is working perfectly.

Any ideas?

4 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 04 Sep 2008, 01:30 PM
Hello Zsolt,

Generally looked at, your approach seems correct. You can always set an item in edit mode in RadGrid's PreRender event and then rebind. Are you getting these problems with client or server hierarchy expand mode? Try client hierarchy binding to have all your hierarchy items render at once, so that you can see if items are prorperly in edit mode.

Kind regards,
Veli
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Zsolt
Top achievements
Rank 1
answered on 05 Sep 2008, 06:39 AM
Hi,

I'm already using Hierarchyloadmode = Client.

There is another thing that seems a little strange in all this. If I use the Rebind-method on the entire grid I loose all the child-items below the top-level. If I use the ReBind-method directly on the detail-tables all items are shown. Still not in edit-mode, but at least they are there.

Yesterday I also upgraded to Q2 2008 to see if this hepled, but no.

Can the fact that I'm defining the grid entirely in codebehind have something to do with this?

Ant help on this would be greatly appreciated.
0
Princy
Top achievements
Rank 2
answered on 05 Sep 2008, 07:44 AM
Hi Zsolt,

"By default when you rebind a parent table in hierarchical grid the settings/expanded state for the nested tables will be lost. This is because the refresh action resets all previous settings applied for the nested controls to avoid viewstate inconsistencies/unexpected behavior."

Here is a code sample on how you can retain the expanded state of the grid on rebind.

http://www.telerik.com/community/code-library/submission/b311D-ghhmh.aspx


Thanks,
Princy
0
Veli
Telerik team
answered on 05 Sep 2008, 08:17 AM
Hi Princy,

Additionally, all this seems an issue connected to improper RadGrid initialization in code-behind. The reason for me to think so is that edited items, as you said, display only after the second postback after edit click, meaning by the time they are issued an "edit" command, they are already too late in their lifecycle, and need to wait for the next postback.

If you can consider opening a regular support ticket, where you can provide us a simplified runnable project, we might be able to look deeper into the matter to advise you further.

Kind regards,
Veli
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Zsolt
Top achievements
Rank 1
Answers by
Veli
Telerik team
Zsolt
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or