Hi,
I need to create an advertisement banner between the radgrid rows, so i checking for the rowcount and if it is a specific row then im dynmically creating a table cell and rows and tried to fit it into the table but i coulnt see the banner image, though the code was successfully built. Below is the code im using to implement the functionality
Please help with this issue. Thanks in advance.
I need to create an advertisement banner between the radgrid rows, so i checking for the rowcount and if it is a specific row then im dynmically creating a table cell and rows and tried to fit it into the table but i coulnt see the banner image, though the code was successfully built. Below is the code im using to implement the functionality
Please help with this issue. Thanks in advance.
if ((e.Item.RowIndex == 2)) |
{ |
/* Code to add the image banner in between the rows - Start*/ |
TableCell tCell = new TableCell(); |
ImageButton img = new ImageButton(); |
img.ID = "ImageBannerID"; |
img.ImageUrl = hdnSpecialImageSrc.Value; |
img.PostBackUrl = hdnSpecialImageRedirect.Value; |
img.Style.Add("cursor", "hand"); |
img.Style.Add("margin-top", "5px"); |
img.Style.Add("margin-bottom", "5px"); |
tCell.Controls.Add(img); |
Table tblGrid = ((Table)(this.RadGrid1.MasterTableView.Controls[0])); |
int intIndex = tblGrid.Rows.GetRowIndex(e.Item); |
Telerik.Web.UI.GridItem gvrSubHeading = new Telerik.Web.UI.GridItem(this.RadGrid1.MasterTableView, intIndex, intIndex, Telerik.Web.UI.GridItemType.Separator); |
tCell.ColumnSpan = this.RadGrid1.MasterTableView.Columns.Count; |
gvrSubHeading.Cells.Add(tCell); |
tblGrid.Controls.AddAt(intIndex, gvrSubHeading); |
|
/*End of Coding*/ |
} |