Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hi
I am creating a gridview dynamically and assigning the selectedindexchanging event dynamically because i want click event for every row but it is unable to fire when I click on the griview row.Please suggest me how would I do.
 
gridAns.SelectedIndexChanging += new GridViewSelectEventHandler(gridAns_SelectedIndexChanging);
            gridAns.SelectedIndexChanged += new EventHandler(gridAns_SelectedIndexChanged);
            gridAns.RowDataBound += new GridViewRowEventHandler(gridAns_RowDataBound);
Posted 18-Mar-13 1:24am
Comments
Chinmaya_Champatiray at 18-Mar-13 6:37am
   
Hi Prafulla,
 
Just a quick question. Do you have any "Select" button in the grid?
 
Thanks,
Chinmaya
Prafulla Sahu at 18-Mar-13 7:33am
   
Thanks chinmaya for your reply
 
No I am not using any select button inside my dynamic gridview. I am using onclick event inside every row in rowdatabound event.
Chinmaya_Champatiray at 19-Mar-13 1:12am
   
Hi Prafulla,
 
Could you please provide the code for onClick event, so it will be easier to understand to cause.
 
and while replying please reply to the comment, so that we will get notification. :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have you enabled page index property of dynamic grid? or you paste your complete code here
  Permalink  
Comments
Prafulla Sahu at 18-Mar-13 7:39am
   
Thanks Khalid for your reply
 
PageIndex is not a boolean property so we can't enable that, we can set or get the value into/from PageIndex in gridview.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Sorry i mean have you set property AllowPaging=true;
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 329
1 Maciej Los 290
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 185
4 PIEBALDconsult 149
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100