We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Lock Grid Row

I am using the grid with a virtual data. I am trying to implement an in-cell editing action. I want to be able to keep the cell being edited in its current position during the edit action. I attempt to do this by changing the top index. When I so this I get a flickering action. Is there a better way of doing this. Is it possible to place the grid in a mode where you say keep data 30 row on grid visible row 12? Thanks.

4 Replies

AD Administrator Syncfusion Team March 11, 2005 10:25 PM UTC

I do not understand. What is causing the grid to scroll? Normally, when you type in a cell, the cell does not scroll vertically.


AD Administrator Syncfusion Team March 12, 2005 12:41 PM UTC

What is happening is that the data tht is being presented in the grid is changing. For example lets say you are editing a dictionary. You are editing the definitiaon of the word "Hello" which is on item 25 of the data and on line 10 of the grid (top index of grid = 15). While you are editing the database gets changed and now the word "GoodBye" is entered. Due to this addition the, word "Hello" is now index 26. In normal grid processing this would shift it to line 11 on the grid (Top Index still = 15). I am not sure but I belive that the CurrentCell will remain at line 10. What I would like to happen is that the edit box remains active and in it current state, with the row "Hello" and not move from visible row 10 in the grid. This is a simplified version of what happens in my applications. In my application the number of inserts/removals can be 100''s per second. And if the edit box is jumping around, it would be very difficult for the user. >I do not understand. What is causing the grid to scroll? Normally, when you type in a cell, the cell does not scroll vertically.


AD Administrator Syncfusion Team March 12, 2005 01:03 PM UTC

What kind of grid are you using? GridControl, GridDataBoundGrid or a GridGroupingControl? With a virtual GridControl, any updating you do on the outside data source should not affect anything in the grid. In fact, the grid will not actually show the change until you explicitly call grid.refresh or grid.RefreshRange or grid.Invalidate/Update or soemthing else to trigger a paint message. Are you listening to some kind of change event on your external datasource, and then doing some kind of call to trigger the draw. If so, exactly what are you doing in your code at that point? The code at that point might be causing the behavior you are seeing? Try commenting it out. Does the problem go away?


AD Administrator Syncfusion Team March 12, 2005 04:16 PM UTC

Steve, check out also the GridControlBase.InternalSetTopRow method. It lets you change the top row index without scrolling the grid, e.g. if a record gets inserted before the current display. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon