Hi everyone
Since the RadGrid doesn't automatically postback when a user selects multiple items from the RadGrid using the SHIFT key, you have to do it manually. I've implemented this behaviour by subscribing to the the RadGrid's client-side OnRowSelected event. All I do in the mentioned event handler is calling the RadAjaxManager's ajaxRequest method (also on the client) to trigger the postback:
function RowSelected(sender, args) { |
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); |
ajaxManager.ajaxRequest('StrgShiftCombinationPressed'); |
} |
Should be that simple, but I have the following issue: Everytime I select multiple items with the SHIFT key, one item (actually, the last one) doesn't show up as selected after the postback. For example, if I select 4 items with the SHIFT key, first all the selected items are selected, but after the postback (and after the loading panel disappears), only 3 elements are selected.
To see what's going on on the server-side, I added an event handler for the RadGrid's server-side OnSelectedIndexChanged event. In the event handler, the grid.SelectedItems collection counts also one element less than selected (e.g. 4 items are selected with the SHIFT key, but grid.SelectedItems.Count evaluates to only 3). Also, if I select only one row with the SHIFT key pressed, the RadAjaxManager's server-side OnAjaxRequest is fired, but not the RadGrid's OnSelectedIndexChanged event (I have to mention, that I added the following AjaxSetting to the RadAjaxManager: radAjaxManager.AjaxManager.AjaxSettings.AddAjaxSetting(((MyMaster)this.Master).ajaxManager, radGrid) ). When I select 2 items with the SHIFT key pressed, the OnSelectedIndexChanged is fired!
This issue has been bothering me for quite a long time, and I would be very thankful if somebody could successfully point me where I'm doing something wrong.
Thanks in advance.
Greetings,
Mallory