Reputation: 5143
I want to extend the ListView
control:
using System;
using System.Data;
using System.Collections;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Resources;
using System.ComponentModel.Design;
using System.Globalization;
namespace My.WebControls
{
/// <summary>
/// my ListView
/// </summary>
[Designer(typeof(System.Web.UI.Design.WebControls.DataBoundControlDesigner))]
public class MyListView : ListView
{
}
}
But compiler does not see this control. I include the namespace system.web.ui.webcontrols
. Do I have to check anything else? I use the framework 3.5.
Upvotes: 3
Views: 3243
Reputation: 75083
The ListView
documentation can be found on MSDN and you can see that the control exists in the System.Web.Extensions.dll
Re-check if you have this assembly in your references.
Here's the full namespaces of a working MyList
class
[System.ComponentModel.Designer(typeof(System.Web.UI.Design.WebControls.DataBoundControlDesigner))]
public class MyCustomListView : System.Web.UI.WebControls.ListView
{
// ...
}
Because of the DataBoundControlDesigner
I also had to reference the System.Design.dll
, verify if you also have such reference.
Upvotes: 6