Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Custom property in inherited control & databinding

Reply
Thread Tools

Custom property in inherited control & databinding

 
 
microsoft.public
Guest
Posts: n/a
 
      11-05-2004
I have a custom control that inherited the DataList. What I want is for the
code on the aspx page to make the following call:

CustomDataList.CategoryID = 1

The control uses this property to filter the data it displays. The control
handles getting the data itself. The code I have in the control is:

Catalog cat = new Catalog();
DataSet ds = cat.GetCatalog();
DataView dv = new DataView(ds.Tables[0]);
dv.RowFilter = "CategoryID = " + _catid;
base.DataSource = dv;
base.DataBind();

The problem I'm having is that if I put this code in the constructor (New)
the property value (_catid) is not set yet, but if I put this code anywhere
else the control won't display the data (The data is being retrieved ok,
just not displayed). I've tried a bunch of combinations but none worked.
Which event should this code be in to work? Also am I correct in setting the
base. properies? I've tried it to this. and same thing. None of the many
examples I've looked at show a solution. Thanks!

MikeH


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control is not showing inherited properties in property grid Nathan Sokalski ASP .Net 1 03-17-2009 08:32 AM
Control is not showing inherited properties in property grid Nathan Sokalski ASP .Net Web Controls 1 03-17-2009 08:32 AM
'Class.inherited' v. 'inherited' syntax inside Class 7stud -- Ruby 11 11-09-2007 06:45 PM
Keep custom property-value in custom rendered control Rob Joosen ASP .Net Building Controls 0 05-12-2004 11:56 AM
DataGrid Custom Column Error when DataBinding "does not contain a definition for 'DataBinding'" Earl Teigrob ASP .Net Datagrid Control 1 03-01-2004 04:52 AM



Advertisments