Is Post Back), pager does not work :( @Mazdak Shojaie You have to add an event handler for the Grid View. This should be set to the name of the handler which will be handling the event. Also, the code you suggested is the exact same as the way my checkbox is defined above.
You must not bind your grid on postbacks in Page_Load, only when something changed that causes the Grid to reload data(f.e.
Sorting, Paging) and only in the appropriate event-handlers.
You can track column changes with Collection Changing, Collection Changed events which can be accessed from the Columns collection.
The event is raised after the cell value is changed and the focus is moved away from the cell.
In order to implement paging you need to set Allow Paging property of the Grid View control to True. There are two events of Grid View that are related to paging.
They are: The former event is raised before the current page changes and the later is raised after the page has changed. Write the following code in the Page Index Changing event of the Grid View.Can't believe this haunted me for hours..sitting here staring blankly into some none functioning ASP. Form["__EVENTTARGET"] and if it ends with the ID of the control, rebind the Grid View and use Page.NET code..because I had set Enable View State="false" :@ When I bind Grid View in if(! Find Control with the event target to find the control that fired the event I just had a colleague who encountered the same problem; his was caused by the onrowcommand= attribute not being set in the asp: Grid View element. Also make sure that the web.config has debug set to true (think already done). Like I said at the bottom, my button click event works fine, it's just the Check Box inside the Grid View that's giving me problems.The postback event for the checkbox control won't fire correctly because it's within a Grid View that mangles the ID of the control.If you need the Checkbox to reflect data you can use the Check Box Field object and bind that way.Therefore the Check Box_Check Changed and Drop Down List_Selected Index Changed events where not being fired.