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
Here ya go:
WebDataGrid1.Behaviors.Selection.SelectedRows.Clear()
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
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
Dave-
Thanks for the reply. Yes, I stumbled upon the intellisense yesterday - it is very cool. However, I think the documentation on the online help is very lacking. Maybe this is because the recommendation to use the intellisense?
For example, here is a link for the selectedRows property on the Selection class.
How would anyone know from this documentation (or following any of the links on this page), how do the following:
Just my two cents.
Chad
Hi dunhamcd,
Every public method and property on the client side for the WebDataGrid can be found in the link that you posted. You would go to the namespace link, then to the Selection behavior and dig down from there. I also see you posted the 10.2 link, so I assume you have that version. If you used VS 2010 and use our WebScriptManager on your page, you will be able to get intellisense off our our controls. Just follow the documentation on how to get it. Adding a client event stub should get you started.
regards,Dave
Is there any place to get the full listing of js functions available? for example, the following would put a collection into the object "selRows"
var selRows = grid.get_behaviors().get_selection().get_selectedRows();
If I wanted to know the length (or count) I would do ...
selRows.get_length();
However, I only got here by guessing. I have spent a lot of time going through the following document, but even this is not shown anywhere that I could find.
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.2/CLR4.0/html/WebDataGrid.html
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