This is a migrated thread and some comments may be shown as answers.

RadGrid List<T> Binding With TemplateColumns

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dave
Top achievements
Rank 1
dave asked on 08 Oct 2008, 11:28 PM
I have a RadGrid that is bound to a list<T> where T is:

public class FullProductWithDescription  
    {  
        public int ID { getset; }  
        public int MainProductID { getset; }  
        public string MainProductDescription { getset; }  
        public int SubProductID { getset; }  
        public string SubProductDescription { getset; }  
        public bool Kit { getset; }  
 
    } 

 

The RadGrid is built programmatically in the page's Init event handler. I want to add two template columns (1 check box, and 1 text box). So when the end user clicks the check box the text box becomes enabled. If more items are added to my list<T> can I have the new records show in the grid while preserving the states of the check box and text box? Obviously when I call DataBind on the grid I get the new rows but the check box and text box data disappear. Any ideas?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
answered on 09 Oct 2008, 03:50 AM
Hi dave,

Generally when adding template column programmatically you need to add the control in InsantiateIn method of the template and set value in DataBinding event if you work with ITemplate. Other possible approach is to use ItemCreated to create these controls.

Can you post more info about your scenario?

Vlad
Tags
Grid
Asked by
dave
Top achievements
Rank 1
Answers by
Vladimir
Top achievements
Rank 1
Share this question
or