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

How to assign dataset in Radcombobox using Wpf

5 Answers 116 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
kottu
Top achievements
Rank 1
kottu asked on 11 Sep 2009, 05:59 AM

How to use Rad combobox in wpf????????????

1. Add item in radcombobox ?

2.display member and Value member   using Radcombobox...



thanks,

regards,

vignesh

5 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 11 Sep 2009, 07:38 AM
Hello vighesh,

Our demo site provides nice examples that demonstrate the answers of your questions:
http://demos.telerik.com/wpf/

You could also check our online help:
http://www.telerik.com/help/wpf/radcombobox-populating-with-data.html

Sincerely yours,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
kottu
Top achievements
Rank 1
answered on 11 Sep 2009, 01:59 PM
thanks for ur reply,

im use Radcombobox in telerik.winforms
like this way
             RadCombo.Items.Clear();
                DbCommand Dbcmd = db.GetStoredProcCommand(ProcName);
                db.AddInParameter(Dbcmd, "ColumnID", DbType.String, ColumnID);
                db.AddInParameter(Dbcmd, "ColumnName", DbType.String, ColumnName);
                db.AddInParameter(Dbcmd, "TableName", DbType.String, TableName);
                     db.LoadDataSet(Dbcmd, ds, TableName);
                DataTable dt = ds.Tables[TableName];
                DataRow dr = dt.NewRow();
                dr[ColumnID] = 0;
                dr[ColumnName] = "Select";
                dt.Rows.InsertAt(dr, 0);

                RadCombo.BindingContext = new BindingContext();
                RadCombo.DataSource = ds.Tables[TableName];
                RadCombo.DisplayMember = ColumnName;
                RadCombo.ValueMember = ColumnID;
                // RadCombo.SelectedValue = 0;

my doubt is how to use  Radcombobox in wpf
bindingcontext,
datasource,
displaymember,
valuemember ,
it does not support in wpf....
regards,
vignesh
0
Valeri Hristov
Telerik team
answered on 11 Sep 2009, 02:19 PM
Hi vignesh,

As far as I know the corresponding properties are:
BindingContext -> DataContext
DataSource -> ItemsSource
DisplayMember -> DisplayMemberPath
ValueMember -> SelectedValuePath

Sincerely yours,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
kottu
Top achievements
Rank 1
answered on 11 Sep 2009, 05:22 PM
thanks for u r reply

How to assign dataset in Radcombobox????????

ds ---->dataset

RadCombo.ItemSource = ds.Tables[TableName];

Its not working...............
can u give me  some sample code ....

regards,
vignesh
0
kottu
Top achievements
Rank 1
answered on 12 Sep 2009, 11:26 AM
thanks a  lot  Valeri Hristov...

I got it man........

RadCombo.ItemsSource = datatable1.DefaultView;

Thanks for ur co-operation.....




regards ,
vignesh..







Tags
ComboBox
Asked by
kottu
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
kottu
Top achievements
Rank 1
Share this question
or