I have a WebDropDown and a WebDataGrid on a page. When I click the item from the dropdown that is already selected, a postback occurs but no server-side SelectionChanged or ValueChanged events are triggered. Therefore the data in my data grid is being cleared as there are no events from which I can re-bind the grid.
How can I either:-
a) prevent the dropdown from causing a postback when the item clicked is the selected item.
b) cause the dropdown to raise a server-side event from which I can re-bind the datagrid.
Any Ideas?
<ig:WebDropDown ID="DropDown1" runat="server" Width="140px" DisplayMode="DropDownList"> <AutoPostBackFlags SelectionChanged="On" /> <ClientEvents /></ig:WebDropDown>
Thanks,
I will look out for the service release.
Hi,
I agree with you that we should either not fire a postback (if no selection changed on the client), or fire a postback, but fire the selection event as well on the server side. I prefer the second option since it is more consistent.
I have created an bug for this problem, for your reference the bug number is: 21172
The fix should be there for the September Service Release.
Angel
Angel Todorov"] Hi, Can you use Page_Load, with a check for Page.IsPostBack? Thanks, Angel
Can you use Page_Load, with a check for Page.IsPostBack?
Not really.
The example I gave was a simplified case to illustrate the problem. I actually have multiple pages affected by this bug. These pages have multiple dropdown lists and the SelectionChanged event of one list might alter the content and selection of another list. The data grid data is dependent on selected value of these lists - therefore I can't really bind the grid in Page_Load.
I could possibly use the LoadComplete event (after control events have fired) but this seems a clumsy work-around for a problem that should not happen.
It cannot be correct for a list to cause a postback but not raise an event.