Get listview item position on button click

do you execute this btnNxt = (Button) findViewById(R.id.btnNext); btnNxt.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { //Here I need to get that position }); inside the getView method? if so it’s very easy btnNxt = (Button) findViewById(R.id.btnNext); btnNxt.setTag(position); btnNxt.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { int position=(Integer)arg0.getTag(); });

ListItems attributes in a DropDownList are lost on postback?

I had the same problem and wanted to contribute this resource where the author created an inherited ListItem Consumer to persist attributes to ViewState. Hopefully it will save someone the time I wasted until I stumbled on it. protected override object SaveViewState() { // create object array for Item count + 1 object[] allStates = … Read more