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
Mahdi Ajoudanian
NA
1
1.3k
Adding my UserControl to each row of DataGrid
Dec 2 2013 2:24 AM
I am writing a WPF application that reading data from a excel file, and adding them to a database with LINQ.
I want to use my own UserControl (a complex button with animation that I create with WPF User Control Library ) in each row of a DataGrid (the DataGrid shows the Database Table). I am using LINQ to add data in database. I have a problem here. I use the below method in my C# code but the cell involve this statement instead of showing the UserControl: "APButton.UserControl1" (APButton is my own Button). It's like a string!
var book = new LinqToExcel.ExcelQueryFactory(@"E:\\list.xlsx");
var query = from row in book.Worksheet("Sheet1")
let item = new
{
FullName = row["name"].Cast<string>(),
StNumber = row["stnumber"].Cast<string>(),
Branch = row["branch"].Cast<string>(),
CourseName = row["coursename"].Cast<string>(),
Status = apButton,
}
select item;
MyDataGrid.ItemsSource = query;
Reply
Answers (
0
)
Hot keys in Wpf
How to pass data between two user controls in WPF?