S
Simon
Hi,
I'd like to extend the CheckBoxList control so that I can set multiple
selection declaratively. Right now, I'm thinking of simply giving it a
string containing all the selected values, each values separated by a
comma. So, baiscally I have this :
public class TSGControlCheckBoxList :
System.Web.UI.WebControls.CheckBoxList
{
public string SelectedItems
{
set { }
get { }
}
}
Problem is, I'm a complete newbie when it comes to making my own Web
Controls and I have a few questions:
- In the set method for SelectedItems, where should I store my string?
In the viewstate?
- During which phase of the lifecycle should I set the ListItem as
checked by the values in SelectedItems?
- What should the get look like? Would it work to simply go trough all
the ListItem and build my string like that or would an error occur
because they might not yet be built correctly?
So, if you can offer any insight or an example, your help would be
appreciated.
Simon Picard
I'd like to extend the CheckBoxList control so that I can set multiple
selection declaratively. Right now, I'm thinking of simply giving it a
string containing all the selected values, each values separated by a
comma. So, baiscally I have this :
public class TSGControlCheckBoxList :
System.Web.UI.WebControls.CheckBoxList
{
public string SelectedItems
{
set { }
get { }
}
}
Problem is, I'm a complete newbie when it comes to making my own Web
Controls and I have a few questions:
- In the set method for SelectedItems, where should I store my string?
In the viewstate?
- During which phase of the lifecycle should I set the ListItem as
checked by the values in SelectedItems?
- What should the get look like? Would it work to simply go trough all
the ListItem and build my string like that or would an error occur
because they might not yet be built correctly?
So, if you can offer any insight or an example, your help would be
appreciated.
Simon Picard