Grid Navigation

When the user hits ENTER after entering value in a cell, I want the control to move to another particular cell. I’m working on this. But am just wondering whether this feature is already supported? In that case, I don’t want to reinvent the wheel :slight_smile:


Is there any equivalent server side functions for the client side functions GridWeb1.setActiveCell()? getActiveCell()?

Thanks.

Hi,

When the user hits ENTER after entering value in a cell, I want the control to move to another particular cell. I'm working on this. But am just wondering whether this feature is already supported? In that case, I don't want to reinvent the wheel :-)

Yes, it's already supported same as MS Excel.

Is there any equivalent server side functions for the client side functions GridWeb1.setActiveCell()? getActiveCell()?

Please use WebCell.ActiveCell property for it.

Suppose you want to get this on an Asp.NET button click, please check below:

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
//You have to specify the button in such a way that it should submit the grid's data.

Button30.Attributes["onclick"] = "GridWeb1.updateData(); return GridWeb1.validateAll();";
}
}

On button's click event you can handle as follows:

private void Button30_Click(object sender, System.EventArgs e)
{
WebWorksheets sheets = GridWeb1.WebWorksheets;
WebWorksheet sheet = sheets[0];

WebCells cells = sheet.Cells;

cells["A1"].PutValue(GridWeb1.ActiveCell.Name);
}