I was hoping that you could help me determine a way around a problem that I'm having with partially visible rows in the UltraWinGrid. When you have an UltraWinGrid that has a partially visible grid row and you attempt to double click that row, the row becomes fully visible and the next row is now under the mouse. The new row is then returned as the row that was double clicked. It's almost like the double click handler doesn't know that the selected row changed in between the clicks. I provided an image below so that you can see what I'm talking about when I say not fully visible. The last row shows a partial row. Any suggestions that you have are appreciated.
Thanks, Stephen
Hi Stephen,
Please let me know if I may be of any further assistance regarding this issue.
If you have any questions please let me know.
Sincerely,
Chris K
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
Thanks for getting back to me on this. I went back and looked at my initial post and noticed that it doesn't really explain the problem. I apologize for the terrible explanation. Let me try it again.
First off, the black boxes in the screenshot were only there to hide sensitive data from this post. It's not actually there in real life. I modified your sample to show what I'm talking about. When you run the example, notice that Row12 is partially visible at the bottom of the grid. When you try to double click that row, Row 13 is scrolled into view. The row on e.Row in the event handler is Row13, not Row 12 as you intended to double click. In reality, 1 click was on Row12 and the other was on Row13. We had the situation where users were thinking they were double clicking one row to open a record and they were getting an entirely different record due to this behavior.
I wrote some hack code to prevent them from selecting a row that wasn't entirely in view as a work around.
Thanks,Stephen
Hi,
Could you please modify my sample to reproduce your scenario and issue and I`ll be glad to research it for you.
Let me know if you have any questions.
Thanks for our reply.
I was looking sample which one is provided by Chris because we have same issue which is mentioned in this forum.
but in this sample when I click on last partial visible rows it's considering last two rows.
It's so confusing.
Can you please explain it and provide me a solution for it?
Thanks
Did you take a look on this sample : WindowsFormsApplication223 (2).zip ???
What is the issue with that sample ?
I am using same code in my application . I don't see any partial visible rows but when I click last fully visible rows , next row is under the mouse.
Here is my code with hyperlink in my grid.
Public Sub AfterCreateChildElements(ByVal parent As Infragistics.Win.UIElement) Implements Infragistics.Win.IUIElementCreationFilter.AfterCreateChildElements
If TypeOf parent Is HeaderUIElement Then
Dim aColHeader As ColumnHeader
aColHeader = CType(parent, HeaderUIElement).Header
If aColHeader.Column.Key = oKey Then
Dim aTextUIElement As TextUIElement
Dim aCheckBoxUIElement As CheckBoxUIElement
aCheckBoxUIElement = parent.GetDescendant(GetType(CheckBoxUIElement))
If aCheckBoxUIElement Is Nothing Then
aCheckBoxUIElement = New CheckBoxUIElement(parent)
End If
aTextUIElement = CType(parent.GetDescendant(GetType(TextUIElement)), TextUIElement)
If aTextUIElement Is Nothing Then Exit Sub
Dim aheader As ColumnHeader = CType(aCheckBoxUIElement.GetAncestor(GetType(HeaderUIElement)).GetContext(GetType(ColumnHeader)), ColumnHeader)
If aheader.Tag Is Nothing Then
If oCheckState Then
aheader.Tag = Windows.Forms.CheckState.Indeterminate
Else
aheader.Tag = oCheckState
aCheckBoxUIElement.CheckState = CType(aheader.Tag, Windows.Forms.CheckState)
AddHandler aCheckBoxUIElement.ElementClick, AddressOf aCheckBoxUIElement_ElementClick
parent.ChildElements.Add(aCheckBoxUIElement)
aCheckBoxUIElement.Rect = New System.Drawing.Rectangle(parent.Rect.X + 6, parent.Rect.Y + ((parent.Rect.Height - aCheckBoxUIElement.CheckSize.Height) / 2), aCheckBoxUIElement.CheckSize.Width, aCheckBoxUIElement.CheckSize.Height)
aTextUIElement.Rect = New System.Drawing.Rectangle(aCheckBoxUIElement.Rect.Right + 3, aTextUIElement.Rect.Y, parent.Rect.Width - (aCheckBoxUIElement.Rect.Right - parent.Rect.X), aTextUIElement.Rect.Height)
If Not aCheckBoxUIElement Is Nothing Then
parent.ChildElements.Remove(aCheckBoxUIElement)
aCheckBoxUIElement.Dispose()
If TypeOf parent Is RowColRegionIntersectionUIElement Then
Dim elementsToRemove As New List(Of UIElement)()
Dim elementsToIncrease As New List(Of UIElement)()
For Each rowUIElement As RowUIElement In parent.ChildElements.OfType(Of RowUIElement)()
If rowUIElement.Rect.Bottom > parent.Rect.Bottom Then
elementsToIncrease.Add(prevRowUIElement)
elementsToRemove.Add(rowUIElement)
AddHeight = parent.Rect.Bottom - prevRowUIElement.Rect.Bottom
Continue For
prevRowUIElement = rowUIElement
rowUIElement.Row.Height = 20
Next
For Each element As UIElement In elementsToRemove
parent.ChildElements.Remove(element)
For Each element As RowUIElement In elementsToIncrease
element.Row.Height = element.Row.Height + AddHeight
If TypeOf parent Is CellUIElement Then
parent.Rect = New Drawing.Rectangle(parent.Rect.X, parent.Rect.Y, parent.Rect.Width, parent.Parent.Rect.Height - 1)
End Sub
Hi Georgi,
I am waiting for your reply..