|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Show dynamically selected row in datagridviewI have a datagridview which is populated via a datatable.
What I would like to dynamically set a selected row and have that row show up in the datagridview and not have to manually scroll to find the selected row. I had a look for all kind of "datagridview1.rows(i).focus" but there doesnt seem to be anything. Can anyone help? I know this must be quite simple to do but cant find it. try:
me.DataGridView1.Rows.Item(x).Selected = true where x is the row you want to select -- Show quoteHide quote--ewok MCSA+M,MCSE, MCSD, MCDBA,MCITP "Karl Rhodes" wrote: > I have a datagridview which is populated via a datatable. > > What I would like to dynamically set a selected row and have that row > show up in the datagridview and not have to manually scroll to find the > selected row. > > I had a look for all kind of "datagridview1.rows(i).focus" but there > doesnt seem to be anything. Can anyone help? I know this must be quite > simple to do but cant find it. > > Thanks ewok, but i did try this.
While it selects the row ok, it doesnt bring this selected row to the datagrid 'window'. This means if the datagrid is long and the selected row is the last row, only the top rows are still visible. I would like to have the datagrid automatically scroll so the selected row is visible in the datagrid pane ewok66 wrote: Show quoteHide quote > try: > > me.DataGridView1.Rows.Item(x).Selected = true > > where x is the row you want to select > > -- > --ewok > MCSA+M,MCSE, MCSD, MCDBA,MCITP > > > "Karl Rhodes" wrote: > > > I have a datagridview which is populated via a datatable. > > > > What I would like to dynamically set a selected row and have that row > > show up in the datagridview and not have to manually scroll to find the > > selected row. > > > > I had a look for all kind of "datagridview1.rows(i).focus" but there > > doesnt seem to be anything. Can anyone help? I know this must be quite > > simple to do but cant find it. > > > > On 31 May 2006 02:39:36 -0700, "Karl Rhodes"
<googlegro***@tlbsolutions.com> wrote: >I have a datagridview which is populated via a datatable. Move the row you want to select to the top and then select it:> >What I would like to dynamically set a selected row and have that row >show up in the datagridview and not have to manually scroll to find the >selected row. > >I had a look for all kind of "datagridview1.rows(i).focus" but there >doesnt seem to be anything. Can anyone help? I know this must be quite >simple to do but cant find it. Me.DataGridView.FirstDisplayedScrollingRowIndex = SelIndex Me.GridView.Rows(SelIndex).Selected = True The selected row will be the first row displayed, or, will be a visible row if the selected row is near the end of the displayable rows. Gene
Why choose SQL Express over Access?
Anyway To Compress PDF from .NET? Visual Basic 6.0 X Visual Basic 2005 Express Seeking report component.... AxWebBrowser problems in VS2005 Saving changes to a database Setting the correct tabindex C# to VB Conversion - 800 lines got - 2 lines beyond me A couple of newbie questions How to test internet connection in VB.NET? |
|||||||||||||||||||||||