Click here to Skip to main content
15,901,853 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
GeneralRe: regular validator Pin
Eduard Keilholz7-Apr-08 4:33
Eduard Keilholz7-Apr-08 4:33 
Generalweb control library Pin
abdelhameed817-Apr-08 1:26
abdelhameed817-Apr-08 1:26 
GeneralRe: web control library Pin
Christian Graus7-Apr-08 11:39
protectorChristian Graus7-Apr-08 11:39 
GeneralRe: web control library Pin
abdelhameed818-Apr-08 4:51
abdelhameed818-Apr-08 4:51 
GeneralRe: web control library Pin
Christian Graus8-Apr-08 11:14
protectorChristian Graus8-Apr-08 11:14 
GeneralLoaded External Websites in Content place holder Pin
Abhijit Jana7-Apr-08 0:25
professionalAbhijit Jana7-Apr-08 0:25 
GeneralRe: Loaded External Websites in Content place holder Pin
Christian Graus7-Apr-08 0:31
protectorChristian Graus7-Apr-08 0:31 
GeneralRe: Loaded External Websites in Content place holder Pin
wEb GuRu...7-Apr-08 4:26
wEb GuRu...7-Apr-08 4:26 
Generalnot found Microsoft.Web.Preview.dll Pin
samrat.net6-Apr-08 23:13
samrat.net6-Apr-08 23:13 
GeneralRe: not found Microsoft.Web.Preview.dll Pin
Christian Graus7-Apr-08 0:08
protectorChristian Graus7-Apr-08 0:08 
GeneralQuestion Pin
nithydurai6-Apr-08 23:09
nithydurai6-Apr-08 23:09 
GeneralRe: Question Pin
eyeseetee6-Apr-08 23:36
eyeseetee6-Apr-08 23:36 

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.