Datasource using DropDownList as select parameter not working properly

Posts   
 
    
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 06-Jul-2006 18:38:07   

I converted a webform that used objectdatasource.

It has a dropdownlist and a grid. The dropdownlist selection filters the grid values. So, the <SelectParameters> are hooked to that control.

When using LLBLGenProDataSource, when the page first comes up, the drop down list has the FIRST item selected, and the grid is Empty.

If I select the second item in the DDL (which postsback), then select the first item again - the grid populates with the correct data.

So, it looks like it is just not initialized with the value from the DDL when the page is first loaded. (The DDL is populated from LLBLGenProDataSource also)

Any ideas?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39918
Joined: 17-Aug-2003
# Posted on: 06-Jul-2006 19:02:19   

it works like this: the grid, when rendered, asks its bound datasource for data calling its ExecuteSelect method. The datasource then tries to get that data and returns it.

When you get a postback due to a dropdownlist change, you effectively re-trigger rendering on the grid.

So it's a bit strange that the grid doesn't render anything. It's not my experience: the grids always show data. Do you do anything special in the code behind? Is the grid special or the gridview?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 06-Jul-2006 21:49:46   

I have no codebehind and just using a RadGrid from Telerik.

Since you do not have a ready solution/answer, I will try to reproduce using a regular grid from scratch. (I converted this from an existing/working objectdatasource solution).

Will get back to you.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39918
Joined: 17-Aug-2003
# Posted on: 06-Jul-2006 23:50:17   

Ok. I don't have the telerik grid here so I can't repro it with that. Our back-end app for our website for example uses what you're using, and fills the grids (normal gridviews) without problems so I'm not seeing this issue with our code. Also in my testapp I'm not seeing this behavior. But again, with the vanilla grid.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 07-Jul-2006 00:39:41   

Well, I guess it is Telerik.

I set everything up with a standard GridView and it worked fine.

I then added a RadGrid (left the GridView) and now both of the grids suffered from the problem I described.

Removed the RadGrid and it worked fine again.

So, basically if the RadGrid is on the WebForm, it does not work correctly.

However, it did/does work with ObjectDataSource.

I will pursue with Telerik.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39918
Joined: 17-Aug-2003
# Posted on: 08-Jul-2006 00:41:45   

Thanks simple_smile Let me know if Telerik needs extra info simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 17-Jul-2006 16:45:28   

I submitted a complete project demonstrating the bug to Telerik. They replied with:

"We checked the provided example and we were able to reproduce this unwanted behavior. We will continue to investigate this scenario"

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39918
Joined: 17-Aug-2003
# Posted on: 17-Jul-2006 18:09:26   

Thanks for the feedback, Wayne. Let me know if they need internal info of the classes simple_smile (you can in that case add me to your CC list of the email-exchange if you want to)

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 23-Jul-2006 23:53:43   

They have repaired this with a hotfix.