Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
Adding my UserControl to each row of DataGrid
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Mahdi Ajoudanian
10y
982
1
Reply
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;
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Hot keys in Wpf
How to pass data between two user controls in WPF?