S
sunny076
Hi,
I am having problem with a derived class from GridView in which I added
an empty image in the itemTemplate. Basically what I am trying to do is
adding an image column with an arrow instead of a select button. It
built fine, but when I modified any of the attributes in teh designer
mode, it kept adding another column of the same one. I think the
problem is because I added the column in teh class constructor but I
tried adding in OnLoad, OnInit and OnPreRender. Nothing works. Can
anyone point me out here? I am attaching my code herewith.
public class ItsGridView : System.Web.UI.WebControls.GridView
{
public ItsGridView()
{
TemplateField tf = new TemplateField();
tf.ItemTemplate = new
GridViewImageTemplate(DataControlRowType.DataRow);
tf.HeaderText = string.Empty;
this.Columns.Insert(0, tf);
}
}
Thank you in advance,
Sunny
I am having problem with a derived class from GridView in which I added
an empty image in the itemTemplate. Basically what I am trying to do is
adding an image column with an arrow instead of a select button. It
built fine, but when I modified any of the attributes in teh designer
mode, it kept adding another column of the same one. I think the
problem is because I added the column in teh class constructor but I
tried adding in OnLoad, OnInit and OnPreRender. Nothing works. Can
anyone point me out here? I am attaching my code herewith.
public class ItsGridView : System.Web.UI.WebControls.GridView
{
public ItsGridView()
{
TemplateField tf = new TemplateField();
tf.ItemTemplate = new
GridViewImageTemplate(DataControlRowType.DataRow);
tf.HeaderText = string.Empty;
this.Columns.Insert(0, tf);
}
}
Thank you in advance,
Sunny