What I am attempting to-do is pass a DataSet to my control to handle
generating the columns from a property.
I also want to use this same DataSet to handle sorting and paging within the
control.
This is the code I was attempting to use. I could not pass a DataSet to
createGrid because the namespace will not allow System.Data.
public void createGrid(object ds,DataGrid oGrid)
{
if(_datafieldsarray == null)
{ // Write Bound Columns automatically.
for (int i = 0; i < ds; i++)
{
}
}
else
{ // Write Bound Columns from _datafieldsarray value.
arrFields = _datafieldsarray.Split(',');
for (int i = 0; i < arrFields.Length; i++)
{
BoundColumn oCol = new BoundColumn();
oCol.HeaderText = arrFields[i];
oCol.DataField = arrFields[i];
oCol.SortExpression = arrFields[i];
oGrid.Columns.Add(oCol);
}
}
}
// Value would look like "FirstName,LastName"
private String _datafieldsarray;
[Category("_Custom SportPal")]
public String DataFieldsArray
{
get { return _datafieldsarray; }
set { _datafieldsarray = value; }
}
Thanks
Brian K. Williams
"Suresh" <an*******@discussions.microsoft.com> wrote in message
news:44**********************************@microsof t.com...
You can pass data into a custom web control via properties or thru a
method that accepts data as a parameters during runtime.
How are you passing in the Dataset object?? Thru a method??
Suresh.
----- Brian K. Williams wrote: -----
Does anyone know how I can pass data to a Custom Web Control?
I have been able to pass a DataSet as an object but I can't use it.
DataSets don't seem to be available the namespaces will not load.
Thanks for any help.
Brian K. Williams