HOW TO ENABLE SELECTION FOR A GRIDVIEW THAT ASSIGNS THE DATASOURCE IN THE CODE BEHIND CLASS?

Manoj Bhatt

Total Post:154

Points:1086
Posted by  Manoj Bhatt
 1252  View(s)
Ratings:
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?


  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: How to enable Selection for a GridView that assigns the DataSource in the code behind class?

    Hi Manoj, 

    try this:

    GridView1.AutoGenerateColumns = true;

     GridView1.AutoGenerateSelectButton = true;

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!