Need to add new row when TAB out of the last cell of the the ag-grid - angular5

Inside an ag-grid, if a user hits TAB, it automatically advances the user to the next field. If the user is in the last column in the grid and TAB's out, I would like that tab to automatically "add row" and position the cursor in the first column of the new row.
I have the code to add a new row.
I need to know how to programmatically determine a tab out in the last column/cell of the grid?

Related

Datagridview.Rows(#).Selected not updating CurrentRow.Index

VB.Net 4.6.1
Windows Forms application
I have a bound datagridview that I'm trying to sort and select. The data loads fine and I can click the headers (with some code) and the sorting works well. I'm working on reselecting a record after the sort is complete and I'm running into some trouble.
Assume that I have a datagridview with 20 records in it. On the form I also have a button that runs the following:
MessageBox.Show(MyDataGridView.CurrentRow.Index.ToString)
I also have a Sub that handles MyDataGridView.Sorted and in it I have one test line as follows:
MyDataGridView.Rows(2).Selected = True
After the data loads I click on the 11th record (selectionmode fullrowselect) and then I click the button. Box pops up and says "10" (0 based index). I click one of my column headers, the data sorts and the highlight bar jumps up to the 3rd record (index 2). However when I hit my currentrow.index button it still says 10. Additionally if I hit the down arrow key the selection bar jumps down to the 11th (index 10) record in the list.
It seems that using "Selected" doesn't update the currentrow.index value and since it is read-only I can't force it. Can anyone educate me on what's going on because, as it is, my users would be confused if the arrow up and down keys didn't work properly after a sort.
Thank you!
"Current" and "selected" do not mean the same thing. How could they, when multiple rows can be selected but there can only be one current row? The current row is the row that currently contains the caret and a selected row is one that is highlighted. If you want the row at index 2 to be the current row then you need to make a cell in that row the current cell, i.e. assign a cell in that row to the CurrentCell property.

Get the value of a cell on a ASPXGridview based on the button click

I have a ASPXGridview with a button as the first column for each of the rows. When I click a button I want it to perform a callback which will get me the value of the cell next to the button click. I'm a bit stuck on this so any advise would be great.
Thanks
I created a call back function to get key field name from a row on selection changed.
Then when I click on the button is gets the selected keys on the page.

How to get specific cell content in wxListCtrl

As the title said, can anyone give me a simple example how to get a specific cell's content in wxListCtrl.
For example, I build a wxListCtrl list, there may be 3 columns. When I Right click or Double click on one row, then it should popup a message box to give me the content in third column of this selected row?
Use wxListCtrl::GetItemText() to retrieve the contents of a cell.

Edit datagrid without clicking

I have a UltraGridWinGrid and I need to naviguate through it without using the mouse.
I can get to the grid with Tabs.
I can give focus to any rows with Tabs and Arrow Keys.
Once I highlight a row, how can I select a specific cell to edit it's content ? (All my cells are editable)
If you can modify the code that is executed when the TAB key is pressed, you can do manually select the next cell and start editing like this :
DataGridView.CurrentCell = theNextCell;
DataGridView.BeginEdit(true)
You still need to calculate which cell is next. This should be easy, increment the column index when you press tab, however if you reached the last column, just change row and set index to 0.
For the arrow keys, you could increment/decrement column or row index, depending of the arrow, and apply the same code as above.

changing the position of textbox using code

In my form I have an AXVS Flex Grid and a Textbox. Firstly the textbox will not be visible.
When the focus is on a particular column of the flexgrid, the textbox will be visible and the Flex Grid will be disabled. The position of the text box will be at the bottom of the particular row at the first time.
But when another row is inserted, then I need to change the position of the textbox to the bottom of the new row and so on.
How can I do that? Thanks in advance.
Position of a control can be retrieved and set using the Top & Left properties of the control.
So you can get the Top,Left property of the inserted row and set the Top,Left property of TextBox accrodingly.
e.g.
TextBox1.Top = InsertedRow.Top +=10
TextBox1.Left = InsertedRow.Left
This will bring the textbox below inserted row.