I want to update cells from javascript. I do this after a callback to a web service. The cells belong to columns with DropDownProvider editors. The DropDownProviders have DropDownItems's created with text and value. i.e. we have things like Text = "ABS - Absent" and Value = "ABS". when the web service call returns I find the cell that needs updating and set its value to be "ABS". However I need it to display "ABS - Absent". I need a way to find, from the cell, the DropDownProviders DropDownItem's to select the correct one and set the cell text accordingly.
I do not create a DropDownProvider for each column I add to the grid. I reuse the EditorProviders, often we will have ten columns of the same basic data type so reusing them is attractive.
Hi Mike,
The technique you outlined above allows you to get notification on selection changed if the editor is open. This is not what I was asking, allow me to clarify.
I dynamically generate all columns in the code behind. The grid has different types of columns for different users and our drop down providers have different items in them depending on the users configuration.
We perform update to the server on cell ending edit. We do our validation on the server and then send data back. Sometimes when a cell value changes it changes other cells in the grid. (as these are calculated)
In a simple scenario we could have two columns. In both columns we have the same drop down provider. When we change a value in column A, I send the result to the server, the server responds with a message telling me that the value in column B should change to the same value. The hassle lies in the fact that the value in column A was "ABS - Absent" (text is "Absent", value is "ABS") but the underlying value is just "ABS". "ABS" is the value I send to the server and the server sends back "ABS" as the value that needs to be in column B. When I set the cell value in column B it is set to "ABS", but I want it to say "ABS - Absent" to be consistent.
So back to the beginning again. If I have access to the drop down providers list of values from javascript I can perform the necessary translation myself. If when I called the method cell.set_value("ABS") it set the value to "ABS" and the displayed value to "ABS - Absent", I could work around my issues.
This is not the only situation for which I want access to this list of values. I would also like to implement fill down and up in the grid. In this case I will have an active cell which will have the displayed text being "ABS - Absent", in this case I need to get a list of all cells which I need to change, as I can get the value "ABS" by calling cell.get_value() and set all of the other cells to this value, then they will all display "ABS" instead of "Abs - Absent".
Please help me Im dying out here....
Hello Aran,
Thank you for submitting your inquiry to the Infragistics ASP.Net Forums. The WebDataGrid has Client-Side events which are available for the EditorProviders used in the grid. From the description you provided, I was able to retrieve the text value for a new selection in the embedded WebDropDown with the client-side WebDataGrid DropDown SelectionChanging event using the following code:
var arun = eventArgs.getNewSelection()[0].get_text();
The following instructions explain how to set up the SelectionChanging client-side event for the WebDropDown EditorProvider you would like to update for the Cells:
1.) Open the aspx page in Design view with the WebDataGrid 2.) Click on the WebDataGrid smart tag located on the top left-hand side of the grid3.) When the WebDataGrid Tasks window display, click the Edit Grid Editor Providers link to open the Edit Grid Editor Providers window4.) In the left-hand pane, select the appropriate DropDownProvider and the properties will display in the right-hand pane5.) In the right-hand pane, click the plus sign next to EditorControl to expand the DropDownProvider properties6.) Click the plus sign next to ClientEvents to expand the events7.) Click in the right-hand field next to the SelectionChanging event, click the displayed drop down arrow and select Add new handler in the drop down list. The Addnew client side event handler will display with the default name for the event. Select OK to accept and close the window.8.) In the Edit Grid Editor Providers window, select Apply, then OK to close the designer9.) Go to the Markup Code, locate the SelectionChanging event. In the SelectionChanging event, the following code demonstrates how to retrieve the newly updated cell value:
Add the above event and code to your application. Set a break point after the above line of code and check its value. Please let me know if this information is helpful or if you need further assistance.
Thank you.
Sincerely,Mike D.Developer Support EngineerInfragisticswww.infragistics.com/support
**bump**
I got the same problem. Any one??