Using Grid View to add new records

Posts   
 
    
Posts: 254
Joined: 16-Nov-2006
# Posted on: 10-Mar-2007 23:32:49   

As there seems to be no support to add new items within a GridView I noticed this seemed useful

http://fredrik.nsquared2.com/viewpost.aspx?PostID=155

It involves adding a footer template to the grid view which presents the fields and an add / cancel button. If the add button is pressed a record is created. This solution however revolves around a SQL Data source.

Does anyone have any ideas how the LLBLGenDataSource could be leveraged to get this to work here?

Cheers

Matt

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Mar-2007 02:16:57   

You may be interested in reading this thread. wink http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7199

However, the Fredrik Normén's blog says:

...By default the GridView control doesn’t have support of inserting records...

And LLBLGenPro Databinding Help says:

...PerformWork. This event is raised when ExecuteInsert/Update/Delete is called on the LLBLGenProDataSource2 control by a bound control...

That's why I think you should find a workaround for this, as the GridView doesn't support Inserting.

What if you use another control at the top or buttom of the grid that perform the insert into the LLBLGenDataSource (same effect that the Fredrik footer solution)? What do you think? wink

David Elizondo | LLBLGen Support Team