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

Help with GridDropDownColumn

4 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ed Bassin
Top achievements
Rank 1
Ed Bassin asked on 27 May 2008, 07:27 PM
 The code I use to populate the grid is:

   protected void users_grid_needData(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = MasterPage.executeSQLQuery("SELECT ps_userid, first_name, last_name, ps_usertype FROM ps_users");
        users_grid.DataSource = dt;
    }

This works fine when all the elements are of type "GridBoundColumn" but when I try to make the usertype into a GridDropDown column, it does not render anything.

I read http://www.telerik.com/help/aspnet-ajax/grdcustomizeconfiguregriddropdowncolumn.html

but I am still unclear about what dataField, listValueField, listTextField, and listDataMember should be set to.

Right now I have it as:

 <radG:GridDropDownColumn ListTextField="ps_usertype" DataField="ps_usertype"
                     ListValueField="ps_usertype" HeaderText="Group" UniqueName="Group">
                    </radG:GridDropDownColumn>

Thanks

Edit: I took out the code formatting because it displayed badly.

4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 28 May 2008, 10:57 AM
Hi Ed,

For your convenience, I have prepared a small application, which demonstrates the functionality in question.
You will find it attached to this message.
I hope it helps.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ed Bassin
Top achievements
Rank 1
answered on 28 May 2008, 02:04 PM
Thanks Yavor, that worked great!
0
Ahmad
Top achievements
Rank 1
answered on 15 Sep 2008, 11:34 AM
Yavor,

I tried your test code...it demonstrates the functionality, but it doesn't resolve the issue of properly rendering updated values in a GridDropDownColumn. If I edit then update the value of a row, then the GridDropDownColumn still renders the "old" value (e.g. updating from 'Ana Trujillo' to 'Antonio Moreno' and it will still show as 'Ana Trujillo' ).

Is there a way to get around this?
0
Yavor
Telerik team
answered on 15 Sep 2008, 12:17 PM
Hello Ahmad,

There is no code to actually update the underlying datasource.

Regards,
Yavor
the Telerik team

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