Nested Grids for Hierarchical Data

Y

Yasir Hussain

Hope someone can shed some light on the follow issue.
With regards to the excellent article by Dino Esposito on Nested
DataGrids,
http://msdn.microsoft.com/msdnmag/issues/03/10/CuttingEdge/default.aspx
,
I tried to take that example and build on it and take it a little
further.

For those you havnt read the article yet, a summary:
Outer Datagrid with a custom column that expands/Coppalses a DataRow
that contains an inner DataGrid (basically a Master/Details View).
DataRow is deleted of its current contents when expand is clicked,
then new datable is made to host the preview row information as a
header and then a new DataGrid is created and databound with a
DataRelation.

Now the inner grid events work fine interms of Paging. The problem
arrises when you try to edit the inner Datagrid. Im quite sure this
happens because when you click edit on the EditColumn, the datagrid
then creates the new column with the Cancel and Update Controls (ie
dynamically). This, for lack of a better term, messes up the whole
control tree for the page and events dont sync with the right
controls. THe main issue i have is when i click on edit, on postback,
the datagrid enters edit mode, but the editcolumn for the inner
datagrid does not get rendered anymore. Doing just a Trace inside the
inner datagrid edit event handler doesnt cause any problems, its just
when you acutally set the Edit item index that things go crazy. I have
tried to create a custom inner datagrid and wrote my own events and
delegates and tried to bubble events to the next control and all the
way to the main page , but nothing seems to work.

I know this all sounds rather confusing, but any help would be
appreciated.
If someone really wants to go through the code, ill paste it next
post.

Thanx in advance all.

Yasir
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top