TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Saroj Sahoo
NA
9
0
Bind ID and name in Combobox
Jan 19 2010 1:17 AM
Hi team,
Kindly help me..how shall i bind
ID
and
DisplayName
in combobox inside Dataform. it should work properly after selecting DataGrid Records.
Following code i have written ..but its not working properly
<dataFormToolkit:DataForm x:Name="ResourceDataForm" Margin="8,4,5,9" ItemsSource="{Binding}" AutoCommit="True" AutoEdit="True" CommandButtonsVisibility="None" Header="Resource Data Form" Foreground="Black" ContentLoaded="ResourceDataForm_ContentLoaded" >
<dataFormToolkit:DataField Label="Department" >
<ComboBox Width="300" x:Name="DepartmentComboBox" SelectedItem="{Binding DepartmentID, Mode=TwoWay}" ItemsSource="{Binding Department}" DisplayMemberPath="Name"/>
</dataFormToolkit:DataField>
</dataFormToolkit:DataForm>
following is my LINQ code:
public List<ResourceDTO> GetResourceDetail()
{
List<ResourceDTO> resources = (from f in context.Resources
join add in context.Addresses on f.ResourceId equals add.AddressTypeId
where add.AddressType == "RE"
select new ResourceDTO()
{
ResourceID = f.ResourceId,
FirstName = f.FirstName,
MiddleName = f.MiddlleName,
LastName = f.LastName,
DepartmentID = f.DepartmentId,
IsActive = f.IsActive,
SalutationID = f.SalutationId,
Notes = f.Notes,
Address = new AddressDTO()
{
AddressLine1 = add.AddressLine1,
AddressLine2 = add.AddressLine2,
AddressLine3 = add.AddressLine3,
AddressLine4 = add.AddressLine4,
AddressType = add.AddressType,
AddressTypeId = add.AddressTypeId,
City = add.City,
StateID = add.StateId,
Email = add.Email,
AlternateEmail = add.AlternateEmail,
Phone = add.Phone,
AlternatePhone = add.AlternatePhone,
CountryID = add.CountryId,
County = add.County,
Fax = add.Fax,
Zip = add.Zip
},
}).ToList();
if (resources.Count() == 0)
{
// throw new Exception(BLMessage.ResourceNotFound);
}
return resources;
}
Reply
Answers (
1
)
AutoResetEvent
Browser scroll bar Problem