//MyDataGrid.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace webUserWindowExample
{
/// <summary>
/// Summary description for MyDataGrid.
/// </summary>
public class MyDataGrid:System.Web.UI.WebControls.DataGrid
{
private string url;
public string Url
{
get
{
return this.url ;
}
set
{
this.url =value;
}
}
public MyDataGrid()
{
//
// TODO: Add constructor logic here
//
}
protected override void OnItemCreated(DataGridItemEventArgs e)
{
<DefaultProperty("Text"), ToolboxData _
("<{0}:myDropDownList runat=server></{0}:myDropDownList>")> _
Public Class myDropDownList
Inherits DropDownList
Private mTypeCode As String
#Region "属性"
<Category("data"), Description("my"), DefaultValue("")> _
Public Property TypeCode() As String
Get
Return mTypeCode
End Get
Set(ByVal Value As String)
mTypeCode = Value
End Set
End Property
#End Region
Protected Overrides Sub CreateChildControls()
MyBase.CreateChildControls()
End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
MyBase.Render(writer)
End Sub
Public Function FillDropDownList() As Boolean
.......your code
End Function
End Class