On your datagrid property, Set EnableViewState="true" should fix that problem.
Irene
> Hi all
> I have only a Datagrid and a submit button on a form.
[quoted text clipped - 10 lines]
> but "dg.Items.Count" after postback is ZERO when I debug the code.
> It's not zero in Page_load method after postback.
Amir - 28 Oct 2004 06:43 GMT
It was
I think it's because of .NET Framework SP1.
> On your datagrid property, Set EnableViewState="true" should fix that problem.
>
[quoted text clipped - 14 lines]
> > but "dg.Items.Count" after postback is ZERO when I debug the code.
> > It's not zero in Page_load method after postback.
irene xie - 28 Oct 2004 16:20 GMT
What happen if you take off the "if not ispostback " from the Page_Load?
Irene
Amir - 29 Oct 2004 06:09 GMT
execute the code in the page_load.
Irene, It find also the ItemCommand's event handler. but my code can not
count the Datagrid's items. because DG.Items.Count is ZERO in the event
handler.
It's very amazing that it's not ZERO in page_load when I debug my code.
> What happen if you take off the "if not ispostback " from the Page_Load?
>
> Irene