I came late to the party but would like to add a couple of pointers.
1. There is an event in the life of David that was secret for many years to all but God. This event showed David's instincts and marked him as a man 'according to God's own heart'.
[color=0000ff]“And David said unto Saul, Thy servant kept his father’s sheep, and there came a lion, and a bear, and took a lamb out of the flock: And I went out after him, and smote him, and delivered it out of his mouth: and when he arose against me, I caught him by his beard, and smote him, and slew him. Thy servant slew both the lion and the bear: and this uncircumcised Philistine shall be as one of them, seeing he hath defied the armies of the living God.” (1Sam 17:34-36 KJVS)[/color]
David was by nature and task a 'good shepherd'. He recklessly risked his life for a lamb from the flock. I suspect that God saw it and said 'that's the man to be king'.
2. The second event comes later in his reign. David was king and his enemies scattered. At such a time most eastern monarchs would have constructed a 'hit list' but David's instinct again shows his character.
[color=0000ff]“And the king said, Is there not yet any of the house of Saul, that I may shew the kindness of God unto him? And Ziba said unto the king, Jonathan hath yet a son, which is lame on his feet.” (2Sam 9:3 KJVS)[/color]
This is not just 'kindness' but the 'kindness of God'. The word is 'chesed' - covenant-mercy. This story is a glorious expression of the 'kindness of God' to poor broken sinners who are given a permanent place at His table. It's another example of David's heart being like God's.
In many aspects David's heart was not like God's, but in these aspects it was.