Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl: Find and Select Row after Keypress
GridCtrl: Find and Select Row after Keypress [message #19731] |
Wed, 07 January 2009 21:20 |
|
michael
Messages: 153 Registered: May 2007 Location: Germany
|
Experienced Member |
|
|
I'm displaying some data within a GridCtrl. Now i want to select a row after pressing a key.
For example i have 4 rows with names:
---------col1----col2
row1 Michael Muller
row2 Albert Meier
row3 Hubert Heimer
row4 Silke Super
Now i want to press H and it would be great when row 3 would be selected. How can i realize this?
[Updated on: Wed, 07 January 2009 21:21] Report message to a moderator
|
|
|
|
|
|
Re: GridCtrl: Find and Select Row after Keypress [message #19737 is a reply to message #19736] |
Thu, 08 January 2009 13:16 |
|
michael
Messages: 153 Registered: May 2007 Location: Germany
|
Experienced Member |
|
|
This is what i have now:
FOREACH_ROW(datagrid)
{
if(String(datagrid(1)).IsEqual("Hubert"))
{
datagrid.SetCursor(datagrid.GetCurrentRow());
datagrid.SelectRow();
datagrid.SetFocus();
}
}
Now the row with Hubert at col1 is selected, but there is another problem: I use this code to make my next query:
activeCustomer = IntStr(datagrid.Get(2));
CreateDatagrid("Server");
SelectData("*", "Server", KUNDE == activeCustomer, ALIAS);
ActiveCustomer should be "Heimer", but it's not.
Is datgrid.get(col) the right method to get the value of an selected row? Hope you can follow me...
[Updated on: Thu, 08 January 2009 18:44] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon May 06 03:53:38 CEST 2024
Total time taken to generate the page: 0.02340 seconds
|