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
655
Auto row add with DropDownProvider
posted

Hello,

I have a webDataGrid only with one column and a DropDownProvider to add and edit row. To add a row, I select one value from dropdown, press enter and the new row is added. But I have a problem in mobile browsers (tablet or smartphone), because I don’t have the soft keyboard and when I select a value from dropdown I don't know how to do to add the value to a new row in the grid.

There is an option to add automatically a row when a value is chosen from the dropdown?

Thanks for your help.

  • 25665
    Offline posted

    Hello,

    Thank you for contacting Infragistics!

    You can handle the client side dropdown closed event and in that call _commitRow off the row adding behavior:

    http://www.infragistics.com/community/forums/t/71123.aspx

    • 655
      Offline posted in reply to Michael Peterson

      Hello,
      Thanks for your help. I’ve tried handle the client side dropdown closed event and in then call _commitRow as you said:

      In the grid:

      <ig:DropDownProvider ID ="ComboMaquinaria">
      <EditorControl DropDownContainerMaxHeight="200px" Width ="300px" EnableAnimations="False" EnableDropDownAsChild="False" ClientIDMode="Predictable" DisplayMode="DropDownList" >
      <ClientEvents DropDownClosed ="fAddRow" />
      </EditorControl>
      </ig:DropDownProvider>

      And the function:

      function fAddRow (sender, eventArgs) {
      var grid = $find("<%= wdgMaquinaria.ClientID %>");
      grid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._commitRow()
      }

      But after close dropdown, the new row is empty and insert a blank row.

      I fix this handle ExitedEditMode event:

      <ig:RowAdding AddNewRowCssClass ="CustomNewRow">
      <EditModeActions MouseClick="Single" />
      <ColumnSettings>
      <ig:RowAddingColumnSetting ColumnKey ="MAQUINARIA" EditorID="ComboMaquinaria" />
      </ColumnSettings>
      <AddNewRowClientEvents ExitedEditMode =" fAddRow " />
      </ig:RowAdding>

      But it's uncomfortable for user's select one element in the dropdown and click in other element to fire the event, select another value, click outside...

      Can I force fire the ExitedEditMode event in dropdown closed event for example? Or another solution to fix this problem?

      Thanks