Hello, I have the following RadGrid issue:
Multiple row selection is turned on.
Client side selection is turned on.
ASP.NET AJAX RadGrid version 2009.01.0402.35.
All of this is OK:
When I select a row and then postback, SelectedIndexChanged fires correctly.
When I select a 2nd row and then postback, SelectedIndexChanged fires correctly.
When I select a 3rd row and then postback, SelectedIndexChanged fires correctly.
When I deselect a row and then postback, there are two rows selected, and SelectedIndexChanged fires correctly.
When I deselect another row and then postback, there is one row selected, and SelectedIndexChanged fires correctly.
This is the problem: When I deselect the final selected row, so there are now no selected rows, and then post back, SelectedIndexChanged does NOT fire. It happens every time I deselect the final selected row, regardless of how much selecting/deselecting I do.
Here is my ASPX code:
Everything works fine until that last selected row is deselected. All of the row deselection is done using CTRL-Click, and adding a selection column to the grid is not an option. Can you help me determine why SelectedIndexChanged does not fire when the last selected row is deselected? Thank you.
Rich
Multiple row selection is turned on.
Client side selection is turned on.
ASP.NET AJAX RadGrid version 2009.01.0402.35.
All of this is OK:
When I select a row and then postback, SelectedIndexChanged fires correctly.
When I select a 2nd row and then postback, SelectedIndexChanged fires correctly.
When I select a 3rd row and then postback, SelectedIndexChanged fires correctly.
When I deselect a row and then postback, there are two rows selected, and SelectedIndexChanged fires correctly.
When I deselect another row and then postback, there is one row selected, and SelectedIndexChanged fires correctly.
This is the problem: When I deselect the final selected row, so there are now no selected rows, and then post back, SelectedIndexChanged does NOT fire. It happens every time I deselect the final selected row, regardless of how much selecting/deselecting I do.
Here is my ASPX code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddressTypes.aspx.cs" Inherits="foo.AddressTypes" %><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><html> <head runat="server"> <title>Test Page</title> </head> <body> <form runat="server"> <asp:ScriptManager ID="sm" runat="server" /> <asp:ObjectDataSource ID="gridDS" runat="server" TypeName="foo.AddressTypes" SelectMethod="GetRecords" /> <telerik:RadGrid ID="grid" runat="server" DataSourceID="gridDS" OnSelectedIndexChanged="Grid_SelectedIndexChanged" AllowMultiRowSelection="true"> <ClientSettings> <Selecting AllowRowSelect="true" /> </ClientSettings> </telerik:RadGrid> <asp:Button ID="button" runat="server" Text="Postback" /> </form> </body></html>Here is my code-behind:using System;using System.Collections.Generic;using System.Web.UI;namespace foo{ public partial class AddressTypes : Page { protected void Page_Load(object sender, EventArgs e) { } public static Dictionary<string, string> GetRecords() { Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("Test 1", "Test record number 1"); dict.Add("Test 2", "Test record number 2"); dict.Add("Test 3", "Test record number 3"); dict.Add("Test 4", "Test record number 4"); dict.Add("Test 5", "Test record number 5"); return dict; } protected void Grid_SelectedIndexChanged(object sender, EventArgs e) { Response.Write("SELECTED INDEXES: " + grid.SelectedIndexes.Count); } }}Everything works fine until that last selected row is deselected. All of the row deselection is done using CTRL-Click, and adding a selection column to the grid is not an option. Can you help me determine why SelectedIndexChanged does not fire when the last selected row is deselected? Thank you.
Rich