Yes
I am extending the layout of menu control as per as requirement.
please see below code i have add comment in bold.
protected override void OnLoad(EventArgs e)
{
if (!string.IsNullOrEmpty(this.HoverCSSClassName) && BrowserHelper.IsIE() && this.Page.Header.FindControl("GCProductMenuStyleHeaderControl") == null)
{
string arg = CMS.Base.SystemContext.ApplicationPath.TrimEnd(new char[]
{
'/'
});
string style = string.Format(".{0} LI {{ BEHAVIOR: url({1}/CMSScripts/LIhover.htc) }}", this.HoverCSSClassName, arg);
string style2 = CSSHelper.GetStyle(style);
Control control = new LiteralControl(style2);
control.ID = "GCProductMenuStyleHeaderControl";
this.Page.Header.Controls.Add(control);
}
base.OnLoad(e);
}
///
/// Indicate if data will be loaded whatever datasource is not empty
///
public override void ReloadData(bool forceLoad)
{
this.SetContext();
this.mRenderedHTML = "";
if (this.StopProcessing || this.Context == null)
{
return;
}
string text = ",";
this.EnableViewState = false;
if (this.DataSource == null || forceLoad)
{
if (this.FilterControl != null)
{
this.FilterControl.InitDataProperties(this);
}
**this.DataSource = base.GetDataSource(false);**
//above line bind element from root element not define path by me
}
if (DataHelper.DataSourceIsEmpty(this.DataSource))
{
return;
}
if (!string.IsNullOrEmpty(this.HoverCSSClassName))
{
this.mRenderedHTML = this.mRenderedHTML + "<div class=\"" + this.HoverCSSClassName + "\">";
}
int integer = ValidationHelper.GetInteger(this.DataSource.Tables[0].Rows[0]["NodeLevel"], 0);
foreach (DataRowView dataRowView in this.DataSource.Tables[0].DefaultView)
{
if (ValidationHelper.GetInteger(dataRowView["NodeLevel"], 0) != integer)
{
break;
}
if (text.IndexOf("," + Convert.ToInt32(dataRowView["NodeParentID"]).ToString() + ",", 0) < 0)
{
this.DataSource = base.GetDataSource(true);
string ss = this.Path;
this.mRenderedHTML += this.GetItems(ValidationHelper.GetInteger(dataRowView["NodeParentID"], 0), 0);
**//when above method call it return nodeparentID is 2 which is wrong**
//this.mRenderedHTML += this.GetItems(15, 0);
text = text + ValidationHelper.GetString(dataRowView["NodeParentID"], string.Empty) + ",";
}
}
if (!string.IsNullOrEmpty(this.HoverCSSClassName))
{
this.mRenderedHTML += "</div>";
}
this.ReleaseContext();
}