Solved

Need help for retrieving row index of System.Windows. Control.DataGrid placed in WPF usercontrol when we mouse hover it.

Posted on 2014-09-24
2
150 Views
Last Modified: 2014-10-09
Hello Everyone.

Basically I am converting an Window form application in C# to WPF.
The designed has taken a usercontrol and then add datagrid.
Now in this datagrid,I have three columns.SNo,A uniqueNumber and a remove button.
(1)First,I wanted to know how to delete the column on press of that remove button as I am not able to retrieve the rowindex.
(2)on mouse hover,I wanted to change the color of data grid.Color is changing using XML style but not able to change the color of button in the third column.

Please help.I found so many ans as selected index,using visualtreehelper class,but not able to retrieve the data.mostly in every case I am getting NULL as result.
Hence I will appreciate id directly someone can put the exact code.
I have described the complete scenario.If you require more detail  to answer,please let me know.
0
Comment
Question by:BYTECHINDIA
2 Comments
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 40342696
You have to handle on selection changed and delete button event. This link should help you. http://www.dotnetcurry.com/showarticle.aspx?ID=563
0
 

Author Comment

by:BYTECHINDIA
ID: 40343230
Yes Sir,Actually I was trying to retrieve the item index in mouse hover event where we dont select the cell.As on mouse hover i was changing the color of grid row via XAML but in that case ,color of button was not getting changed.This concept,I am unable to find out but then I took button as an image where color is changing and on click event retrieving the rowindex too to delete.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now