hi
i am creating a datatable during run-time and want to associate a table
style to the datagrid that displays the datatable. i have included a breif
illustration
private:DataSet __gc *datasetPpl;
public:DataTable __gc *datatablePpl; //data table that i want to display
in the datagrid
public:DataColumn __gc *datacolumnPpl;
public:DataRow __gc *datarowPpl;
{
//initializations for the above and the datagrid(dataGrid1)
}
this->dataCategory = new DataColumn(S"FullName"); //adding column to data
table
this->dataCategory->DataType = System::Type::GetType(S"System.String");
this->datatablePpl->Columns->Add(dataCategory);
//add new rows (static association), String type
this->dataGrid1->DataSource = datasetPpl;
this->dataGrid1->DataMember = S"tablePpl";
DataGridTableStyle* ts = new DataGridTableStyle();
ts->MappingName=S"datatablePpl"; // DO-NOT KNOW IF THIS IS THE PROPER WAY TO
ASSOCIATE MAPPING NAME
//and further down for the columnstyle,
DataGridColumnStyle* name = new DataGridTextBoxColumn();
name->MappingName = S"FullName"; //DO-NOT KNOW IF THIS IS THE PROPER WAY TO
ASSOCIATE MAPPING NAME
name->HeaderText = S"Full Name of Person";
name->Width = 300;
ts->GridColumnStyles->Add(name);
I am not able to get the table style to work when the datagrid is displayed.
(the data is displayed in the datagrid)
Please let me know if there are any errors and if there is a better way of
going abt it.
cheers!
apz - 22 Oct 2004 09:39 GMT
i got that one, wrong table name, didnt figure out that u need to refer to
the "table name" rather than the table definition object
> hi
>
[quoted text clipped - 55 lines]
>
> cheers!