Can someone please help me out with adding headers to the grid. I would like to insert an image for a header directly into the grid dynamically. Thanks,
Hi,
Thanks for your inquiry.
Well, you may add only textual custom header inplace of original column headers i.e. A,B,C...., please check the featured demo:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aspose.Cells.GridWeb;
using Aspose.Cells.GridWeb.Data;
namespace Aspose.Cells.GridWeb.Examples.CSharp.GridWebBasics
{
public partial class SetColumnHeaderTip : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false && this.GridWeb1.IsPostBack == false)
{
//Access the first worksheet
GridWorksheet gridSheet = GridWeb1.WorkSheets[0];
This file has been truncated. show original
Image headers are not supported yet, we will consider to support it in future versions.
If you want to insert images into a workhseet cells as CellImage objects, please check the source code of the featured demo:
using Aspose.Cells.GridWeb.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Aspose.Cells.GridWeb.Examples.CSharp.Cells
{
public partial class AccessCellHyperlink : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack && !GridWeb1.IsPostBack)
{
InitGridWeb();
}
else
{
This file has been truncated. show original
Also, check the following code;
//Adds a CellImage
CellImage image = GridWeb1.WebWorksheets[0].CellImages.AddCellImage("B8");
image.ImageUrl = "../../Images/Aspose.Grid.gif";
image.ToolTip = "A simple CellImage.";
GridWeb1.WebWorksheets[0].Cells["A8"].PutValue("Creates a CellImage:");
GridWeb1.WebWorksheets[0].Cells.SetRowHeight(7, new Unit("100pt"));
Thank you.