How to Finding the Last Row Value in Datagrid?

Hi Everyone,
Thanks in Advance.
I need your help, to find the last row data in Datagrid.
Actually i am using Datagrid to display my Data in flex. In my data i stored the gender value of employees. So if the last row in my datagrid is "female" i need to be highlight that particular row. So please help me to solve this issue.
Thanks,
Charles. J

datagrid.selectedIndex = datagrid.dataprovider.length;
^ something like this will select the last row in the datagrid.
if you need to check it's value, you might need to cast an object here, based on the index value, and check it's gender value.
datagrid.selectedIndex = datagrid.dataprovider.length;
if (datagrid.selectedItem["gender"] == "female") {
//handle here

Similar Messages

  • How to find the last string value in dynamic object?

    Hi All,
    I am trying to find the last string value in dyanamic objects,Any one have solution for this.
    Ex:
    my data :12347-ebjdone-525-ecgfjf-25236-defdafgdeg
    And i want to show the output is :defdafgdeg
    Any ideas:
    Thanks
    Srini

    For oracle try using oracle function.
    e.g.
    SELECT  reverse(substr(reverse('12347-ebjdone-525-ecgfjf-25236-defdafgdeg'),1,instr(reverse('12347-ebjdone-525-ecgfjf-25236-defdafgdeg'),'-','1'))) from dual
    Object definition might look like:
    reverse(substr(reverse({ObjectName}),1,instr(reverse({ObjectsName}),'-','1')))
    Regards,
    Kuldeep
    Edited by: Kuldeep Chitrakar on Feb 12, 2010 8:12 AM

  • How to find the LOCKED ROWS in a table?

    Not locked objects, but for a table the locked rows.

    Check below links :
    http://www.jlcomp.demon.co.uk/faq/locked_rows.html
    How to find the locked row.
    who are waiting for same record?
    HTH
    Girish Sharma

  • Sir,how to find the last DML operations

    Hi,
    Please tell me how to find the last DML Operations at least minimum 30 queries.
    Thanks in advance,

    Shared Pool is a memory location in SGA that contains SQL Statement that are submitted to Oracle for execution. This area is common to the entire database. Its not specific to user.
    So what ever Unique SQL statement that is submitted to the SQL Engine will be available here. Shared Pool has a size limit. That is defined by the parameters SHARED_POOL_SIZE and SHARED_POOL_RESERVED_SIZE. So when the Shared pool becomes full the data needs to be removed from it. That is done in FIFO basis.
    Oracle provides a visibility to this area through dictionary view V$SQLAREA. So this view will not only contain the SQL executed by you but also by every one. Even the one executed by oracle itself.
    So in my opinion what you are asking is not possible to get. You must have some logging mechanism in your application to get this information.

  • How to find the Last modified date and time of a package

    Hi,
    We need a clarification on how to find the Last modified date and time of a package in Oracle. We used the example below to explain our scenario,
    Lets consider the following example
    Let A, B be two packages.
    Package A calls the package B. So A is dependent on B.
    When A is compiled the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS gets updated.
    Now there a modification in package B so it is compiled. There is no modification in package A.
    Now when the package A is executed the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS gets updated but we did not make any change in Package A. Now we need to find last modified date and time of the package A . So we can not rely on the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS . Can u please tell us any other solution to get last modified date and time of the package A .
    Regards,
    Vijayanand.C

    Here is an example:
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 10:57:32 2004-05-20:10:57:32 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 10:59:04 2004-05-20:10:59:04 VALID
    SQL> CREATE OR REPLACE PROCEDURE A AS
    2 BEGIN
    3 NULL;
    4 NULL;
    5 END;
    6 /
    Procedure created.
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 11:01:28 2004-05-20:11:01:28 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 10:59:04 2004-05-20:10:59:04 INVALID
    SQL> EXEC B
    PL/SQL procedure successfully completed.
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 11:01:28 2004-05-20:11:01:28 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 11:01:53 2004-05-20:11:01:53 VALID
    Note that the date under the column 'created' only changes when you really create or replace the procedure.
    Hence you can use the column 'created' of 'user_objects'.

  • How to find the last update date time and user of record field peoplecode

    how to find the last update date time record field peoplecode?
    Thank you.

    One can check the last update date time using the following query
    SELECT LASTUPDDTTM FROM PSPCMPROG WHERE OBJECTVALUE1 LIKE 'RECNAME' AND OBJECTVALUE2 LIKE 'FIELDNAME'

  • How to find the last modified date of a workflow.

    How to find the last modified date of a workflow.
    thanks.

    Hi,
    There is nothing as standard that does this - you could write some code to determine the latest begin_date from each of the workflow tables and assume that this was the last time that the definition changed.
    What you need is something like this:
    select max(wfa.begin_date)
    from   wf_process_activities  wpa
    ,      wf_activities          wfa
    ,      wf_item_types_tl       wit
    where  wpa.activity_item_type = wfa.item_type
    and    wpa.activity_name      = wfa.name
    and    wfa.version            = (select max(version) from wf_activities wfa1 where wpa.activity_item_type = wfa1.item_type and wpa.activity_name = wfa1.name )
    and    wpa.process_item_type  = 'your item type'
    and    wpa.process_item_type  = wit.namewhich I think gives what you want.
    HTH,
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com
    NEW! - WorkflowFAQ Blog at http://thoughts.workflowfaq.com

  • How to find the last executed date of any program?

    <<Frequently asked questions. So search>>
    How to find the last executed date of any program?
    is there any system variable or function module?
    Edited by: Matt on Oct 5, 2010 12:48 PM

    check the transaction STAD.
    Prabhudas

  • How to get the last row of a database table.

    HI ,
    I want to get record exactly from the last row of a database table.
    How is that possible?

    Hi,
    To fetch last record from an internal table, just do find the number of records in it and read using index.
    DESCRIBE TABLE ITAB LINES L_LINES.
    READ TABLE ITAB INDEX L_LINES.
    You can also use LOOP .. ENDLOOP but the above method is better (performance wise).
    using LOOP .. ENDLOOP.
    LOOP AT ITAB.
    **do nothing
    ENDLOOP.
    **process ITAB (Header record of ITAB).
    **after ENLOOP, ITAB will have the last record of the internal table.
    [here ITAB is internal table as well as header record.]
    But what is the requirement?
    If you are looking for the current record of an employee then you can use ENDDA = HIGH_DATE.
    My advice is to review your requirement again and try to fetch only that record which you need.
    Mubeen

  • HELP! How te retrieve the last row in MYSQL database using Servlet!

    Hi ,
    I am new servlets. I am trying to retireve the last row id inserted using the servlet.
    Could someone show me a working sample code on how to retrieve the last record inserted?
    Thanks
    MY CODE
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class demo_gr extends HttpServlet {
    //***** Servlet access to data base
    public void doPost (HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
         String url = "jdbc:mysql://sql2.njit.edu/ki3_proj";
              String param1 = req.getParameter("param1");
              PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");
              String semail, sfname, slname, rfname, rlname, remail, message;
              int cardType;
              sfname = req.getParameter("sfname");
              slname = req.getParameter("slname");
              rfname = req.getParameter("rfname");
              rlname = req.getParameter("rlname");
              semail = req.getParameter("semail");
              remail = req.getParameter("remail");
              message = req.getParameter("message");
              //cardType = req.getParameter("cardType");
              cardType = Integer.parseInt(req.getParameter("cardType"));
              out.println(" param1 " + param1 + "\n");
         String query = "SELECT * FROM greeting_db "
    + "WHERE id =" + param1 + "";
              String query2 ="INSERT INTO greeting_db (sfname, slname ,semail , rfname , rlname , remail , message , cardType ,sentdate ,vieweddate) values('";
              query2 = query2 + sfname +"','"+ slname + "','"+ semail + "','"+ rfname + "','"+ rlname + "','"+ remail + "','"+ message + "','"+ cardType + "',NOW(),NOW())";
              //out.println(" query2 " + query2 + "\n");
              if (semail.equals("") || sfname.equals("") ||
              slname.equals("") || rfname.equals("") ||
              rlname.equals("") || remail.equals("") ||
              message.equals(""))
                        out.println("<h3> Please Click the back button and fill in <b>all</b> fields</h3>");
                        out.close();
                        return;
              String title = "Your Card Has Been Sent";
              out.println("<BODY>\n" +
    "<H1 ALIGN=CENTER>" + title + "</H1>\n" );
                   out.println("\n" +
    "\n" +
    " From  " + sfname + ", " + slname + "\n <br> To  "
                                            + rfname + ", " + rlname + "\n <br>Receiver Email  " + remail + "\n<br> Your Message "
                                            + message + "\n<br> <br> :");
                   if (cardType ==1)
                        out.println("<IMG SRC=/WEB-INF/images/bentley.jpg>");
                   else if(cardType ==2) {
                        out.println("<IMG SRC=/WEB-INF/images/Bugatti.jpg>");
                   else if(cardType ==3) {
                        out.println(" <IMG SRC=/WEB-INF/images/castle.jpg>");
    else if(cardType ==4) {
                        out.println(" <IMG SRC=/WEB-INF/images/motocross.jpg>");
    else if(cardType ==5) {
                        out.println(" <IMG SRC=/WEB-INF/images/Mustang.jpg>");
    else if(cardType ==6) {
                        out.println("<IMG SRC=/WEB-INF/images/Mustang.jpg>");
    out.println("</BODY></HTML>");
         try {
              Class.forName ("com.mysql.jdbc.Driver");
              Connection con = DriverManager.getConnection
              ( url, "*****", "******" );
    Statement stmt = con.createStatement ();
                   stmt.execute (query2);
                   //String query3 = "SELECT LAST_INSERT_ID()";
                   //ResultSet rs = stmt.executeQuery (query3);
                   //int questionID = rs.getInt(1);
                   System.out.println("Total rows:"+questionID);
    stmt.close();
    con.close();
    } // end try
    catch (SQLException ex) {
              //PrintWriter out = resp.getWriter();
         resp.setContentType("text/html");
              while (ex != null) { 
         out.println ("SQL Exception: " + ex.getMessage ());
         ex = ex.getNextException ();
    } // end while
    } // end catch SQLException
    catch (java.lang.Exception ex) {
         //PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");     
              out.println ("Exception: " + ex.getMessage ());
    } // end doGet
    private void printResultSet ( HttpServletResponse resp, ResultSet rs )
    throws SQLException {
    try {
              PrintWriter out = resp.getWriter();
         out.println("<html>");
         out.println("<head><title>jbs jdbc/mysql servlet</title></head>");
         out.println("<body>");
         out.println("<center><font color=AA0000>");
         out.println("<table border='1'>");
         int numCols = rs.getMetaData().getColumnCount ();
    while ( rs.next() ) {
              out.println("<tr>");
         for (int i=1; i<=numCols; i++) {
    out.print("<td>" + rs.getString(i) + "</td>" );
    } // end for
    out.println("</tr>");
    } // end while
         out.println("</table>");
         out.println("</font></center>");
         out.println("</body>");
         out.println("</html>");
         out.close();
         } // end try
    catch ( IOException except) {
    } // end catch
    } // end returnHTML
    } // end jbsJDBCServlet

    I dont know what table names and fields you have but
    say you have a table called XYZ which has a primary
    key field called keyID.
    So in order to get the last row inserted, you could
    do something like
    Select *
    from XYZ
    where keyID = (Select MAX(keyID) from XYZ);
    Good Luckwhat gubloo said is correct ...But this is all in MS SQL Server I don't know the syntax and key words in MYSQL
    This works fine if the emp_id is incremental and of type integer
    Query:
    select      *
    from      employee e,  (select max(emp_id) as emp_id from employee) z
    where      e.emp_id = z.emp_id
    or
    select top 1 * from employee order by emp_id descUday

  • How to get the last row in a resultset or query

    Hi All
    Say If I have a complex query which returns a resultset say 15 rows. Now I want to limit the output showing only the last row.
    How can we do this

    Keep in mind Oracle does not keep "row" order as such. Unlike a graphical type db like Access, Oracle will not always give you back the results in order.
    Even if you were to use a sequence, your query is never guaranteed to give back the results in the order you are expecting. You must then give an order by statement to all queries expecting the order.
    Your definition of last row too is vague - if it is in fact the greatest amount, use the inline view suggestion. If you simply want to see the last inserted row, consider adding a last_update_date column inserting the sysdate (by a trigger perhaps). This would then allow you to see the last inserted row.
    Enjoy!

  • How to find the most matched values in the set of map?

    Hi friends!
    I have two vectors
    vector<int> V1; vector<int> V2;
    and a map<int, set<int>> M1;
    I want to select common values from both V1 and V2 and check those values with the set in the map M1.
    For example:
    V1 contains;
    2  4  6  8  9
    V2 contains;
    4  5  6  9  10 
    M1 contains;
    1=>1  2  5  9
    2=>4
    3=>5   10
    4=>2  4  8
    5=>4   9
    6=>4   6
    7=>9  12
    When we select the common values of V1 and V2 it is 4, 6, 9.
    And we search for all 4, 6, 9 from the values of M1 which give more appropriate.
    But, no all values in the set of map.
    Then, we delete any value from 4, 6, 9, then remaining values would match any values from the map.
    From the example, if we delete 6, then remaining 4, 9 will match with 5=>4  9, or if we delete 9, then 6=>4   6. Any one of the keys can be selected.
    I know how to select the common values from V1 and V2, but I do not know how to match with the values and select the appropriate key from M1.
    Could anyone help me to solve this?

    This is not the question you asked, except perhaps in the subject. The subject is not the right place to put key features of the question. It is also important to use the body to ask just the question you want
    answered. For example your real question has nothing to do with V1 and V2, just the common vector V (e.g. 4 6 9).
    One way to solve your problem would be to create a new map
    map<int, set<int>> M2;
    with the same keys as M1. Each set of M2 should contain the elements of V that are
    not in the corresponding set of M1.
    Then pick the key of M2 that has the smallest set. If that set is empty, then the whole of V can be used. Otherwise the smallest set tells which elements of V have to be removed, and which is the desired key of M1.
    In your example, key 5 of M2 will contain just 6, so you should remove 6 from V and select key 5.
    Yes fine. I tried the following code and it creates the map M2 (NewMyMap in my code). But how to find the smallest set starting from size 1?
    #include <vector>
    #include <algorithm>
    #include <iostream>
    #include <map>
    #include <set>
    using namespace std;
    typedef vector<int> IntVec;
    typedef set<int> IntSet;
    typedef map<int, IntSet> SetMap;
    bool IsValueNotInSet(int value, IntSet& S);
    SetMap CreatNewSetMap();
    IntVec IVec; //This vector is for selecting certain keys from mySet map.
    IntVec myVec;
    SetMap mySet;
    SetMap NewMyMap;
    int main()
    IVec.push_back(3); IVec.push_back(4); IVec.push_back(5); IVec.push_back(6);
    myVec.push_back(4); myVec.push_back(6); myVec.push_back(9);
    IntSet tempS;
    tempS.insert(1); tempS.insert(2); tempS.insert(5); tempS.insert(9);
    mySet.insert(make_pair(1,tempS));
    tempS.clear();
    tempS.insert(4);
    mySet.insert(make_pair(2,tempS));
    tempS.clear();
    tempS.insert(5); tempS.insert(10);
    mySet.insert(make_pair(3,tempS));
    tempS.clear();
    tempS.insert(2); tempS.insert(4); tempS.insert(8);
    mySet.insert(make_pair(4,tempS));
    tempS.clear();
    tempS.insert(4); tempS.insert(9);
    mySet.insert(make_pair(5,tempS));
    tempS.clear();
    tempS.insert(4); tempS.insert(6);
    mySet.insert(make_pair(6,tempS));
    tempS.clear();
    tempS.insert(9); tempS.insert(12);
    mySet.insert(make_pair(7,tempS));
    cout<<"MYVEC\n";
    cout<<"-------------\n";
    for(IntVec::iterator itv = myVec.begin(); itv != myVec.end(); ++itv)
    cout<<(*itv)<<" ";
    cout<<"\n\n";
    cout<<"\nMYSET\n";
    cout<<"-------------";
    for(map<int,set<int>>::iterator its = mySet.begin(); its != mySet.end(); ++its)
    cout << endl << its->first <<" =>";
    for(IntSet::iterator sit=its->second.begin();sit!=its->second.end();++sit)
    cout<<" "<<(*sit);
    cout<<"\n\n";
    NewMyMap= CreatNewSetMap();
    cout<<"\nNEWMYSET\n";
    cout<<"-------------";
    for(map<int,set<int>>::iterator its1 = NewMyMap.begin(); its1 != NewMyMap.end(); ++its1)
    cout << endl << its1->first <<" =>";
    for(IntSet::iterator sit=its1->second.begin();sit!=its1->second.end();++sit)
    cout<<" "<<(*sit);
    cout<<"\n\n";
    return 0;
    bool IsValueNotInSet(int value, IntSet& S)
    IntSet::iterator it=find (S.begin(), S.end(), value);
    if (it!=S.end())
    return false;
    return true;
    SetMap CreatNewSetMap()
    IntSet TSet;
    for(IntVec::iterator it = IVec.begin(); it != IVec.end(); ++it)
    SetMap::iterator its = mySet.find(*it);
    if (its != mySet.end())
    TSet.clear();
    int key = its->first;
    IntSet& itset = its->second;
    for(IntVec::iterator itv = myVec.begin(); itv != myVec.end(); ++itv)
    if(IsValueNotInSet((*itv), itset))
    TSet.insert(*itv);
    NewMyMap.insert(make_pair(key,TSet));
    return NewMyMap;

  • How to find the last login details of a Sharepoint SSRS user

    How to /where to find the last login details of SSRS sharepoint user. Is there any table where we can check the last login details of user. This is because we are facing an issue of Subscription failure due to Sharepoint token expiration. If user logs in
    before 24 hours of his last login time, he is able to get his report subscription. If not, below error is thrown.
    The permission granted to user 'domainname\username' are insufficient to perform this operation.

    Hi,
    According to your post, my understanding is that you want to monitor the last login user’s details.
    There is no out of the box way to achieve it in SharePoint.
    We can use cookie to be a flag for checking whether there is an user just log in. After the page loaded, if the cookie is null, it suggests that there is an user just log in our site, then we
    can get this user’s information using JavaScript Object Model and add the information into a custom list. With this list, we can monitor user’s login details.
    Refer to the following link:
    https://social.technet.microsoft.com/Forums/en-US/0cd4d531-cb61-4d90-aa70-413267f4a735/how-to-know-login-and-logout-details-of-a-user-in-sharepoint-online-2013?forum=sharepointdevelopment
    Besides, here are two similar posts for your reference:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/1a35283e-0f2a-49b8-b330-801a3cfcd890/programatically-get-all-current-logged-in-users-list-for-a-sharepoint-site?forum=sharepointdevelopmentprevious
    https://social.technet.microsoft.com/Forums/en-US/10953be3-cb1c-40c7-9454-545c8338b551/how-to-know-login-users-count-and-their-details-in-sharepoint-2010-web-application?forum=sharepointgeneralprevious
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • How to display the last row in a table

    I have a table that is constantly updating, and I always want to see the last row. How can I get my table to auto scroll?

    Hi žabić,
    there is a property called "top left visible row". You can use it to scroll your table.
    edit:
    Maybe this is not the exact name, but you can see an example here
    Mike
    Message Edited by MikeS81 on 05-27-2010 03:57 PM

  • How to get the last row

    I have 10 rows in my table and I have to retrive last row using rownum.
    For this I use
    SELECT * from <table_name>
    where rownum<=10
    minus
    SELECT * from <table_name>
    where rownum<=9
    The result is no rows selected
    In the same case if I use
    SELECT rownum from <table_name>
    Where rownum <= 10
    minus
    SELECT rownum from <table_name>
    where rownum <=9
    The result is 10
    Why this happend.
    If the result is 10, then why the row whose rowid is 10 is not retrived

    All
    Please bear in mind that ROWNUM is an attribute of the query NOT the table. The last row returned by an unORDERed SELECT statement may be the most recently inserted row but is not guaranteed to be so.
    The only way of assuring yourself of returning the most recent row is either to timestamp all your tables with a date_created column or to use a primary key with an ascending value.
    rgds, APC

Maybe you are looking for