C
Chris Peeters
Hi,
I have a listBox listed with colornames and a panelcontrol that takes
the color of selecteditem from the listbox whenever I click a different
item:
protected void lstColors_SelectedIndexChanged(object sender, EventArgs
e)
{
pnlColor.BackColor =
Color.FromName(lstColors.SelectedItem.Value);
}
The panelcontrol draws correctly whenever I click in the listbox but
when I click on another button on the webform the panelcontrol looses
its color although EnableViewState is set to true for the panelcontrol.
Its only when I set the EnableViewState of the listBox to false that the
panelcontrol keeps its state (no matter what the EnableViewState of the
panelcontrol is set to) ???
how do you explain this strange behavior ?
thank you
Chris
I have a listBox listed with colornames and a panelcontrol that takes
the color of selecteditem from the listbox whenever I click a different
item:
protected void lstColors_SelectedIndexChanged(object sender, EventArgs
e)
{
pnlColor.BackColor =
Color.FromName(lstColors.SelectedItem.Value);
}
The panelcontrol draws correctly whenever I click in the listbox but
when I click on another button on the webform the panelcontrol looses
its color although EnableViewState is set to true for the panelcontrol.
Its only when I set the EnableViewState of the listBox to false that the
panelcontrol keeps its state (no matter what the EnableViewState of the
panelcontrol is set to) ???
how do you explain this strange behavior ?
thank you
Chris