Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   Nested Data Grid Post Back Event (http://www.velocityreviews.com/forums/t762824-nested-data-grid-post-back-event.html)

Jeremy Martin 06-15-2006 06:32 AM

Nested Data Grid Post Back Event
 

Hi I have a nested datagrid event and I get the onItemCommand event to
fire correctly however the dataItem does not get re-created on PostBack.

Basically i need to update a database and re-databind the child grid
with new values.

However as I have a child grid per row of the parent grid I need a way
to know the primarykey to be able to update the correct records "Hope
this makes sense"

Any help appreciated.



//CREATE THE CHILD GRID IN PARENT GRID TEMPLATE COLUMN

procedure TItemTemplate.InstantiateIn(container: System.Web.UI.Control);
begin
myPriContiuum := TPRIContinum.Create;
myTbl.Rows[0].Cells[2].Controls.Add(myPriContiuum);
aHL.Controls.Add(myTbl);
aHL.EnableViewState := True;
container.Controls.Add(aHL);
container.EnableViewState := True;
end;




//WIRE UP THE EVENTS

procedure TParentGrid.OnItemCreated(Sender: TObject;
E: DataGridItemEventArgs);
var
myPriContiuum : TPRIContinum;
begin
If (e.Item.ItemType = ListItemType.Item) OR (e.Item.ItemType =
ListItemType.AlternatingItem) OR (e.Item.ItemType =
ListItemType.SelectedItem) Then
Begin
myPriContiuum := (e.Item.FindControl('PriContinuum') as
TPRIContinum);
if Assigned(myPriContiuum) then
Include(myPriContiuum.OnCohortChanged , self.OnCohortChanged);
End;
end;


All times are GMT. The time now is 10:10 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.