A
Adam Knight
I have a datagrid like so:
<aspataGrid ID="dgSubAreas" Runat="server"
AutoGenerateColumns="False"
DataKeyField=""
DataSource='<%#
Container.DataItem.Row.GetChildRows("relSubAreas") %>'>
Its data source is the result of a table relation created like this:
ds.Relations.Add("relSubAreas", ds.Tables("Areas").Columns("area_id"),
ds.Tables("SubAreas").Columns("parent_id"))
When i try to set its datakeyfield attribute to a column name 'area_id' i
get an error.
Something to the effect that datarow doesn't contain a property called
area_id.
If is use <%# Container.DataItem("area_id") within the control itself it is
fine.
Can someone enlighten me on how to set the datakeyfield to draw the right
data "area_id".
Cheers,
Adam
<aspataGrid ID="dgSubAreas" Runat="server"
AutoGenerateColumns="False"
DataKeyField=""
DataSource='<%#
Container.DataItem.Row.GetChildRows("relSubAreas") %>'>
Its data source is the result of a table relation created like this:
ds.Relations.Add("relSubAreas", ds.Tables("Areas").Columns("area_id"),
ds.Tables("SubAreas").Columns("parent_id"))
When i try to set its datakeyfield attribute to a column name 'area_id' i
get an error.
Something to the effect that datarow doesn't contain a property called
area_id.
If is use <%# Container.DataItem("area_id") within the control itself it is
fine.
Can someone enlighten me on how to set the datakeyfield to draw the right
data "area_id".
Cheers,
Adam