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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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

13 Experts available now in Live!

Get 1:1 Help Now