CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.faq_frequently_asked_questions Tags:
Item Type: NewsGroup Date Entered: 11/28/2007 7:25:06 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 43 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
sameer choubey
Asp.Net User
Problem in casting of this.Controls[0] to Table11/28/2007 7:25:06 AM

0

On performing The casting of  this.Controls[0] to Table i am getting exception "Specified argument was out of the range of valid values.Parameter name: index" in thef ollowing function in my code

 private void AddPaddingItems()

{

int indexCount;

int indexStop = this.PageSize;

int indexStart = 1;if (this.AllowPaging == true)

{

indexStart++;

indexStop++;

}

Table myTable = (Table)this.Controls[0];   /// in this line i am getting the error

for (indexCount = indexStart + this.Items.Count; indexCount <= indexStop; indexCount++)

{

myTable.Controls.AddAt(indexCount, PaddingItem());

}

}

can any one help me

 

Mercury082
Asp.Net User
Re: Problem in casting of this.Controls[0] to Table11/28/2007 8:21:27 AM

0

 Ensure that this.Controls actually contains at least 1 element.

 

eg.

Table myTable;

if (this.Controls.Count > 0)

{

  myTable = (Table)this.Controls[0]; 

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:




   
  Privacy | Contact Us
All Times Are GMT