C
Colin Basterfield
Hi,
I have a datalist which has a complete list of possible names and a check
box declared in the ItemTemplate. I get the name using the standard
mechanism:
Convert.ToString(DataBinder.Eval(Container.DataItem,"RevenueName"))
At the time of populating the grid I don't care whether the chckbox is
checked or not, I do that afterwards once I have got the site which has its
own internal list of selected names.
I am then attempting to iterate thro the datalist items:
for (int i = 0; i < dlRevAssoc.Items.Count; i++)
revName = (dlRevAssoc.Items.Controls[0] as
DataBoundLiteralControl).Text;
and as can be seen above all I want initially is the Text relating to the
name, to use to find it in my Site specific list but the text that gets
assigned to the string 'revName' is encased in \r\n\t\t\t\t\t\t\, i.e.
either side e.g.
\r\n\t\t\t\t\t\t\Adventure Park\r\n\t\t\t\t\t\t\
I am struggling to see how I can get just the text, e.g. Adventure Park?
Obviously there must be lots of other ways to do the whole thing but I don't
want to break my domain model.
Many thanks in advance
Colin B
I have a datalist which has a complete list of possible names and a check
box declared in the ItemTemplate. I get the name using the standard
mechanism:
Convert.ToString(DataBinder.Eval(Container.DataItem,"RevenueName"))
At the time of populating the grid I don't care whether the chckbox is
checked or not, I do that afterwards once I have got the site which has its
own internal list of selected names.
I am then attempting to iterate thro the datalist items:
for (int i = 0; i < dlRevAssoc.Items.Count; i++)
revName = (dlRevAssoc.Items.Controls[0] as
DataBoundLiteralControl).Text;
and as can be seen above all I want initially is the Text relating to the
name, to use to find it in my Site specific list but the text that gets
assigned to the string 'revName' is encased in \r\n\t\t\t\t\t\t\, i.e.
either side e.g.
\r\n\t\t\t\t\t\t\Adventure Park\r\n\t\t\t\t\t\t\
I am struggling to see how I can get just the text, e.g. Adventure Park?
Obviously there must be lots of other ways to do the whole thing but I don't
want to break my domain model.
Many thanks in advance
Colin B