Hi, I have a WebDataGrid, I fill them with a DataTable obtain when the user select a DropDownList opcion, if I select a row and change the selection in the Drop Down, if I try the select the same row I can't, in the ASP.Net GridView I can use GridView.SelectIndex = -1 to unselect the row selected after the databind, in the Infragistic WebDataGrid how can I do that to unselected the row?
Thanks
Jose
Hi Tks,
Try :
grid.get_behaviors().get_selection().get_selectedRows().clear();
regards,David Young
Hi,
I have the same situation, but this method not solve. My code:
function
buttonClose_Click() {
var grid = $find("ctl00_CPC_GridData");
grid.get_behaviors().get_selection().get_selectedRows().remove();
}
It's fine?
Tks
The statement I provided is not a javascript statement... it's a codebehind statement. That statement would fail if placed in javascript.
If you absolutely have to do it in javascript, this may help...
I don't have time to construct the actual statement for you, but this document says you can use the selectedRows property of the Selection behavior to get a collection of selected rows in javascript.
According to the documentation, selectedRows is "A collection of rows that are currently selected in the WebDataGrid. To select a row, use the Add method off of the Collection. To unselect a row, use the Remove method off of the Collection.
This document is from the CSOM documentation for 10.2:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.2/CLR4.0/html/WebDataGrid~Infragistics.Web.UI.Selection~selectedRows.html
I tried to do that but give me the error javascript, I put the line before and after the datasource of the webdatagrid
Detalles de error de página web
Agente de usuario: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)Fecha: Thu, 8 Jul 2010 15:40:01 UTC
Mensaje: 'undefined' is null or not an objectLínea: 1404Carácter: 3Código: 0URI: http://localhost:1213/Infragistics_pruebas/ScriptResource.axd?d=poNM7zc6R79tAxovFulxHPCwlOWOsKN23wUm1KrqW66AayoEsiOS9zbR5UcnnFE0QkjLOw62VIm_C98aNC9xQ4cHxXPiMkPKEN2Slh4vVYAATr9hFKCA143f8cmGqUUikO4vmrY3I_ZVR21UL-EzmrinbynDiFoggHHOrMTGU1HBDZybuATHMvV80SMY6nzp0&t=634139338568437500
Here ya go:
WebDataGrid1.Behaviors.Selection.SelectedRows.Clear()