I have a dropdownlist which i'm binding to DataTable.
ddlItems.DataSource = dt;
ddlItems.DataBind();
in the final html I have :
...
<option value="-1">aaa</option>
<option value="-2">bbb</option>
...
But I want to catch the bind event in the DataBound event and to add an attribute to each listItem , so that the Final Html will be :
...
<option value="-1" MyAttr="lalala1" >aaa</option>
<option value="-2" MyAttr="lalala2" >bbb</option>
...
But the signiture of the databound event is :
protected void ddlItemsDataBound(object sender, EventArgs e)
and e has only :
How can i catch the specific bounded listItem ?
p.s.
I do NOT want to cancel the databound event , and to use regular loop (adding lisItems in a loop)