Hi there
I have this code that try to combine two fields into one (not sure whether this is the best approach)
Code:
protected GlbSupplierRateRegionsViewCollection GetTariffNetworkDistributorRateRegions(int SupplierID)
{
try
{
GlbSupplierRateRegionsViewCollection collection = new GlbSupplierRateRegionsViewCollection();
collection.Query
.Select(collection.Query.SupplierRateRegionID,
collection.Query.SupplierRateName + " - " + collection.Query.ConfigurationRegionName
)
.Where
(
collection.Query.SupplierRateRegionIsActive.Equal(true),
collection.Query.ConfigurationIsActive.Equal(true),
collection.Query.SupplierID.Equal(SupplierID)
)
.OrderBy(collection.Query.ConfigurationRegionName.Ascending);
collection.Query.Load();
return collection;
}
catch
{
return null;
}
}. Now I have a telerik combox box and would like data binding this combined field.Generally I use something like this GlbSupplierRateRegionsViewMetadata
.PropertyNames.??? but since ths is a combined field I am not sure what is the best approach on this. I can probably create a view to combine these 2 value but I thought there must be away within this API can handle this situation.
Code:
protected void LoadTariffNetworkDistributorRateRegions(string supplierID)
{
GlbSupplierRateRegionsViewCollection tariffNetworkDistributorRateRegions = GetTariffNetworkDistributorRateRegions(Convert.ToInt32(supplierID));
radcmbbxTariffNetworkDistributorRateRegion.DataSource = tariffNetworkDistributorRateRegions;
radcmbbxTariffNetworkDistributorRateRegion.DataTextField = GlbSupplierRateRegionsViewMetadata.PropertyNames.ConfigurationRegionName;
radcmbbxTariffNetworkDistributorRateRegion.DataValueField = GlbSupplierRateRegionsViewMetadata.PropertyNames.SupplierRateRegionID;
radcmbbxTariffNetworkDistributorRateRegion.DataBind();
foreach (RadComboBoxItem item in radcmbbxTariffNetworkDistributorRateRegion.Items)
{
item.ToolTip = item.Text;
}
}
Thanks