Telerik's radGrid and LLBLGenDataSource2 Control

Posts   
 
    
pandu avatar
pandu
User
Posts: 86
Joined: 18-May-2006
# Posted on: 09-Sep-2006 09:37:15   

I am testing the radGrid for my current project and it works fine for most of the situations.

I am trying to build a Master-Detail Entry form with radGrid and LLBL's Datasource Control.

I want to collect all the grid's insert/update/delete into UOW and commit it in a button's click event.

telerik support team says:

You can store the new data or delete grid items by modifying the grid source and storing it in Session variable. These tasks can be undertaken through callback requests when you enable the AJAX mechanism of the grid (EnableAJAX="true").

Then, at a later stage, you can apply the changes in the database wiring the OnClick event of a button outside of the grid. In the handler of that button you can extract the data from the Session variable which stores the refreshed content and execute appropriate Insert/Update/Delete queries to alter the database.

Did anyone make it work like this? Is this a good approach?

Any sharing is really appreciated.

Thanks in advance.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Sep-2006 10:12:53   

If it works just like the devexpress' webgrid with ajax, it shouldbe no problem.

Frans Bouma | Lead developer LLBLGen Pro
pandu avatar
pandu
User
Posts: 86
Joined: 18-May-2006
# Posted on: 09-Sep-2006 13:41:00   

I do not know what are the difference between Aspxgrid and radGrid. I wrote to telerik and waiting for the answer.

I beleive, when I edit a record, the record is being stored in LLBL's UOW object.

But the grid content stays the same. I would like to see the Grid get updated with the new values.

According to telerik, I should use the Session object to store the datasource...

If I do, the changes will not be collected in LLBL's UOW Object and I need to write my own extract function to retreive data manually from the Session object and store them into the table....grrrrr.... Not to mention, I need to take care of the Insert/Delete/Update operations. This is not what I want.... rage

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Sep-2006 13:54:06   

pandu wrote:

I do not know what are the difference between Aspxgrid and radGrid. I wrote to telerik and waiting for the answer.

I beleive, when I edit a record, the record is being stored in LLBL's UOW object.

No, when the grid calls the datasourcecontrol. So when the grid does the tracking first (you add, edit and remove rows) and after you call save calls the datasource, all changes are send to the datasourcecontrol. The llblgenprodatasourcecontrol can handle that, it works that way with the devexpress grid control.

But the grid content stays the same. I would like to see the Grid get updated with the new values.

According to telerik, I should use the Session object to store the datasource...

If I do, the changes will not be collected in LLBL's UOW Object and I need to write my own extract function to retreive data manually from the Session object and store them into the table....grrrrr.... Not to mention, I need to take care of the Insert/Delete/Update operations. This is not what I want.... rage

Have you tried by following their way of tracking TEMP changes ? I mean: does the grid then send all changes to the datasourcecontrol in one go when you click save?

Frans Bouma | Lead developer LLBLGen Pro
pandu avatar
pandu
User
Posts: 86
Joined: 18-May-2006
# Posted on: 16-Sep-2006 07:11:20   

Sorry for this delayed reply Frans. I took some time to gather info from the radgrid manual.

Have you tried by following their way of tracking TEMP changes ? I mean: does the grid then send all changes to the datasourcecontrol in one go when you click save?

No. It is not happening. With LivePersistance = False, and no code in the PerformWork (am I right?), when I edit something and hit Update, the grid rebinds automatically (even in Ajax Mode) and bring the data from the Server, which is old values ofcourse.

I found this info in the grid manual

Why does it require re-binding? Getting the latest data from the grid source ensures the consistency of the displayed information. That is the reason why r.a.d.grid performs automatic rebind when the user switches the grid item in edit mode. Creating edit form and populating its fields with data on the client is not secure as at the same time other users may change the database content. This will result in data inconsistency. Moreover, the entire process of client edit form generation and its subsequent submit on the server (to reflect the changes) will tremendously slow down the control's performance. That is why our developers have not included this feature in the current grid implementation.

It means, it cannot postpone the rebind of the grid until I hit "Save" button outside grid. Am I right?

If it is not going to work, I need to find the workaround.

The Grid has UpdateCommand, InsertCommand and DeleteCommand events. But If I bind with LLBL's Datasource control, I do not need to use them. Also it has ItemUpdated, ItemDeleted and ItemInserted events which fires "After" the Update, Delete and Insert operations.

Can you see what I can do with these events to make use of UOW and save it in one go?

Thank you for your patience.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 16-Sep-2006 19:31:03   

But, is the issue related to how Telerik made their grid work?

Frans Bouma | Lead developer LLBLGen Pro
pandu avatar
pandu
User
Posts: 86
Joined: 18-May-2006
# Posted on: 17-Sep-2006 10:46:22   

But, is the issue related to how Telerik made their grid work?

Apparently, Yes. rage

I asked Telerik if there is a way to disable callback/postback upon Update/Insert/Delete operations and waiting for their response. In their forum, they repeatedly say that it is grid's original design. I do not know if there is a possiblity to override that.

Alternatively, I am looking for other grid controls in the market. As you have said, I wanted to try AspxGrid's Trial version. But it is showing the Trial Message and not showing the data. I am waiting for their response to move on with this test.

Meanwhile, I am looking for other workaround ideas with telerik Grid as I am comfortable with the grid, its out-of-the-box support with LLBLGenDataSource2 Control and the support.

One simple approach will be, first get the Header record and save it and have a link to enter the Detail records. But it will not work in our project where the user needs to enter all the Header and Details in one form and save them in one go. (Example, Purchase Order)

I am not seeing a lot of question related to this issue in forums and I started to wonder how others are approaching this One-To-Many Batch Update problem in ASP.NET applications confused

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 18-Sep-2006 10:06:16   

It's a problem indeed, especially with webforms, where you in general use 2 datasource controls: one for the master and one for the details, and there's no currencymanager to keep them in sync.

Frans Bouma | Lead developer LLBLGen Pro