Prithvi Raj Nandiwal
Prithvi Raj Nandiwal

Reputation: 3284

How to change value of a property 'SelectedValue' of 'ListPicker' control programmatically

I have two 'ListPicker' controls. How could I make it so that after user changes 'SelectedValue' property of one of these controls a corresponding property of a second control would also change?

Can someone please provide us a example?

Thanks a lot

Upvotes: 0

Views: 194

Answers (1)

user1336170
user1336170

Reputation:

you can set select item like this code.when you fill list at the time you can set selected item property.

 private void FillAssetType(int assetTypeID)
        {
            List<TbAssetType> lst = Asset.GetAssetType();
            TbAssetType tb = new TbAssetType { AssetTypeName = "Select Asset Type" };
            lst.Insert(0, tb);
            lstpickAssetType.ItemsSource = lst;
            lstpickAssetType.SelectedItem = lst.Where(p => p.AssetTypeID == assetTypeID).FirstOrDefault();
        }

Upvotes: 1

Related Questions