Free Support Forum - aspose.com

Gridview converting to PDF issue

Hi Aspose Team,
Can you please look into this issue of gridview to PDF conversion.
<asp:GridView ID=“grid” runat=“server” AutoGenerateColumns=“false”
onrowdatabound=“grid_RowDataBound” onrowcreated=“grid_RowCreated”
onselectedindexchanged=“grid_SelectedIndexChanged” >




<asp:boundfield datafield=“id” headertext=“Id” />
<asp:boundfield datafield=“salary” headertext=“Salary” />
<asp:BoundField DataField=“FName” />
<asp:BoundField DataField=“LName” />

C# Code behind

protected void grid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView drv = (DataRowView)e.Row.DataItem;
if (drv[“empName”].ToString() != “”)
{
e.Row.Cells.RemoveAt(3);
e.Row.Cells[2].ColumnSpan = 2;
e.Row.Cells[2].Text = drv[“empName”].ToString();

}
else
{


}

}
}

protected void grid_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView gr = (GridView)sender;
GridViewRow headerRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell headerCell = new TableCell();
headerCell.Text = “”;
headerCell.ColumnSpan = 2;
headerRow.Cells.Add(headerCell);
headerCell = new TableCell();
headerCell.Text = “Update”;
headerCell.ColumnSpan = 2;
headerRow.Cells.Add(headerCell);
gr.Controls[0].Controls.AddAt(0, headerRow);
}
//http://docs.jquery.com/Plugins/Tooltip/tooltip#options

}

Hi Amit,


Thanks for using our products.

Can you please confirm which product you are using i.e. either you are using Aspose.Cells or you are using Aspose.Pdf to convert GridView to PDF. We are sorry for this inconvenience.