public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            string content = String.Empty;
            regions.Add(BuildRegion());
            
            StringBuilder sb = new StringBuilder(1024);
            if (CurrentTemplate == null)
            {
                sb.Append(String.Format(CultureInfo.InvariantCulture,
                                        _designtimeHTML,
                                        ColorTranslator.ToHtml(SystemColors.ControlText),
                                        ColorTranslator.ToHtml(SystemColors.Control),
                                        ReorderList.ID,
                                        DesignerRegion.DesignerRegionAttributeName,
                                        content));
            }
            else
            {

                DataList dl = new DataList();

                sb.Append(String.Format(CultureInfo.InvariantCulture,
                                        _designtimeHTML_Template,
                                        CurrentViewName,
                                        dl.HeaderStyle,
                                        ReorderList.ControlStyle,
                                        DesignerRegion.DesignerRegionAttributeName,
                                        content,
                                        ColorTranslator.ToHtml(SystemColors.ControlText),
                                        ColorTranslator.ToHtml(SystemColors.Control),                                        
                                        ReorderList.ID,
                                        ReorderList.GetType().Name));

                dl.Dispose();
            }


            return sb.ToString();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 邦定DataList
 /// </summary>
 /// <param name="DataScore">数据源</param>
 /// <param name="DL">DataList控件</param>
 public virtual void BindDataList(object DataScore, System.Web.UI.WebControls.DataList DL)
 {
     DL.DataSource = DataScore;
     DL.DataBind();
     DL.Dispose();
 }