Home > DeveloperSection > Forums > How to enable Selection for a GridView that assigns the DataSource in the code behind class?
Manoj Bhatt
Manoj Bhatt

Total Post:153

Points:1079
Posted on    September-02-2014 12:37 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 873  View(s)
Rate this:

when I create a GridView and I choose a DataSource in the GUI. However, I am binding the DataSource in the code behind class.

I added SelectMethod="GetCustomers" to my GridView control and an empty GetCustomers() method to my code behind class but I don't see a "Select" link appear in my GridView.

How can I enable "Selection" for my GridView if the DataSource is being bound in the code behind?




Sumit Kesarwani

Total Post:378

Points:2694
Posted on    September-02-2014 12:50 AM

Hi Manoj, 
try this:

GridView1.AutoGenerateColumns = true;

 GridView1.AutoGenerateSelectButton = true;


Don't want to miss updates? Please click the below button!

Follow MindStick