Hi,
Is there a way to retrieve the viewing last row index easily?
I able to retrieve the viewing first row index through below code:
int
but then i found out that LastRow were a Non public member(pls view the image url below) and I couldnt access to retrieve it.
You can write instead of:
hongheng said:a = this.ultraGrid1.ActiveRowScrollRegion.VisibleRows.RowScrollRegion.FirstRow.VisibleIndex;
this:
this.ultraGrid1.ActiveRowScrollRegion.FirstRow;
About your question, if the VisibleRows are ordered by index, you could simply write:
grid.ActiveRowScrollRegion.VisibleRows[grid.ActiveRowScrollRegion.VisibleRows.Count - 1].Row.Index;
If they are not ordered, you can query the last index:
grid.ActiveRowScrollRegion.VisibleRows.OfType<VisibleRow>().Max(vr => vr.Row.Index);
Hi, appreciate your reply.. i did a small app, please open and check it out..
it does return correct value if i scroll it..
but
http://cid-1b74085fe9a2e1fd.office.live.com/self.aspx/Public/WindowsFormsApplication4.zip