I have a question I came up with 3 days ago about how to do the blue underlining of a datagrid row programmatically. I thought to have found the solution, with just adding the column and row Indexes to the datagrids editedItemPosition Property.
It turned out, that this is just practical if you want to be able to edit the grids row right away. But what if I just want to underline it with the blue color?
Additionally how to detect that a list based Item got this kind of selection? es there a event to detect that? whats the name of this kind of selection?
Thanks for any Hints,
Markus
You can set datagrid.selectedIndex or datagrid.selectedItem to select a specific entry in the datagrid. The row will get highlighted (blue by default).
The dataGrid dispatches a change event in that case afair. And of course you can retrieve the selected item with datagrid.selectedItem.
Related
I'm having a QTableWidget with 9000 data. I can search data from the table, like, if I search for '10', whole data starting with '10' will be displayed.
Now I need to highlight the first row, since it shows the accurate search result.
I'm using:
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
for highlighting the selected row.
How can I highlight the first row of table?
I am not sure I am clear of why you need to set selection behavior unless you are planning for the user to be able to do the selection by clicking on the cells. And if you want that to be the default behavior then just set this as a property of the tableWidget when you use the QT designer.
But you can certainly do:
ui->tableWidget->selectRow(0);
That will highlight the row.
simple (?) question: what's the easiest way to programmatically change the style of an ADG cell most recently clicked by the user? Important note: I'm assuming cells not to editable and the selection mode to be singleRow, i.e. the specific cell needs to render differently from the standard highlight that comes with being part of the selected line.
I've found this great article that gets me pretty close, but I'm a bit stuck.
thank you for your help!
Never mind - I figured it out. I listen to the itemClick event on the ADG to figure out which cell has been clicked on, and then tweaked the code from the article above to only color the cell that has been clicked on.
How can I get back the focus to the column after editing datagrid by Keypress.Enter, so that I can move to another column using arrow keys. Now its stuck in the edited cell and I cant move to another column.
Thanks,
Rej
Use focusManager to setup focus of cell which should be presented inside of event.currentTarget
read next articles:
http://www.vaishalimistry.com/2005/12/15/set-focus-on-a-cell-in-datagrid-in-flex-20/
http://www.axelscript.com/2008/02/20/using-the-focusmanager-in-flex/
I want to select information in a single cell from my DataGrid in Flex 3.
Specifically, I'm displaying three phone numbers per line and the user needs to be able to select one of those numbers, from any row, but not the whole row.
While similar to this, I am displaying the DataGrid to the user. The answer for that question was to manipulate the dataProvider, how can I know what cell I've selected in order to do that?
Check this.
I'm looking for a DataGrid with expandable rows implementation in Flex. I don't want to use Advanced DataGrid control because it's too slow and too complex.
The desired behavior is like this: when you click a row, a panel opens between the rows with some details and the rest of the rows are moved down, and when you click again the panel is closed and the rows are back to normal. If you click the other row, the one that was expanded collapses and the row you clicked is expanded.
You'll probably need to use a custom ItemEditor that responds to clicks and expands itself.
The variableRowHeight property may need to be set to true as well.
The behavior you are describing sounds an awful lot like an Accordion component, though that doesn't quite sound like what you are looking for. Another approach would be to use a List component with a custom itemRenderer that is expanded when in the selected (clicked) state, and collapsed when not selected.
We extended Flex Datagrid component and used custom item renderer for this. We actually expand one cell and resize it to cover all other cells in the same row. While this may be not the easiest solution it works and the Datagrid is very fast.