Kjelli wrote:
Hi
Can you please provide sample code for LLBLGenProDataSource (selfservicing) in conjunction with GridView / DetailView / FormView programatically? (custom webparts)
How much work is required when LivePersistence = true? Which parts are automatic during edit and delete?
When LivePersistence is set to true, every change you make to data in your control bound to the datasourcecontrol will be executed on the database directly. So if you click the update link on the gridview control's row to save the changes you made to the row, the changes are executed immediately. This is done for you by the LLBLGenProDataSource control, so no code necessary.
Currently we have trouble when updating, "There are no primary key fields specified in the bound control and/or the bound control didn't specify any primary key fields. Update can't continue."
Is it required to have
grid.DataKeyNames = new string[] { "CustomerId" };
for llblgen to know the PK? When we enable this line the error goes away, but changed data is lost.
When you bind a gridview to a llblgenprodatasource control, it will retrieve the columns from the datasource control and also the PK field(s). This information is required to be able to do updates. I'm surprised your grid doesn't have the PK fields set automatically.
All columns in our GridView are TemplateFields based on classes derived from ITemplate. Will llblgen be able to extract new/edited values from these TemplateFields (ITemplate) or do we need to use IBindableTemplate and implement ExtractValues?
This should be done by the gridiview, as that's the control which calls the datasourcecontrol's ExecuteUpdate, or ExecuteInsert/Select/Delete. So I think you indeed should use a bindabletemplate, although I also have to admit I'm not an expert in gridviewtemplates.