<span style>Good evening!</span><div style><br></div><div style>Sample project, covered this message theme is attached to the mail. Screenshot that illustrates problem is attached too.</div><div style><br></div><div style>
I went into task of displaying multiline text in DBGrid cells and have success, but some features of the DBGrid scrolling is out of my understanding.</div><div style>If describe problem in short it lies in strange scrolling behaviour - sometimes, selected row may be invisible for user, because it locates under DBGrid</div>
<div style>viewport or DBGrid can fill with records only half of visible area<b>. </b></div><div style><b><br></b></div><div style>The code is very simple to understand:</div><div style>1. TMyDBGrid is descendant of TCustomDBGrid, that overrides PrepareCanvas procedure</div>
<div style>2. Within PrepareCanvas routine I set TextStyle with SingleLine=False and WrodBreak=True fields and also calculate dimentions of rectangle that can hold multiline cell text.</div><div style>3. Height of text I strore in corresponding element of RowHeights array.</div>
<div style><br></div><div style>All text appears multiline and well formated, but if you look at screenshot the two facts are obvious: selected row can be displayed under the bottom of the visible part of grid and grid itself sometimes displayed half filled.</div>
<div style><br></div><div style>So, the problem now: what things should I change to have correct scrolling.</div><div style><br></div><div style><br></div><div style>Best Regards, Andrey Smyntyna</div>