PDA

View Full Version : handleکردن SelectedIndexChanging مربوط به گرید



#Faranak
شنبه 12 تیر 1389, 13:06 عصر
سلام من یک grid view بااستفاده ازدیتاست ساختم .خاصیت allow pagingآن را true کردم چه جوری رویداد SelectedIndexChanging مربوط به گرید را handle کنم که وقتی روی گرید خواست به صفحه دیگه ای بره Error نده؟

کدزیررونوشتم ولی باز Error می ده:

PhotoGrid.PageIndex = e.NewSelectedIndex

Vahid_moghaddam
شنبه 12 تیر 1389, 13:56 عصر
error رو مشخص کنید. DataSource رو run time برای گریدویو مشخص می کنید؟

#Faranak
یک شنبه 13 تیر 1389, 09:28 صبح
error رو مشخص کنید. DataSource رو run time برای گریدویو مشخص می کنید؟

بله دیتاسورس رو ران تایم مشخص می کنم.errorزیررو می گیرم:

Server Error in '/taghdis' Application.

The GridView 'PhotoGrid' fired event PageIndexChanging which wasn't handled.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The GridView 'PhotoGrid' fired event PageIndexChanging which wasn't handled.

#Faranak
یک شنبه 13 تیر 1389, 09:39 صبح
مشکلم حل شد باید به جای SelectedIndexChanging رویدادPageIndexChangingروhandleمی کردم.