No, no. Focused item does not mean selected. You need to define what are you
doing: focusing or selecting.
If selecting, then you need to compare selected item's index with total
count. Something like this
if (lvw.SelectedIndices[0] < lvw.Items.Count - 1)
But, be sure that your countrol is set to single selection mode.
--
With best regards,
Andrew
http://www.codeproject.com/script/pr...asp?id=1181072
"¿ Mahesh Kumar" <cy**********@gmail.com> wrote in message
news:e2**************@TK2MSFTNGP12.phx.gbl...
Thankz andrew, I tried with focussed item but still its giving error only.
This code is for moving ( > ).
if (lvw.FocusedItem.Index < lvw.Items.Count)
{
lvw.Items[lvw.SelectedIndices[0] + 1].Selected = true;
lvw.Items[lvw.SelectedIndices[0] + 1].ForeColor = Color.Red;
}
"Andrew Kirillov" <an*************@gmail.com> wrote in message
news:Ow**************@TK2MSFTNGP14.phx.gbl... Hello
> (1) how to limit my navigation when they press (button > ) when they
> are
> in
> last record..?
You can compare ListView.FocusedItem.Index and ListView.Items.Count. If
current index is equal to (count-1), then not allow to go to next record.
> (2) Same way, when they are in first record and trying to press
> button(<)...i should say that you are in first record..?
The same. Just compare ListView.FocusedItem.Index with zero.
--
With best regards,
Andrew
http://www.codeproject.com/script/pr...asp?id=1181072