sandroj: I based my controls off of the blog post by Karol. In his code he had the following when pulling data to bind to the drop downs:
private void IntializeRegions()
{
// Get administrator uder
UserInfo admin = UserInfoProvider.GetUserInfo("administrator");
if (admin != null)
{
// Get custom table provider
CustomTableItemProvider ctip = new CustomTableItemProvider(admin);
if (ctip != null)
{
// Get all businessUnits
DataSet regions = ctip.GetItems("Mynews.regions", null, "ItemID, ItemOrder ASC");
if (!DataHelper.DataSourceIsEmpty(regions))
{
// Bind businessUnits to drop-down list
this.drpRegion.DataSource = regions.Tables[0];
this.drpRegion.DataTextField = "regionName";
this.drpRegion.DataValueField = "ItemID";
this.drpRegion.DataBind();
// Add default '(all)' value
this.drpRegion.Items.Insert(0, new ListItem("(any)", "##ALL##"));
}
}
}
}
One question I have is regarding the
admin variable. I am not sure what this is for. It seems to be making a check against administrator, but it also seems that this will always be true. I built my control with the developers version(v6 I believe) and I am deploying to the clients development server which is version 7. Is this check necessary? And is it possible that they do not have a default administrator account, thus causing my control to come up blank?
As I look at my code I also believe I have used the incorrect base class. Ultimately I will have two controls, one that connects to a custom query data source and one that connects to a document data source. I just noticed that my document data control is using the CMSAbstractQueryFilterControl base class. At the very least these revelations give me several things to debug.
Thank you for your assistance.