Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 11th, 2007, 09:17 AM
Registered User
Join Date: Aug 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Extending DataGridItem


I am using the Row-Selectable DataGrid Control http://aspnet.4guysfromrolla.com/articles/072104-1.aspx and wanted to extend it with the feature that a datagriditem "remember" it's selected Status.

public class PrettyDataGridItem : DataGridItem, IPostBackEventHandler
   public PrettyDataGridItem(int itemIndex, int dataSetIndex, 
              ListItemType itemType) : base(itemIndex, dataSetIndex, itemType) {}

   public void RaisePostBackEvent(string eventArgument)
      CommandEventArgs commandArgs = new CommandEventArgs(eventArgument, null);
      DataGridCommandEventArgs args = 
                     new DataGridCommandEventArgs(this, this, commandArgs);
      base.RaiseBubbleEvent(this, args);

   public bool IsSelected
      get{return ViewState["IsSelected"+UniqueID];}
      set{ViewState["IsSelected"+UniqueID] = value;}
But if the PrettyDataGrid builds it's items hierarchy the DataGridItem looses the Value....and I don't know why

can somebody help me?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dinamically Adding DropDownList Into DataGridItem 1kHz ASP.NET 1.0 and 1.1 Professional 0 January 20th, 2006 12:06 AM
DatagridItem selection aldwinenriquez ASP.NET 1.0 and 1.1 Professional 2 August 2nd, 2005 06:25 PM
Checkbox DatagridItem jbfelonia ASP.NET 1.x and 2.0 Application Design 1 May 17th, 2005 06:15 AM
Casting DataGridItem.DataItem to Object thecolour General .NET 2 July 12th, 2004 02:43 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.