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 Georgi,
I am waiting for your reply..
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
Did you take a look on this sample : WindowsFormsApplication223 (2).zip ???
What is the issue with that sample ?
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
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.