views:

85

answers:

2

Hello,


If I open GridView’s Smart Tasks pop up --> Configure Data Source, then after Choose you data connection window I’m presented with the Configure the Select Statement window. This window also has Advanced button, which opens Advanced Sql Generations Options window. But both radio buttons in that window are faded out and thus I’m not able to select any of the two buttons.

Any idea why the two radio buttons are disabled?


thanx

+1  A: 

Apparently the most common cause is that there is no primary key for the table defined in the database that is part of your SELECT statement.

Make sure that:

  1. You have a primary key column that is selected in the list of columns
  2. Your primary key column does not have a default value.
Robert Harvey
I used SqlDataSource, which should support it
SourceC
Check the underlying table in your database. Make sure that it has a primary key field with the Identity property set, and that this field is part of your SQL SELECT statement in your SqlDataSource.
Robert Harvey
I've set DataKeyNames, but it still didn't work. Anyways, why would setting DataKeyNames have any effect on whether radio buttons are enabled or not?
SourceC
Did you make sure the table in the database has a primary key, with the identity property set? is that field part of your SELECT statement?
Robert Harvey
I was sure that field I've set in DB was also a primary key, but that doesn't seem to be the case. Anyhow, I tried it using another table and it works now. Anyways, thank you all for your kind help
SourceC
+1  A: 

Have you set primary key(s) for the tabel(s)?

Richard
I did set DataKeyNames
SourceC