Last post Dec 02, 2005 05:15 PM by sanjeet
None
0 Points
129 Posts
Dec 01, 2005 05:21 PM|sanjeet|LINK
Member
40 Points
738 Posts
Dec 02, 2005 04:54 PM|eramseur|LINK
What type of list is getting returned? Does it interface IEnumerable? Make sure the list is actually loading too.
Dec 02, 2005 05:15 PM|sanjeet|LINK
None
0 Points
129 Posts
Problem getting a datagrid to display information.
Dec 01, 2005 05:21 PM|sanjeet|LINK
I tried setting a breakpoint on the datagrid all the objects and methods that instantiate the datagrid seem to be ok.
However in debug mode when I type the object name in the immediate window I get an error message that says object not in scope.
I do have the datagrid instantiated in the class:
protected System.Web.UI.WebControls.DataGrid dgRevCatDisplay.
I put a this before the datagrid. Data does exist in the database.
here is my code:
----------------------------------------------------
OnlineCaseCategoryController occc = new OnlineCaseCategoryController();
dgRevCatDisplay = new DataGrid();
dgRevCatDisplay.DataSource = occc.List();
dgRevCatDisplay.DataBind();
occc = null;
----------------------------------------------------
This is the object the populated the Datagrid:
---------------------------------------------
public class OnlineCaseCategoryController
{
public ArrayList List()
{
ArrayList infoList = null;
IDataReader idr = null;
try
{
idr = DataProvider.Instance().ListOnlineCaseCategory();
infoList = DotNetNuke.CBO.FillCollection(idr, typeof(OnlineCaseCategoryInfo));
}
finally
{
if (idr!=null)
{
idr.Close();
idr.Dispose();
idr = null;
}
}
return infoList;
}
----------------------------------------------------------------------
This is where the OnlineCaseCategoryInfo is declared. It's constructors are:
---------------------------------------------------------------------
infoList = DotNetNuke.CBO.FillCollection(idr, typeof(OnlineCaseCategoryInfo));
public class LookupInfoBase
{
private int _id;
string _description;
#region public properties
public int Id
{
get
{
return _id;
}
set
{
_id = value;
}
}
public class OnlineCaseCategoryInfo : LookupInfoBase
{
// local property declarations
int _categoryid;
#region Constructors
public OnlineCaseCategoryInfo()
{
}
public OnlineCaseCategoryInfo(int categoryid, string description)
{
this.Categoryid = categoryid;
this.Description = description;
}
Member
40 Points
738 Posts
Re: Problem getting a datagrid to display information.
Dec 02, 2005 04:54 PM|eramseur|LINK
What type of list is getting returned? Does it interface IEnumerable? Make sure the list is actually loading too.
ANANT CTO | Appleseed Portal Admin
http://appleseedapp.net/
http://www.anant.us/
None
0 Points
129 Posts
Re: Problem getting a datagrid to display information.
Dec 02, 2005 05:15 PM|sanjeet|LINK