DataGrid Row Highlight Problems VB6

Hi,
This is my first time at this forum.

Here is my problem.
My application has a DataGrid Control bound to an ADO connected to a remote SQL Server. I have set the DataGrid to display a set number of rows (records) and enabled a verticle scroll bar to view the remaining rows.
When the user highlights a specific row the entire row changes color and as the arrow in moved down the changed color follows. This is good and what I want. The problem is when the arrow reaches the bottom of the displayed grid the highlighted row (color change) stops.
How can I get the the highlighted rows to continue for the the length of the grid?
If this is an uncontrolable quirk, is there some code that can be written that will change the color of the entire row where the arrow is?

Thank you very much, in advance, for any help you can offer.

Regards,
Dwight

Comments

  • [b][red]This message was edited by jleg at 2003-11-13 13:51:29[/red][/b][hr]
    : Hi,
    : This is my first time at this forum.
    :
    : Here is my problem.
    : My application has a DataGrid Control bound to an ADO connected to a remote SQL Server. I have set the DataGrid to display a set number of rows (records) and enabled a verticle scroll bar to view the remaining rows.
    : When the user highlights a specific row the entire row changes color and as the arrow in moved down the changed color follows. This is good and what I want. The problem is when the arrow reaches the bottom of the displayed grid the highlighted row (color change) stops.
    : How can I get the the highlighted rows to continue for the the length of the grid?
    : If this is an uncontrolable quirk, is there some code that can be written that will change the color of the entire row where the arrow is?
    :
    : Thank you very much, in advance, for any help you can offer.
    :
    : Regards,
    : Dwight
    :
    Dwight

    This is by design. What is happening is that when a user "Selects" a record this is exactly what happens, Even though you may move the datagrids visual aspect the selected record still remains selected. You are not moving the selector to the next record as I think you are trying to achieve. Your scroll bars will not do this by default. You may be able to acheive you goal by moving the current record pointer using the underlying ADO recordset (movenext) you would have to tie this to your scrollbar.

    You may be able to use bookmarks if you are trying to track record selections. When a record is selected it adds a bookmark to the ado recordset thereby highlighting the record. You can achieve this in code.

    Datagrid1.Selbookmarks.Add Adodc1.Recordset.Bookmark

    Warning: The above will add a bookmark but not delete previous bookmarks records.

    Hope this sheds some light.

    John ;-)


  • : [b][red]This message was edited by jleg at 2003-11-13 13:51:29[/red][/b][hr]
    : : Hi,
    : : This is my first time at this forum.
    : :
    : : Here is my problem.
    : : My application has a DataGrid Control bound to an ADO connected to a remote SQL Server. I have set the DataGrid to display a set number of rows (records) and enabled a verticle scroll bar to view the remaining rows.
    : : When the user highlights a specific row the entire row changes color and as the arrow in moved down the changed color follows. This is good and what I want. The problem is when the arrow reaches the bottom of the displayed grid the highlighted row (color change) stops.
    : : How can I get the the highlighted rows to continue for the the length of the grid?
    : : If this is an uncontrolable quirk, is there some code that can be written that will change the color of the entire row where the arrow is?
    : :
    : : Thank you very much, in advance, for any help you can offer.
    : :
    : : Regards,
    : : Dwight
    : :
    : Dwight
    :
    : This is by design. What is happening is that when a user "Selects" a record this is exactly what happens, Even though you may move the datagrids visual aspect the selected record still remains selected. You are not moving the selector to the next record as I think you are trying to achieve. Your scroll bars will not do this by default. You may be able to acheive you goal by moving the current record pointer using the underlying ADO recordset (movenext) you would have to tie this to your scrollbar.
    :
    : You may be able to use bookmarks if you are trying to track record selections. When a record is selected it adds a bookmark to the ado recordset thereby highlighting the record. You can achieve this in code.
    :
    : Datagrid1.Selbookmarks.Add Adodc1.Recordset.Bookmark
    :
    : Warning: The above will add a bookmark but not delete previous bookmarks records.
    :
    : Hope this sheds some light.
    :
    : John ;-)
    :
    : John,
    Thanks a lot for taking the time to respond to my question. I totally appreciate it.
    I think I was not clear on what my problem is.
    As you referenced above,I am using the ADO move methods assigned to command buttons for the datagrid.


    : When the page starts I have the data grid set to display 18 records. But there may be thousands returned by the ado. I have given the user two ways to scroll down the grid. (Besides using the vertical scroll bars) They can use the down arrow key or the comand buttons set up to .MoveNext etc.

    My problem is that when the last displayed record is reached the next record losses the highlight. The record is active, but not highlighted. This could be disconcerting to the user.
    How can I keep the highlight on the active records for the whole grid?

    It might be possible to write code that would change the back color of the active record and back again as the next record id activated. This would help to asure the user that the record is active.

    Any help would be appreciated.
    Hope this better explains my delemma.

    Regards,
    Dwight
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories