Ejemplo n.º 1
0
        public void InstantiateIn(System.Web.UI.Control container)
        {
            ResourceHeaderTemplateContainer resourceContainer = container as ResourceHeaderTemplateContainer;
            Table table = new Table();

            table.Width = new Unit("100%");
            table.Rows.Add(new TableRow());
            table.Rows[0].Cells.Add(new TableCell());
            ASPxBinaryImage image = new ASPxBinaryImage();

            image.Value = ImageToByte(resourceContainer.Resource.Image);
            table.Rows[0].Cells[0].Controls.Add(image);
            table.Rows.Add(new TableRow());
            table.Rows[1].Cells.Add(new TableCell());
            Literal lc = new Literal();

            lc.Text = resourceContainer.Resource.Caption;
            table.Rows[1].Cells[0].Controls.Add(lc);
            container.Controls.Add(table);
        }
    public string GetResourceColor(ResourceHeaderTemplateContainer container)
    {
        int id = ASPxScheduler1.Storage.Resources.Items.IndexOf(container.Resource);

        return(ColorTranslator.ToHtml(ASPxScheduler1.ResourceColorSchemas[id % ASPxScheduler1.ResourceColorSchemas.Count].Cell));
    }