Hi,
If somebody could help me determine how to find the current column position of an active cell in contrast to the DataTable or visible/displayed grid.
I found how to get the current row of the activated cell, which is "ultragrid.ActiveCell.Row.VisibleIndex". So I was assuming that I could find the columns in "ultragrid.ActiveCell.Columns" but unfortunately I could not find a particular property that will return it.
Thanks,
Aaron
Hey Mike,
Something went really weird.... I am binding the grid to a constant datatable. This grid has a Column chooser. Let's say I have 5 columns and 3 rows, and I am currently in row 1 column 4. When I retrieve the ActiveCell.Column.Header.VisiblePosition, it returns me a 6... and then something worse happened, as I added columns and removed some. Now I have 7 columns and still 3 rows. Assuming I am in the 6th column, when I retrieve the ActiveCell.Column.Header.VisiblePosition again, it returned me a 9...
Now from the first call to the second call, the difference from the actual column being activated and returned by the function changed. Is this a bug, or I am doing something wrong...
itsguntus said: tCol = (UltraGridColumn)aUIElement.GetContext(typeof(UltraGridColumn)); tRow = (UltraGridRow)aUIElement.GetContext(typeof(UltraGridRow)); in tRow i am getting the row and index whereas in tCol always nothing when i click on column header. But if i select in grid data then i am getting value in tCol(column index).
tCol = (UltraGridColumn)aUIElement.GetContext(typeof(UltraGridColumn));
tRow = (UltraGridRow)aUIElement.GetContext(typeof(UltraGridRow));
in tRow i am getting the row and index whereas in tCol always nothing when i click on column header. But if i select in grid data then i am getting value in tCol(column index).
The column header UIElement probably doesn't have a context of the column, then. In that case, you probably have to get a context of the ColumnHeader and use the Column property on that.
Thanks Mike! It worked = )
Hi Mike,
I want to get the selected column header name. for this i need selected column index of that grid.
Please check my following code.
Infragistics.Win.UIElement aUIElement;
aUIElement = ultraGrid1.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
UltraGridRow tRow;
UltraGridColumn tCol;
But the problem is i need to get column header name.
Ravi
Hi Aaron,
The visible position of a column is not necessarily straightforward, because of RowLayouts. If you are not using RowLayouts, then you can use cell.Column.Header.VisiblePosition.