Watch the video again, see the video above the Data Grid the data in the highlight implementation function, which involves an event that is Datagrid1_itemdatabound . The implementation code is as follows:
Although the video above can be implemented, but in the VS2012 There is no such event, even the name of the control is different, VS2012 there's a control in it that's almost like this, called GridView , the same function can be implemented, the name of this function is called RowDataBound , specifically as follows:
<span style= "FONT-SIZE:10.5PT;" > </span><span style= "font-size:18px;" > protected Voidgridview1_rowdatabound (object sender, GridViewRowEventArgs e) { if (E.row.rowtype = = Datacontrolrowtype.datarow) { e.row.attributes.add ("onmouseover", "currentcolor= This.style.backgroundcolor;this.style.backgroundcolor= ' yellow '; "); E.row.attributes.add ("onmouseout", "this.style.backgroundcolor=currentcolor;"); } } </span>
finally found: actually these two are the same. But the video we see may be a bit of a long history, but the general content is almost the same, called Data binding (databound), but the name has changed, said is a thing.
Summary: Video is not necessarily the right, but it must be classic, is the so-called not pay attention is the driving force of the discovery of problems, it is because of the video above a little difference, so that we can better find and now a little different, prompting us to compare, and further search information, enhance our hands-on ability, Improve our ability to solve problems.