I've got an table (asp.net gridview generated) that's going to be scrolled vertically in a <div>. In another sub-form on the same page, the user will select a record identifier that corresponds to a row in the gridview table.
When the user chooses that record identifier, I need to figure out a way to cause the particular corresponding row in the gridview to be positioned within the visible area of the scrolling <div> (because it might be "above" or "below" that visible area). Ideally the particular row would be positioned at the top of the visible gridview rows...but that's probably a detail in this general solution.
I expect this will all be done in javascript. I see that scrollTop can be set as well as gotten, and that's likely to be a key property in doing this.
The gap seems to be knowing what value to set scrollTop to. This could possibly be a calculation based on known row height, and row positional count (provided the rows didn't vary in height...but even that could be probably be dealt with.)
Unless there's a way to get relative row position, as in {x = rowVar.style.top} (which I'm not sure exists for rows, or would have to be somehow declared in advance?)...because that could be immediately combined mathemagically with scrollTop.
Any suggestions on how to make this work would be appreciated.
Thanks!
When the user chooses that record identifier, I need to figure out a way to cause the particular corresponding row in the gridview to be positioned within the visible area of the scrolling <div> (because it might be "above" or "below" that visible area). Ideally the particular row would be positioned at the top of the visible gridview rows...but that's probably a detail in this general solution.
I expect this will all be done in javascript. I see that scrollTop can be set as well as gotten, and that's likely to be a key property in doing this.
The gap seems to be knowing what value to set scrollTop to. This could possibly be a calculation based on known row height, and row positional count (provided the rows didn't vary in height...but even that could be probably be dealt with.)
Unless there's a way to get relative row position, as in {x = rowVar.style.top} (which I'm not sure exists for rows, or would have to be somehow declared in advance?)...because that could be immediately combined mathemagically with scrollTop.
Any suggestions on how to make this work would be appreciated.
Thanks!