Re: ItemCreated question

I've been able to do most of what I want to do without having to use
ItemCreated. Since I am just massaging the data in the grid on each
postback, I have been able to do that outside of the data grid's event

But now I want to update a column total value in the footer. On a postback,
I calculate the new total and set the column's FooterText property. But it
never gets displayed. I guess that it has to be set in the ItemCreated (or
ItemDataBound) but as I said, I'm not re-binding the grid to anything.

Is there a way to force an ItemCreated event to occur?

"Teemu Keiski" <joteke@xxxxxxxxxxxxxxx> wrote in message
> Hi,
> first of all, it depends a lot what you do in ItemCreated based on that
> value. But, to respond that quite common way to pass this is to rebind the
> grid entirely when something impacting on it changes.
> Sure, I thuink that setting the hidden field in client-script probably
> works in your scenario, but is there anything else involved in the
> ItemCreated?
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> "BobU" <buva@xxxxxxxxxxxxx> wrote in message
> news:urz81NFSFHA.1564@xxxxxxxxxxxxxxxxxxxxxxx
>> I've got a data grid that uses viewstate to maintain its state between
>> posts. I also have a button outside of the data grid which, when clicked,
>> in its server-side click event handler, sets a mode value (in viewstate)
>> that I want the data grid's ItemCreated handler to act on. However, the
>> ItemCreated event occurs before the button click event so it doesn't have
>> the correct mode value.
>> I've thought that I could set the mode value in a hidden field in
>> client-side script whenever the button is clicked, and the data grid's
>> ItemCreated event should then get the correct value. Is that the best way
>> to handle this type of communication?
>> Bob


Relevant Pages

  • Re: Control of columns
    ... You can catch AutoGenerated columns in ItemCreated event. ... Eliyahu ... >>set columns to invisible, for example. ... After the grid is bound to data, ...
  • Re: checkbox in datalist
    ... I think that what you should do is on the ItemCreated event of your grid, ... you hook the events, remeber to check the e.Item.ItemType to be Item or ...
  • RE: Dynamic Datagrid
    ... Why if you rebind data source you will loose the event ... handler for the remove button? ... >it, but if the grid isn't re-bound on the postback, the ... >other hand, if I do re-bind on the postback, I loose the ...
  • Re: Detect which ImageButton caused PostBack
    ... Have you tried, for instance, not binding the grid at all in the Load ... handler, or in PreRender handler as necessary. ... You can also "convince" the ASP.NET engine to fire the ItemCommand event ...
  • deleting from a datagrid
    ... deleting from a datagrid that is bound to a dataset ... My problem is that the "delete" handler is not been called every time I delete a row from the grid. ... the binding context so that the handler is always called when we delete from the grid. ...