Unable to perform context Menu operation in Listview rows

Class library usage, coding and language questions.
saurabh
Posts: 20
Joined: Fri Jul 20, 2007 1:11 pm
Location: India
Contact:

Unable to perform context Menu operation in Listview rows

Post by saurabh » Thu Aug 23, 2007 2:46 pm

I want to perform contecx menu operation for a selected rows in ListView.Like if I have 10 rows in List View then I want select 3rd and 5th row and get popup menu for the same means I want to first focus on selected row in ListView then want to get Contex Menu for that paricular row.Currentaly i am trying to do that by this code

Form* form = Application::FindFormTitle("Alarm manager",Ranorex::SearchMatchMode::MatchExact,true,5000);
ListView* lvCtrl = form->FindListView("AlmDisplayLV");
Mouse::MoveToControl(lvCtrl);
lvCtrl->Focus();
Ranorex::Element* items[] = lvCtrl->Element->FindChildren(Role::ListItem);
String *name = items[ElemIndex]->get_Name();
Ranorex::Element* item = lvCtrl->Element->FindChild(Ranorex::ListItem,name);
Mouse::ClickElement(item,MouseButtonType::RightButton);
ContextMenu::SelectItemText("Acked");

Here it is taking rows by values of first column but in my case each item have same value in first column so its always selecting first row.I want to select it by index not by value.I am trying to do it by GetChild() method but its not working.I am trying to make other column apart from first to use as a unique key but it not returing handler of element.
In other way Mouse::ClickElement() method take only Ranorex::Element its doesn't take array of Ranorex::Element so i can not pass it like
Mouse::ClickElement(items[ElemIndex],MouseButtonType::RightButton);

Please suggest me and help me to complete my logic.Its very critical and important.Thanks in advance
Regards,
Saurabh Shrivastava
GE Global Research
Bangalore India

saurabh
Posts: 20
Joined: Fri Jul 20, 2007 1:11 pm
Location: India
Contact:

I have done with this

Post by saurabh » Thu Aug 23, 2007 3:29 pm

Hi
I have done with this :)
Just give me a sample code for functionality of ScrollBar It is not there is VS2003 Sample.
Like in my application in first page of ListView there is 11Item and I want to perfrom the above operation on 20th or 40th row so i think i have to move scroll bar till that page so tell me how can i do that.Its argent.
Regards,
Saurabh Shrivastava
GE Global Research
Bangalore India