This project is read-only.

Scrollbars within a cell.

Jul 22, 2009 at 10:16 AM
Edited Jul 22, 2009 at 10:19 AM

Hello all,

I am a newbie to dev, and especially C# so please forgive any ignorance.  (My code is - Shame I know :))

I am enjoying the SourceGrid.  It really does work well.  The one feature I can't find, and I will be surprised if it doesn't exist is the ability to scroll within a cell.  I populate a cell with information from a SQL Memo field, which could contain a lot of information.

I have it working so that if the user double clicks on the cell it adjusts the cell height to 200 (double click again and it goes back to 20).  This works well.  But sometimes the information is still too much for the cell to display.  Is there a way to have a scrollbar inside the cell?

I have the following code.
(I have remarked out the code I have tried because it doesn't work.) 

Thanks in advance for your help



_____________________________________________ Code Starts Here ____________________________

Sub GridCandidateHistory_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridCandidateHistory.DoubleClickOn Error Resume Next


'This expands the Row size when you double click on an activity With GridCandidateHistoryDim MRow As Integer
Dim MColumn As Integer 
'Dim scrol As ScrollBar
MRow = .MouseCellPosition.Row
MColumn = .MouseCellPosition.Column


If .Rows(MRow).Height >= 100 Then
.Item(MRow, MColumn).View.WordWrap =
.Rows(MRow).Height = 20
ElseIf .Rows(MRow).Height < 100 Then
.Item(MRow, MColumn).View.WordWrap =
.Rows(MRow).Height = 200
.Item(MRow, MColumn).View.TextAlignment = DevAge.Drawing.ContentAlignment.TopLeft
' .Rows(MRow) = .ScrollStateVScrollVisible 
'Dim l_MultilineEditor As SourceGrid.Cells.Editors.TextBox 
'l_MultilineEditor.Control.Multiline = True 
'GridCandidateHistory(MRow, MColumn).Editor = l_MultilineEditor 
End If 
End With 
End Sub


Jul 22, 2009 at 11:29 AM

I haven't tested it yet, but in the Patches section ( someone posted a option for RichTextBox integration in SourceGrid. With it you should be able to manage big amounts of data and scrollbar(s).

But I don't know SourceGrid so good, perhaps will somebody know another option!

Jul 22, 2009 at 11:31 AM
Why don't just just put a panel control in a cell, and turn on scroll bars etc? In the sourcegrid sample project you should be able to find the example of putting a progress bar in a cell, it is the same approach.
Because sourcegrid is a .NET assembly, there is no reason why you can't use sourcegrid in Vb.NET.
Jul 23, 2009 at 9:24 AM

Thanks Jray and Derek,

I will look into both of your suggestions.  I am not sure I understand what you are meaning, but I am sure it will make sense once I start digging.  Thanks again for your response.

(PS. Derek, SourceGrid works perfectly in VB,net - it is just that I can find very few examples of VB code for SourceGrid on these forums.  Most is in C# and for a newbie like myself, it makes it difficult to make sense of the examples.  I have managed to get most of what I need right, I must just get this right now). 



Jul 23, 2009 at 1:47 PM
Edited Jul 23, 2009 at 1:48 PM

I'm using also , no problem  until i am using DotNet platform ,

this file is a traducted project for sourcegrid en , i used sharpdevelop to do it  .

Enjoy !