animate the position of the button according to the scrolling inside datagrid!

Hi! My question is, how can I detect the position of the scroll bar, so that when I scrool down my buttons would react to the corect position of the lines, so that at the top they would dissapear!

AttachmentSize
script.jpg70.79 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
artrender.info's picture

yessssssss

I've found

VisibleRowsCount = (BitmapLister.table.Height-24)/30

artrender.info's picture

Hint

intRows = dataGridView1.Rows.GetRowCount(DataGridViewElementStates.Displayed);
intBottom = intRows + intTop - 1;

BitmapLister.table.Rows.GetRowCount(DataGridViewElementStates.Displayed)

is giving error also

artrender.info's picture

solved partially

on table Scroll ScrollChangedEventArgs e do
(
 
	print table.FirstDisplayedScrollingRowIndex	
 
)

works but there is no LastDisplayedScrollingRowIndex

I thought to use http://msdn.microsoft.com/en-us/library/system.windows.forms.datagrid.vi...

print BitmapLister.table.VisibleRowCount

but it gives error!

PLEASE HELP!!!

artrender.info's picture

one more idea

on table Scroll ScrollChangedEventArgs e do
(
 
	print first visible row index
	print last visible row index	
 
)
artrender.info's picture

I've found some extra info! How to implement it in maxscript?

--on table SelectionChanged senderArg arg do

on table Scroll ScrollViewer.ScrollChanged ScrollChangedEventArgs

private void cbdg1_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
double d = e.VerticalOffset;

// Here you can use the vertical-offset's value.
}

artrender.info's picture

I think i know how to do it, but your help is needed!

Look! Let, say, I have the line order, and 30 px for every line!
I just need a callback which detects that datagrid is scrolling items! and during this scrolling we need to detect just which lines are visible! Everything else I will try by myself!

artrender.info's picture

tell me please!

tell me please at least where to search?
The height of a row is 30px! may be to detect smth like which line is visible!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.