bryan-bit-wizards
-
8/12/2009 8:07:41 AM
RE:How to reload QueryDataList
Thank you for your response.
I solved ther issue by creating a QueryDataList control from the code behind, setting the properties dynanimcally, then adding it to ASP PlaceHolder.
placeholder.Controls.Clear(); //Create QDL w/ defaults CMS.Controls.QueryDataList qdl = new CMS.Controls.QueryDataList(); qdl.StopProcessing = true; qdl.QueryName = "[QueryName]"; qdl.TransformationName = "[TransformationName"; qdl.RepeatDirection = RepeatDirection.Horizontal; qdl.RepeatLayout = RepeatLayout.Table; qdl.EnablePaging = true; qdl.PagerControl.PagingMode = CMS.Controls.PagingModeTypeEnum.QueryString; qdl.PagerControl.PagerPosition = CMS.Controls.PagingPlaceTypeEnum.Bottom; qdl.PageSize = 5; qdl.RepeatColumns = 1; qdl.OrderBy = "[Order By Clause]"; qdl.PagerControl.BackNextLocation = CMS.Controls.BackNextLocationTypeEnum.Split; qdl.PagerControl.ShowFirstLast = false; //Check if the list should be filtered if (Request.QueryString["id"] != null) { if (Request.QueryString["id"].ToString() != "") { if (IsNumeric(Request.QueryString["id"].ToString())) { //Get the CMSType GeneralConnection cn = ConnectionHelper.GetConnection(); DataSet ds = null; object[,] parameters = new object[1, 3]; parameters[0, 0] = "[Paramater Name]"; parameters[0, 1] = Request.QueryString["id"].ToString(); ds = cn.ExecuteQuery("[Filtering query]", parameters); if (ds.Tables[0].Rows.Count > 0) { qdl.WhereCondition = "[ColumnName] = '" + ds.Tables[0].Rows[0][FilteredValue].ToString() + "'"; } } } } //Finish creating QDL qdl.StopProcessing = false; qdl.DataBind(); placeholder.Controls.Add(qdl);
Thank you for your help!
|