Click here to Skip to main content
15,899,754 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Date Pin
pmarfleet7-Apr-08 10:28
pmarfleet7-Apr-08 10:28 
GeneralRe: Date Pin
biswa477-Apr-08 20:21
biswa477-Apr-08 20:21 
GeneralRe: Date Pin
Herman<T>.Instance8-Apr-08 4:40
Herman<T>.Instance8-Apr-08 4:40 
GeneralRe: Date Pin
pmarfleet8-Apr-08 11:07
pmarfleet8-Apr-08 11:07 
GeneralRe: Date Pin
Herman<T>.Instance8-Apr-08 23:40
Herman<T>.Instance8-Apr-08 23:40 
GeneralRe: Date Pin
pmarfleet9-Apr-08 9:23
pmarfleet9-Apr-08 9:23 
GeneralRe: Date Pin
pmarfleet8-Apr-08 11:05
pmarfleet8-Apr-08 11:05 
GeneralUploading Image to Server Pin
Paul McGann7-Apr-08 9:21
professionalPaul McGann7-Apr-08 9:21 
GeneralRe: Uploading Image to Server Pin
Christian Graus7-Apr-08 11:35
protectorChristian Graus7-Apr-08 11:35 
GeneralRe: Uploading Image to Server Pin
Paul McGann8-Apr-08 4:18
professionalPaul McGann8-Apr-08 4:18 
GeneralRe: Uploading Image to Server Pin
Ashish Sehajpal7-Apr-08 19:13
Ashish Sehajpal7-Apr-08 19:13 
GeneralDynamic table - Need help! Pin
humblepgmr7-Apr-08 5:29
humblepgmr7-Apr-08 5:29 
GeneralRe: Dynamic table - Need help! Pin
Mark J. Miller7-Apr-08 5:50
Mark J. Miller7-Apr-08 5:50 
Questionhow change a series in a chart using by asp.net Pin
Rinki Mukheraji7-Apr-08 4:55
Rinki Mukheraji7-Apr-08 4:55 
AnswerRe: how change a series in a chart using by asp.net Pin
Eduard Keilholz7-Apr-08 5:01
Eduard Keilholz7-Apr-08 5:01 
QuestionImplementing eBay API in ASP.NET Pin
wEb GuRu...7-Apr-08 4:23
wEb GuRu...7-Apr-08 4:23 
GeneralRe: Implementing eBay API in ASP.NET Pin
led mike7-Apr-08 4:41
led mike7-Apr-08 4:41 
QuestionRe: Implementing eBay API in ASP.NET Pin
wEb GuRu...7-Apr-08 6:21
wEb GuRu...7-Apr-08 6:21 
GeneralRe: Implementing eBay API in ASP.NET Pin
led mike7-Apr-08 7:08
led mike7-Apr-08 7:08 
QuestionPersist data Pin
LuKas23_7-Apr-08 4:04
LuKas23_7-Apr-08 4:04 
Hi all,

I'm trying to extend GridView control to add a DropDownList with values to change the PageSize in the Pager row. To reuse the control in the future, I'd like to add the values to the DropDownList either in the Properties window at design time or in the code behind. I created a class to keep the values and, following instructions found in several forums, add the requested attributes.

Here is the code:
[DefaultProperty("Text")]
[ParseChildren(true), PersistChildren(false)]        

public class MyGrid : GridView
{            
  //... Some variable declarations    
  protected SizeItemCollection _PageSizeItems;    
  [Category("Paging")]            
  [Editor(typeof(CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]    
  [PersistenceMode(PersistenceMode.InnerDefaultProperty), MergableProperty(false)]    
  [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]    
  [Description("Items list for the PageSize selector DropDownList")]    
  public SizeItemCollection PageSizeItems    
  {        
    get { return (_PageSizeItems != null ? _PageSizeItems : new SizeItemCollection()); }   
  }    
  protected override void InitializePager(GridViewRow row, int columnSpan, PagedDataSource pagedDataSource)    
  {        
    //Here I create the pager row and added the DropDownList with the values in PageSiZeItems    
  }	    
  //... some more code ...        
}

public class SizeItem : Component
{    
  private int _size;    
  public SizeItem() { }    
  public SizeItem(int size)    
  {        
    _size = size;    
  }    
  public int Size    
  {        
    get { return _size; }
    set { _size = value; }    
  }             
}
public class SizeItemCollection : CollectionBase
{    
  //Here I implemented Add(), Insert(), Remove(), Contains(), IndexOf() and CopyTo()    
  //for my SizeItem class
}

I managed to see the PageSizeItems modal form at design time to add the values, but I don't know why they are not stored properly. Same problem happens if I try to add the values in the code behind using the Add(SizeItem) method, they don't load properly.

I guess it might be a problem with persistance. I'm pretty new to C# and .NET and would really appreciate some help on this. Please feel free to ask any other questions.

Thanks in advanced
GeneralRe: Persist data Pin
led mike7-Apr-08 4:44
led mike7-Apr-08 4:44 
GeneralRe: Persist data Pin
LuKas23_7-Apr-08 5:49
LuKas23_7-Apr-08 5:49 
QuestionHow to access a cached objectdatasource data of a formview? Pin
JimFeng7-Apr-08 3:53
JimFeng7-Apr-08 3:53 
Generalregular validator Pin
eyeseetee7-Apr-08 3:43
eyeseetee7-Apr-08 3:43 
GeneralRe: regular validator Pin
eyeseetee7-Apr-08 4:31
eyeseetee7-Apr-08 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.