I am thinking over a way how to disable the default selection of the gridview when data get's inserted into the datagridview. I have 2 gridviews and both have an event selection changed. And they also influence eighother. A person gridview and a address gridview. The problem is the following. When I select a person from the gridview then the selectionchange event for the persongridview is being triggered. The person address is through a query being added to the datagridviewAddress. The address gridview selects the first row by default. I dont want that so I deselect it. Then the address selection change event is being triggered.
The process should be.. get a datagridviewPerson filled. Select a person or multiple persons. Add the selected persons to the datagridviewAddress with there addresses. When u select an address it should select all persons with that AddressID. What are good events to use here? Because it is kind of a loop thing and before I know it I am deselecting or clearing gridviews... and up with nothing.
To be more clear: The gridviewPerson fills with the selected data the gridviewAddress. The gridviewAddress then fills with his data the gridviewPerson and the selection is being lost. The gridviewPerson wants to fill the gridviewAddress, but there aint any selection any more. Infinite loop!
- Edited by SpaceLama Sunday, April 29, 2012 8:23 PM
Welcome to MSDN Forum. I remind you first you doesn't need to mark the clarification reply as an answer.It seems that we are confused by your post,if you still want us to help you tack this task,you'd better providing more information about your scenario,and perhaps you could paste some snippets of code on post. Currently, you can send the code to me just by email such as JasonDotWang@hotmail if your code has some security information.
Jason Wang [MSFT]
MSDN Community Support | Feedback to us