Print Page | Close Window

How to control the fetch command of the aspDatasource

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1213
Printed Date: 22-Sep-2025 at 1:07pm


Topic: How to control the fetch command of the aspDatasource
Posted By: alexei
Subject: How to control the fetch command of the aspDatasource
Date Posted: 14-Apr-2009 at 9:02am

Is it possible to control the fetch command of the ASPdatasource. I have the following scenario.

 
Aspdatasource.
Devexpress grid(with a dropdownlist).
detailview(with controls and dropdownlist)
 
The problem is that when you change a value of the dropdown it fires a postback, this postback triggers the fetch command of the aspdatasource, and you can imagine what will happen, the value of the dropdown will "reset" it self the value that the datasource has brought, so my work around is, that when i change the value of the dropdown i'll store it into the session and after the postback i will change the dropdownlist value again to what the user has selected. This i do by searching the controlcollection for the control and when found I'll set the value that i stored in session) and then i can do an update(the Detailview update command).
 
It is the same when you use a button. because the button fires a postback no matter what. So i have to use the session as an alternative to store what the user changes and after the postback go through the page control and set the value for the controls, it is pretty anoying. And it will get difficult when i need to do it for the dropdownlist that is in a gridview row.
 
If i could control the aspDatasource to not fetch everytime, It would be a good solution, it would be great if the datasource could have a aspdatasource.Select() method like .net datasets to trigger it when you want it.
 
it is a AJAX webapplication,
 
I wonder that anybody ran into this scenario and what was their solution
 
 



Replies:
Posted By: davidklitzke
Date Posted: 14-Apr-2009 at 2:16pm
The AspDataSource does not control or initiate the fetch (i.e., "select") command of the Web Control it is bound to.  Instead, it dutifully responds to the select command and returns the entities for which it was asked.  To change this behavior, I would suggest that you talk to Tech Support at Developer Express.  They may know a way to manipulate or control the behavior of the grid.



Print Page | Close Window