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
156 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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