PC Review


Reply
Thread Tools Rate Thread

datagrid.items.count = 0??

 
 
Anchorman
Guest
Posts: n/a
 
      26th Nov 2004
I've go the following data grid on my form:

<form id="form1" runat=server>
<aspataGrid
ID="DG"
AutoGenerateColumns="False"
EnableViewState="False"
MaintainViewState=False
HeaderStyle-BackColor=silver
HeaderStyle-ForeColor=#000090
HeaderStyle-HorizontalAlign="Center"
AlternatingItemStyle-BackColor="AliceBlue"
ItemStyle-BackColor="White"
CellPadding=3
Runat="Server">

<Columns>
<asp:TemplateColumn>
<headertemplate>
Rank
</headertemplate>
<itemtemplate>
<asp:textbox
id="Rank"
columns=2
maxlength=2
runat=server/>
</itemtemplate>
</asp:TemplateColumn>
<asp:BoundColumn
DataField="ActDesc"
HeaderText="Activity"/>
<asp:BoundColumn
DataField="Price"
DataFormatString="{0:c}"
ItemStyle-HorizontalAlign="Right"
HeaderText="Price"/>
</columns>
</aspataGrid>
<asp:button
id="SubmitBtn"
Text="Submit"
onClick="SubmitActivities"
runat=server/>
</form>

In SubmitActivities, DG.Items.Count returns 0 for some reasons. I'm using
the following code to check:

Response.Write(DG.Items.Count)
Response.End

Does anyone know what might be causing the problem?

Jesse

--
Jesse
www.davinci-mims.com


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UnVsaW4gSG9uZw==?=
Guest
Posts: n/a
 
      26th Nov 2004
Try set Page.EnableViewState Property, DataGrid.EnableViewState Property to
True

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stumped on datagrid.items.count issue Rob Microsoft VB .NET 1 8th Nov 2007 06:31 PM
datagrid items.count = 0 even though grid is full tommytash@gmail.com Microsoft ASP .NET 2 9th May 2007 04:34 PM
DataGrid.Items.Count and DataGrid Paging... Green Start Button Microsoft ASP .NET 1 4th Aug 2005 08:40 PM
DataGrid - Reading values when Items.Count=1 Fred Nelson Microsoft VB .NET 3 23rd Jul 2004 07:22 PM
I am adding a new row to the datagrid dynamically but if i use the Count property of Item it is not showing the count of the new rows being added Praveen Balanagendra via .NET 247 Microsoft ASP .NET 2 6th Jun 2004 08:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:03 AM.