Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
Finding DropDownProvider DropDownItem's from the Cell in Javascript.
posted

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.

Parents
  • 2501
    posted

    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 grid
    3.) When the WebDataGrid Tasks window display, click the Edit Grid Editor Providers link to open the Edit Grid Editor Providers window
    4.) In the left-hand pane, select the appropriate DropDownProvider and the properties will display in the right-hand pane
    5.) In the right-hand pane, click the plus sign next to EditorControl to expand the DropDownProvider properties
    6.) Click the plus sign next to ClientEvents to expand the events
    7.) 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 designer
    9.) 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:

     var arun = eventArgs.getNewSelection()[0].get_text();

    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 Engineer
    Infragistics
    www.infragistics.com/support

Reply Children
No Data