Nested Data Grid Post Back Event

Discussion in 'ASP .Net Datagrid Control' started by Jeremy Martin, Jun 15, 2006.

  1. 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;
    Jeremy Martin, Jun 15, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joby
    Replies:
    0
    Views:
    1,615
  2. =?Utf-8?B?QWxla3NhbmRhciBBbmRqZWxrb3ZpYw==?=

    Refresh data grid control without (post back)

    =?Utf-8?B?QWxla3NhbmRhciBBbmRqZWxrb3ZpYw==?=, May 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,104
    mortb
    May 24, 2004
  3. Girish
    Replies:
    4
    Views:
    657
    Patrick.O.Ige
    Jul 19, 2005
  4. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    750
    Masudur
    May 25, 2007
  5. tomix

    Editable grid without post back?

    tomix, Oct 18, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    568
    tomix
    Oct 18, 2006
Loading...

Share This Page