all groups > asp.net datagrid control > december 2005 >
You're in the

asp.net datagrid control

group:

Help Creating Dynamic Checkbox Column



Help Creating Dynamic Checkbox Column jeffcrater NO[at]SPAM hotmail.com
12/11/2005 9:42:07 PM
asp.net datagrid control: I am using C#.

I can dynamically create a template column but how do I place a
Re: Help Creating Dynamic Checkbox Column Ahmed Fouad
12/20/2005 5:11:10 PM
Use ItemCreated event for this and code something like the following:

if (e.Item.ItemType == ListItemType.Header) {
CheckBox chk = new CheckBox();
// TODO: Initialize any properties of chk as required..........

// And finally add the CheckBox instance to Controls collection of
e.Item.Cells[0]
e.Item.Cells[0].Controls.Add(chk);
}

[quoted text, click to view]

AddThis Social Bookmark Button