If the newly inserted item is at the bottom of the table, you can set the selectedindex of ListView to the last one. If you have paging, you can turn to the last page. If the newly inserted item is random, you can loop the datakey of each item to find the
index of the selected one in the ListView. And set its SelectedIndex for ListView.
peterthegrea...
Member
473 Points
576 Posts
open the new Listview selecteditemtemplate after Insert
Feb 28, 2012 08:29 PM|LINK
I want to open the selecteditemtemplate of the current item created in listview control.
hopefully from the listview inserted event when a condition is met ?
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: open the new Listview selecteditemtemplate after Insert
Mar 01, 2012 07:03 AM|LINK
Hi,
If the newly inserted item is at the bottom of the table, you can set the selectedindex of ListView to the last one. If you have paging, you can turn to the last page. If the newly inserted item is random, you can loop the datakey of each item to find the index of the selected one in the ListView. And set its SelectedIndex for ListView.
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
peterthegrea...
Member
473 Points
576 Posts
Re: open the new Listview selecteditemtemplate after Insert
Mar 01, 2012 06:24 PM|LINK
That would be fine. but......
Have you got a sample that shows how to select the last paged record selecteditemtemplate after the new record has been inserted.
Please
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: open the new Listview selecteditemtemplate after Insert
Mar 02, 2012 02:41 AM|LINK
Hi,
It is easy. You can get the info from the datapager control:
DataPager1.TotalRowCount/DataPager1.PageSize will be the last page index, then turn to that page and set the last one as selected.
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework