protected virtual void QCAddRowContentChanged(object sender, ContentChangedEventArgs e)
    {
        if (!e.ValueChanged)
        {
            return;
        }
        XElement elem = (XElement)sender;

        QueryColumnsPanel1.AddSimpleColumn(elem.Value);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string path = AppDomain.CurrentDomain.BaseDirectory;

        path += "data\\nwind2.xml";
        query.Model.LoadFromFile(path);
        QueryPanel1.UpdateModelInfo();

        QueryColumnsPanel1.UpdateModelInfo();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        query.Model.Texts.ReloadNativeResources();
        Korzh.EasyQuery.WebControls.TextResources.ReloadNativeResources();

        query.Model.Texts.LoadFromFileForCulture(System.IO.Path.Combine(baseDataPath, "EQCoreMessages"));
        query.Model.RefreshResources();
        Korzh.EasyQuery.WebControls.TextResources.LoadFromFileForCulture(System.IO.Path.Combine(baseDataPath, "EQWebMessages"));

        if (!Page.IsPostBack)
        {
            string queryName = Page.Request.QueryString.Get("query");
            if (queryName != null)
            {
                query.LoadFromFile(baseDataPath + "\\" + queryName + ".xml");
            }
        }

        QueryPanel1.Query = query;

        QueryColumnsPanel1.Query = QueryPanel1.Query;
        EntitiesPanel1.Query     = QueryPanel1.Query;

        SortColumnsPanel1.Query = QueryPanel1.Query;

        query.ColumnsChanged    += new Korzh.EasyQuery.ColumnsChangedEventHandler(query_ColumnsChanged);
        query.ConditionsChanged += new Korzh.EasyQuery.ConditionsChangedEventHandler(query_ConditionsChanged);
        query.SortOrderChanged  += new Korzh.EasyQuery.SortOrderChangedEventHandler(query_SortOrderChanged);

        System.Reflection.AssemblyFileVersionAttribute versionAttr =
            (System.Reflection.AssemblyFileVersionAttribute)System.Attribute.GetCustomAttribute(QueryPanel1.GetType().Assembly, typeof(System.Reflection.AssemblyFileVersionAttribute));

        LabelVersion.Text = "Version: " + versionAttr.Version;

        EnableLinkButton(lnkBtnEng);
        EnableLinkButton(lnkBtnRu);
        EnableLinkButton(lnkBtnEsp);


        qpAddRow                = new LabelListXElement();
        qpAddRow.ID             = "QPAddRowLink";
        qpAddRow.EmptyValueText = GetLocalResourceObject("txtQPAddRow").ToString();
        QueryPanel1.FillElementByEntityTree(qpAddRow);
        qpAddRow.ContentChanged += new ContentChangedEventHandler(QPAddRowContentChanged);
        qpAddRow.TextAdjusting  += new TextAdjustingEventHandler(QPAddRowTextAdjusting);
        QPAddRowPanel.Controls.Add(qpAddRow);

        qcAddRow                = new LabelListXElement();
        qcAddRow.ID             = "QCAddRowLink";
        qcAddRow.EmptyValueText = GetLocalResourceObject("txtQCAddRow").ToString();
        QueryColumnsPanel1.FillEntityElement(qcAddRow);
        qcAddRow.ContentChanged += new ContentChangedEventHandler(QCAddRowContentChanged);
        qcAddRow.TextAdjusting  += new TextAdjustingEventHandler(QCAddRowTextAdjusting);
        QCAddRowPanel.Controls.Add(qcAddRow);

        qsAddRow                = new LabelListXElement();
        qsAddRow.ID             = "QSAddRowLink";
        qsAddRow.EmptyValueText = GetLocalResourceObject("txtQSAddRow").ToString();
        SortColumnsPanel1.FillEntityElement(qsAddRow);
        qsAddRow.ContentChanged += new ContentChangedEventHandler(QSAddRowContentChanged);
        qsAddRow.TextAdjusting  += new TextAdjustingEventHandler(QSAddRowTextAdjusting);
        QSAddRowPanel.Controls.Add(qsAddRow);


        QueryPanel1.ToolTip        = GetLocalResourceObject("txtQPTooltip").ToString();
        QueryColumnsPanel1.ToolTip = GetLocalResourceObject("txtQCTooltip").ToString();
        SortColumnsPanel1.ToolTip  = GetLocalResourceObject("txtQSTooltip").ToString();

        UpdateSql();
    }