when add a new row and focus it, how to only display this row and row-header.

Jun 16, 2009 at 7:48 AM

hi all, I need help from you with one question :

when I invoke grid.selection.focusrow(rowcount - 1)  (do this to focus the last row), I hope the grid screen just show the new row and the row-header(at this time there is just two rows in grid, one is header, another is the new row to edit), please note that I can scroll to show other rows by clicking the verital scrollbar.  please help to tell me if there is any way to do it?

I could not do it in ?version4.20

thanks.

=biosrs=

Coordinator
Jun 16, 2009 at 10:56 AM

I did not understand what is the problem.

Jun 16, 2009 at 12:55 PM
If there are only two rows, how can you scroll? Can you try to be a bit more clear.
 
If the "row" or "cell" is visible the screen will not scroll, if you are trying to move the scrollbar position after you add a row, you can set the value for the VScrollBar. focus will not scoll the grid unless that cell is not visible.
 
Hope that helps

On Tue, Jun 16, 2009 at 3:48 AM, biosrs <notifications@codeplex.com> wrote:

From: biosrs

hi all, I need help from you with one question :

when I invoke grid.selection.focusrow(rowcount - 1)  (do this to focus the last row), I hope the grid screen just show the new row and the row-header(at this time there is just two rows in grid, one is header, another is the new row to edit), please note that I can scroll to show other rows by clicking the verital scrollbar.  please help to tell me if there is any way to do it?

I could not do it in ?version4.20

thanks.

=biosrs=

Read the full discussion online.

To add a post to this discussion, reply to this email (sourcegrid@discussions.codeplex.com)

To start a new discussion for this project, email sourcegrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jun 16, 2009 at 3:20 PM

thanks for your comments. it is not a bug, just a requirement :)

I mean that if we invoke grid.selection.focusrow(rowcount - 1) to focus the last row in commonly, in grid , we have headers, grid rows data, and the new row to edit, at this time, the new row is the most far row from the row-header, and there are many rows between the header and the new row, it maybe cause input error, so I hope that, if we invoke focusrow(), how we can move the new row to be the second row to edit (), there are just two rows in grid, one is header, another is the new row to edit, and please note that we did not hidden the other rows, the new row is also the last row, the other rows are just upon the new row, if we want to see them , we can click the VScrollBar to display them ( the VScrollBar should be visible after invoke the focusrow() ).

I see that there is someone use sourcegrid3 to do is as upon said, and I did not find special codes for it :( , he just invoked focusrow(), I do not find sourcegrid3 so I created a discussion to know how we can do it in sourcegrid4

thanks everyone.

Jun 18, 2009 at 12:28 PM

is there anyone know how to do that?

Jun 18, 2009 at 3:43 PM

If I've understood, you would like to automatically scroll down to the a line (often the last one), and you want that this line is displayed at the top of the grid, just under the ColumnHeader/Fixed row ?

If yes, perhaps you'r looking for anything like this:

grid.Selection.FocusRow(grid.RowsCount);
grid.CustomScrollPageToLine(grid.RowsCount);

After that you'll have some problems if you use the VerticalScrollBar, but with the arrows it works. So I think that if you have a look at CustomScrollControl class, you will find what you need!

 

Jun 18, 2009 at 4:44 PM
If you want to have the newest at the top, make sure you have a "key" field and just resort the grid after you add a row and it will appear under the header line.
~D

On Thu, Jun 18, 2009 at 11:43 AM, jray <notifications@codeplex.com> wrote:

From: jray

If I've understood, you would like to automatically scroll down to the a line (often the last one), and you want that this line is displayed at the top of the grid, just under the ColumnHeader/Fixed row ?

If yes, perhaps you'r looking for anything like this:

grid.Selection.FocusRow(grid.RowsCount);
grid.CustomScrollPageToLine(grid.RowsCount);

After that you'll have some problems if you use the VerticalScrollBar, but with the arrows it works. So I think that if you have a look at CustomScrollControl class, you will find what you need!

 

Read the full discussion online.

To add a post to this discussion, reply to this email (sourcegrid@discussions.codeplex.com)

To start a new discussion for this project, email sourcegrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jun 19, 2009 at 4:01 PM

thanks to abirdd&jray:

@abirdd : I hope to see just the new row to edit after clicked "add" button, no other rows, so I should not use your advice

@jray : yes, the effect you said is what I want, and I test your codes in Sourcegrid version2009.05.15, and found that the CustomScrollPageToLine() can get this effect, but it just happened when the grid has rows more than one page, and the effect displayed not smoothly yet( I can see the new row flashed at the bottom once then displayed in the top of the grid ), Is it a bug? I don't know.

Jun 26, 2009 at 7:34 AM

Is anyone have advice or is it a bug? thanks.

Jun 26, 2009 at 12:06 PM
I still do not understand what the problem is, I have row headers and when I add new rows, I can focus them just fine. Could be a language issue.
 
Why don't you modify one of the examples to show how it is a bug, then we can help fix it? You could also try to help fix it.
 
~D

On Fri, Jun 26, 2009 at 3:34 AM, biosrs <notifications@codeplex.com> wrote:

From: biosrs

Is anyone have advice or is it a bug? thanks.

Read the full discussion online.

To add a post to this discussion, reply to this email (sourcegrid@discussions.codeplex.com)

To start a new discussion for this project, email sourcegrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jun 26, 2009 at 6:04 PM

If you do not want to display all other rows just set them to Visible = false

Jun 26, 2009 at 11:31 PM

thanks Lafriks , but if set them visible to be false, how to show them in operation? so I hope just press the vscoller to show them

@abirdd : I do not it is really a bug, it just showing not smoothly when page > 1, and when page == 1, no effect showing, it is not same as sourcegrid3, that puzzled me.