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

GridDropDownColumn display

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ahmad
Top achievements
Rank 1
Ahmad asked on 14 Sep 2008, 12:03 PM

Hi,

I have a RadGrid that's populated by an sql data source (called "sdsInfoTable" which reads from an SQL Table called "InfoTable"). 

A GridDropDownColumn in the RadGrid is used for editing/updating one of the fields in InfoTable ("Relationship").

The values in the RadComboBox used in the GridDropDownColumn populates from another sql datasource ("sdsRelationships").

Here's my issue: When the RadGrid is not in EditMode, the Relationship column is simply displaying the first value obtained from sdsRelationships, instead of the value it should display from sdsInfoTable. How can I make it so that it displays the correct value?

Here's some of the code:

<telerik:GridDropDownColumn DataField="Relationship" HeaderText="Relationship" SortExpression="Relationship" 
                    UniqueName="Relationship" DataSourceID="sdsRelationships" ListTextField="Relationship" ListValueField="RelationshipID">  
                </telerik:GridDropDownColumn> 

<asp:SqlDataSource ID="sdsRelationships" runat="server" ConnectionString="<%$ ConnectionStrings:InfoConnectionString %>" 
        SelectCommand="SELECT [RelationshipID], [Relationship] FROM [Relationships]"></asp:SqlDataSource> 
    <asp:SqlDataSource ID="sdsInfoTable" runat="server" ConnectionString="<%$ ConnectionStrings:InfoConnectionString %>" 
        SelectCommand="SelectInfoTable" SelectCommandType="StoredProcedure">  
        <SelectParameters> 
            <asp:QueryStringParameter DefaultValue="1" Name="RequestID" QueryStringField="rid" 
                Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 


I really would appreciate any help in sorting this out. If you need more clarification, just ask :).

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 17 Sep 2008, 07:06 AM
Hello Ahmad,

Attached to this message, is a small application, which handles a similar functionality. The column of interest it the "TitleOfCourtesy".
I hope this helps.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Ahmad
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or