[2005] Events in a UserControl
Good Day All
Am using a Infragistic Ultragrid Control and in the Control there is no event <b>RowDataBound</b>, So i decided to add it. I right Clicked on the Control and went to Properties and clicked at the lightning sign for events and double clicked "DataBound" event and next to it i started coding my event like this
Code:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
//Were ony intestested in Rows that contain Data
//Get a reference to the Data used to Databound the row
DataRowView drv = (DataRowView)e.Row.DataItem;
if (Convert.ToInt32(drv["Actv1"]) == 262)
{
//The Current Product has 0 items in Stock
e.Row.Font.Bold = true;
e.Row.ForeColor = System.Drawing.Color.Red; //Set the text color red
e.Row.ForeColor = System.Drawing.Color.White;
}
}
}
The Compiler did not complain. Now i want to use this event in the like in MS Gridview. How do i get that event to be Fired ?
Thank you