Add multiple rows to far point spread sheet control(7.0) in

Posted by: mounika-fp on 8 September 2017, 3:08 pm EST

  • Posted 8 September 2017, 3:08 pm EST

    <span style="text-align:left;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;">I added a context menu in farpoint spread control(7.0 version) with a textbox to give the number of rows to be added.I was trying to handle this through javascript.I used the command document.getElementById(spreadsheet).Add(index,no of rows).But this command always adds single row to the end of the spread sheet component.I wanted to add a the user specified rows after the active row.Is it possible in javascript?If this is not possible through javascript, is there a way to handle it through a event handler over the context menu item? I dont see any event handlers over the context menu item in VS.I can do it in C# if I can have an event handler over the contextmenu item.Any help would be appreciated.</span>
  • Replied 8 September 2017, 3:08 pm EST


    You should be able to listen to the FpSpread1_MenuItemClicked event server side. Here you can get to know which item is clicked if you find this to be "Add Row" you can add a row at desired postiion. For example:

     <span style="COLOR:#0000ff;">Protected</span> <span style="COLOR:#0000ff;">Sub</span> FpSpread1_MenuItemClicked(sender <span style="COLOR:#0000ff;">As</span> <span style="COLOR:#0000ff;">Object</span>, eventArgs <span style="COLOR:#0000ff;">As</span> FarPoint.Web.Spread.MenuItemClickEventArgs) <span style="COLOR:#0000ff;">Handles</span> FpSpread1.MenuItemClicked

    If eventArgs.SelectedItem.ToString()
    =="Add Row" Then

    'Do your stuff

    End If

    <span style="COLOR:#0000ff;">End Sub</span>



  • Replied 8 September 2017, 3:08 pm EST


    Thanks for the reply.It works.I also wanted to know if we could add a context menu item like this : Have a label saying Add Rows and a textbox for the user to enter the number of rows.And get the value in the textbox and add those many rows.

  • Replied 8 September 2017, 3:08 pm EST


    It is a very unique and interesting requirement. But I doubt if it is a feasible enough to implement. I have attached a sample application showing adding a row with context menu client side, Please have a look at it.

    Now coming back to your requirement,  instead of showing a text box in context menu we can show a modal pop up window on selection of "Add Rows" from context menu with a TextBox in it. Later we can get the number entered in the text box and call FpSpread1.Add() method same number of times to add rows. I do not have a sample application right now to demonstrate this but you may try this at your end and let me know if need any assistance.



Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels