setActiveCell

I’m using Aspose Cells GridWeb.


How can I make a cell active when another cell is already active?

Say,I have the following code,

GridWeb1.setActiveCell(15,15);
GridWeb1.ActiveCell = null;
GridWeb1.setActiveCell(25,25);

When I type data, the data gets entered in the first cell. How can I make the cursor move to the second cell? Thanks in advance.

Hi,


I think you may create a client side function in Javascript and write the line of code i.e.,

GridWeb1.setActiveCell(25,25);” or “this.setActiveCell(25,25);” etc. in it and then use the GridWeb’s attribute OnCellSelectedClientFunction to specify the Javascript function, see the sample code snippet below for a web form’s .aspx file.




// Client side event handlers
function onCellSelected(cell)
{
this.setActiveCell(25, 25);
}




<acw:GridWeb ID=“GridWeb1” runat=“server”
onsubmitcommand=“GridWeb1_SubmitCommand” OnCellSelectedClientFunction = “onCellSelected”>…
</acw:GridWeb>

Hope, this helps a bit.

Thank you.