This is a migrated thread and some comments may be shown as answers.

Radgrid Problem

1 Answer 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sharyu Desai
Top achievements
Rank 1
Sharyu Desai asked on 09 Jun 2010, 01:30 PM
Hello,
  I use the telerik grid. I use  GridDropDownColumn for the boolean value. but when i want to set only once true & false value in dropdown

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Jun 2010, 08:20 AM
Hello Sharyu,

Use the DISTINCT keyword in sql query to return only distinct (different) values. Here is an example.

aspx:
 
 
  <telerik:GridDropDownColumn DataSourceID="SqlDataSource2" DataField="MartalStatus" 
        ListTextField="MartalStatus" ListValueField="MartalStatus">  
    </telerik:GridDropDownColumn> 
 
...  
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
    SelectCommand="SELECT DISTINCT MartalStatus FROM [Details]">  
</asp:SqlDataSource> 

Also checkout the demo.

Thanks,
Princy.
Tags
General Discussions
Asked by
Sharyu Desai
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or