i am trying to get SelectedValue for selected item in listbox and then perform action to get id from database. Below is the code I am trying on Context Menu long press
var selected = (NewsData)lstNews.SelectedValue;
int a = selected.newsID;
MessageBox.Show(a.ToString());
but than it throws error.
Additional information: Object reference not set to an instance of an object. this is because we can get selectedvalue only on select tap event but how to achieve same on long press context menu click event .