开发者

changing checkbox label colour on databound

Ive searched everywhere for this but cant find the answer. I have used the following code before to change repeated items properties in an asp.net repeater as after they have been bound to do things i couldnt do prior to binding them.

    protected void rowRepeater_ItemBo开发者_StackOverflowund(object sender, RepeaterItemEventArgs e)
    {
       foreach (RepeaterItem item in rptStockists.Items)
        {
        }
    }

Now i am wanting to do something similar but with a chekbox list. i want to change the colour of the labels and i know i can only do this after the list has been bound. I have notice checkboxlists only provide the parameter OnDataBound in intellisense, doesnt give me OnItemDataBound that repeaters do. What would be the equivalent i could use here?


Well, you can use that DataBound event like:

protected void cbl_DataBound(object sender, EventArgs e)
{
    foreach (ListItem item in cbl.Items)
    {

    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜