Side effect of debugging ClientID in DataGrid ChildTable.

I am using Metabuilders ExpandingButtons  and started to get “Please check the page configuration“ error. Some investigation showed that my DataGrid control has two IDs, one as expected from ServerID and another with suffix “__Ctl0”.


<TABLE
<TABLE color="#ff0000" <table id=”dnn_ctr374_ResultsContainer_uscExternalSourceListMarden_grResultItems__ctl0” cellspacing=”2″ cellpadding=”2″ border=”0″ id=”dnn_ctr374_ResultsContainer_uscExternalSourceListMarden_grResultItems”>


JavaScript from  ExpandingButtons tries to use wrong ID(with suffix “__Ctl0”) and alerts the error.
After a lot of debugging I found that I’ve used RecursivelyFindControl function based on code from the thread, which navigated through child controls and Debug.Write ClientID . It seems that for internal ChildTable control of DataGrid it creates not null ClientID and on the Render step,both DataGrid.ClientId and  ChildTable.ClientID are generated.
I beleive that it is a bug in  System.Web.UI.WebControls.ChildTable.AddAttributesToRender code.
If both ChildTable.ClientID and parent DataGrid.ClientId are not empty,only ParentID should be rendered.