I want to use the C# example shown here
Ok, I have done simple overrides before so I coded up
protected override Auto...
well, I didnt even get that far as intellisense made it clear that AutoGeneratedFi eld is not part of my class ..
public partial class printit : System.Web.UI.P age
So I tried adding "DetailView " to the class so I could inherit it (this was just a wild guess that once worked in c++ for me)
Anyway, the above does not work giving me a cannot have multiple base classes.
There is a really good example of what I want to do here but the author leaves the description on how to "use it" for a later date.
Question: What do I put in to my C# page that willl cause the override to be fired? I assume I have to inherit the class that does the firing and I do not know enough about inheritance to do this.
I have set GridView1.AutoG enerateColumns= True and coded up the following, but the override is never called.
===wait wait wait===
ok, just realized I should have used MyGridView instead of the above "MyClass" and then used MyGridView when createing GridView1 . That gets me a bunch of new overrides though not the one I am looking for. However, I am in the right direction.
Ok, I have done simple overrides before so I coded up
protected override Auto...
well, I didnt even get that far as intellisense made it clear that AutoGeneratedFi eld is not part of my class ..
public partial class printit : System.Web.UI.P age
So I tried adding "DetailView " to the class so I could inherit it (this was just a wild guess that once worked in c++ for me)
Code:
public partial class printit : System.Web.UI.Page, System.Web.UI.WebControls.DetailsView {
There is a really good example of what I want to do here but the author leaves the description on how to "use it" for a later date.
Question: What do I put in to my C# page that willl cause the override to be fired? I assume I have to inherit the class that does the firing and I do not know enough about inheritance to do this.
I have set GridView1.AutoG enerateColumns= True and coded up the following, but the override is never called.
Code:
public class MyDetailsView : DetailsView { public MyDetailsView() { } protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldProperties fieldProperties) { AutoGeneratedField field = new AutoGeneratedField(fieldProperties.DataField); return field; } } public partial class printit : System.Web.UI.Page { ...rest of my program...
===wait wait wait===
ok, just realized I should have used MyGridView instead of the above "MyClass" and then used MyGridView when createing GridView1 . That gets me a bunch of new overrides though not the one I am looking for. However, I am in the right direction.
Comment