Print Page | Close Window

How do I create a new row on the Ultragrid?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=253
Printed Date: 12-Jun-2026 at 4:19am


Topic: How do I create a new row on the Ultragrid?
Posted By: Customer
Subject: How do I create a new row on the Ultragrid?
Date Posted: 16-Jul-2007 at 10:06am
Quick question about adding a new item when using binding sources. I have tried to use the Create method but it says that the properties I need to set are read only. The table is one-many table where the key's are values from other tables.
 
Table - PK
DataStore - DSId
Users - UserId
UserRights - DSId , UserId
 
In the UserRights BO I have the following:
    public static UserRights Create(PersistenceManager pManager, int dsId, int userId)
    {
 
        UserRights aUserRights = pManager.CreateEntity<UserRights>();
 
        // if this object type requires a unique id and you have implemented
        // the IIdGenerator interface implement the following line
        //pManager.GenerateId(aUserRights, // add id column here //);
        aUserRights.AddToManager();
 
        // Add custom code here
        aUserRights.Dsid = dsId;  -> says it is read only
        aUserRights.UserId = userId; -> says it is read only
 
        aUserRights.AddToManager();
        return aUserRights;
    }
 
 
How do I create a new row?



Replies:
Posted By: IdeaBlade
Date Posted: 16-Jul-2007 at 10:07am
The question that you are asking is one of the most often asked question in Technical Support with the question most often referring to the Infragistics UltraGrid or to the DevExpress XtraGrid.
 
There is an excellent tutorial on this subject in the 200 Series - "Add/Delete on Child Grid".



Print Page | Close Window