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
Hello Surabh,
Could you please explain what is exactly your issue ? I made few quick tests and I think that everything works properly. I were able to click on a partial visible rows.
Give us more details about your issue ?
Thanks for your reply.
Here is the issue. As you mentioned code above in this forum I am able to hide partial visible row from grid. but now when I hide partial visible row there is a blank space instead of that one can we expand last grid row or expand each row height on grid so that here will be no partial row on grid.
Here is the screen shot I attached. In that I have 500 rows on grid but I hide last partial visible row so you can see there is a gap at the end of the grid although there are lot row below it.
Attachment.
Hello Saurabh,
Thanks for attached screenshot. Maybe will be better to mention that you are using CreationFilter to achieve this functionality. So if you take a look on Mike`s suggestion in that forum thread http://es.infragistics.com/community/forums/p/40334/431966.aspx#431966 you will see that you should modify your CreationFilter and set appropriate Row.height.
Please take a look on attached sample and video for more details and if you have any questions, feel free to write me.
Here is the sample
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.