Hello:
I'm using the UniView to display forum posts within a thread. The code looks something like this:
DataSet ds = ForumPostInfoProvider.SelectForumPosts(ForumID, "/%", "PostIDPath Like '" + ForumPostInfoProvider.GetPath(null, ThreadID) + "%'", ThreadOrderBy, MaxRelativeLevel, onlyPublish, -1, null, currentOffset, maxRecords, ref totalRecords);
if (!DataHelper.DataSourceIsEmpty(ds))
{
GroupedDataSource gpd = new GroupedDataSource(ds, "PostParentID", "PostLevel");
listForums.RelationColumnID = "PostId";
listForums.DataSource = gpd;
listForums.DataBind();
}
The problem is that the top level post has a PostParentID of NULL. So when I data bind I get an "Object cannot be cast from DBNull to other types" exception.
Is there any way to tell UniView that the top-level post in my hierachy is going to have a NULL parent ID? Or do I have to loop through my dataset and change the parent ID to something like -1?
Thanks in advance!