Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6768983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:08:20+00:00 2026-05-26T15:08:20+00:00

Is it possible to get the list item’s id instead of getting the list

  • 0

Is it possible to get the list item’s id instead of getting the list item through its position? because the problem i face is: I use custom listview. I sort the list items on button click. After the list items are sorted in new order, if i click first item, the list item selected of the original item before sorting. also i use database to fetch the list item click. I match the database id with the list item position selected. How to solve it? any help is highly appreciated and thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:08:20+00:00Added an answer on May 26, 2026 at 3:08 pm

    I think your best approach here is to use the tag property and set it equal to whatever id you want to use on retrieval of data from your db:

    view.setTag(myId);
    

    Then when the view is clicked, inside your Listener you can simply retrieve the tag value instead of the position:

    int id = view.getTag();
    

    You may need to do some casting since Tag is of type object, but this will work for what you need. If you want to go further, I recommend using a Model class to hold the ID value, then you can simply set that object as the tag, and reference all properties of your model when you retrieve (not just the ID itself).

    Hope this helps.
    Brian

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to apply a custom background to each Listview item via the
How do I display thumbnails for my item list....also is it possible to display
Suppose I get a list of items like $(.box) . Is it possible to
I'm trying to make a custom template for a basket item list. I need
Is it possible to get a list of the files that are currently selected
Is is possible to get a list or search a Facebook users videos for
Of course, it is pretty possible to create work items, get a list of
I am developing Listview where Multiple selection is possible,now the problem is when i
Sometimes users require to change information in SharePoint list item that is not editable
Possible Duplicate: Loop through Json object { data: [ { name: Jen, id: 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.