Why not editable cell has a cursor? - grid

I have a grid, I have set:
this.gridColAlias1.AppearanceHeader.Options.UseTextOptions = true;
this.gridColAlias1.AppearanceHeader.TextOptions.HAlignment =DevExpress.Utils.HorzAlignment.Near;
this.gridColAlias1.OptionsColumn.AllowEdit = false;
I see the column on my grid is not editable, but anyway I see a cursor on the cell of that column and hence it pretends editable. Why this happens and how could I get rid of the cursor?
Thanks!

What do you mean when you talk about the cursor? There is no cursor (caret) within the cell when the OptionsColumn.AllowEdit property is set to false. Maybe you mean a focus rectangle?To avoid the focus rectangle to be drawn on the particular column cell, you can make this column unfocusable via the OptionsColumn.AllowFocus property.

Related

How to get the cursor position in a cell of QTableWidget

I have a QTableWidget and I need to know the position of the cursor in a cell.
For QLineEdit there exists a function QLineEdit::cursorPosition( ).
Is there something similar for a cell in a QTableWidget or for a QTableWidgetItem?
Or any other method how I can find out the cursor position of the currentItem?
I hope it gets clearer with this picture. I have entered the cell item of row 27 and started to edit the cell item. The blinking cursor is between the second and the third Hallo. I want to find out at which position this blinking cursor is in the cell (same as for QLineEdit::cursorPosition)
Check this method:
QTableView::rowAt() - https://doc.qt.io/qt-5/qtableview.html#rowAt

Selected Item losing Highlight in QTableView

I have a problem with the extendedSelection of my QTableView.
The Problem is that i have some whitespace around my columns and rows and when i click this whitespace the highlighting of my selected Fields is lost.
Its not ocurring when i click somewhere else in my application, only in the whitespace.
Also when i set the selection mode to SingleSelection it works just fine.
here is a short gif to illustrate the problem
https://gyazo.com/8e4ae161aaff25a4afa1b588579ddd01
thank you everyone who can help me
sincerely
Because that white region belongs to QTableWidget, so when you click that place it resets the selection and selected cell is gone since none of cell is selected. But when you click outside of the QTableWidget, selection state still exists.So If you do not want to this, you can increase column widths like this:
ui.tableWidget->setColumnWidth(columnNumber,columnWidht);
or you can decrease the width of QTableWidget to fit the columns. So user can not see and click this white region.

Flex: Make ComboBox dynamically resize so that it will always fit its contents?

I've got a combo box like this:
<mx:ComboBox dataProvider="{someArrayCollection}" />
But when the contents of someArrayCollection change, it leaves the combo box too small:
How can I trick the combo box into automatically resizing to fit the label of the largest item?
So the problem is that the ComboBox doesn't invalidateSize() after the dataProvider dispatches a COLLECTION_CHANGE event.
Lame.
It can be fixed by calling myComboBox.invalidateSize() when ever the dataProvider dispatches a COLLECTION_CHANGE.
Basically, you just loop over the dataProvider, measure the width of each item's label, and keep track of the largest one.
I sort of built this into the Flextras AutoCompletComboBox. There is a property named expandDropDownToContent which expands the drop down so it has no scroll bars, but it will not inherently expand the prompt portion.
The Spark DropDownList has a property named typicalItem which does something similar. Oddly that property does not seemed to be defined in the DropDownList at this time.
12/23/3011 update
Since this keeps getting downvoted, I wanted to explicitly state. When the MX/Halo ComboBox sizes itself automatically, it does so based on only the initial items that will be displayed in the drop down. If you don't loop over all items in the dataProvider to determine the proper size of the ComboBox/DropDown then items may be cut off regardless of whether you call invalidateSize() or not when items in the dataProvider change.

How to select Row in QTableView?

I am new to QT, and I'm using QTableView, as shown below:
On the left side of the table, Qt is automatically showing a row number, as I've noted in red. How do I get rid of these numbers?
My other problem is, if I click any cell, only that cell is selected. How can I make it to where, when a user clicks a cell, the entire row is selected, like I noted in pink? For example, if I click the testApp-copy.itr cell then the entire third row should be selected.
Use
table->verticalHeader()->hide();
to get the vertical header and hide it, and
table->setSelectionBehavior(QAbstractItemView::SelectRows);
to make QTableView only select whole rows.
You may also want to specify the selection mode.

Highlight selected cell of a flex data grid

I have a flex data grid.I need to highlight the selected cell of the data grid.can u please help me?
AdvancedDataGrid does have a property selectionMode. Change property value single cell or multiple cells, you can select and highlight cells.
DataGrid automatically highlights the selected row (see the examples)
If you're looking for a table-like component, check out Grid or Tile.
It would also help if you would post your source code so that we would know what you are trying to achieve.
I know data grid automatically highlights the selected row.But I'm not searching for row highlight. I'm searching for cell highlight.For example say if I will click on 1st cell of data grid, instead of highlighting the first row it will only highlight the first cell(row-0,col-0)
Thanks!
by setting datagrid property -> selectionMode="singleCell"

Resources