Hello,
I use a TreeView with Checkboxes. I refresh my TreeView every 30 seconds with a timer. This works very well. Unfortunately, when i have selected any Items after the refresh my Selecting is lost. Is it possible, that i get my old Selection after the Refresh?
I use a ObjectDataSource (ODSLoadPlayerFromScheduler) for my TreeView.
Can you help me with the solution to my problem?
BR
Reiner
I use a TreeView with Checkboxes. I refresh my TreeView every 30 seconds with a timer. This works very well. Unfortunately, when i have selected any Items after the refresh my Selecting is lost. Is it possible, that i get my old Selection after the Refresh?
I use a ObjectDataSource (ODSLoadPlayerFromScheduler) for my TreeView.
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
LoadDB();
}
else
if
(IsPostBack)
{
LoadDBAfterPostback();
}
}
private
void
LoadDB()
{
int
projectGroupID = pgID;
if
(!parameter.ToLower().Contains(
"administrators"
))
{
ODSLoadPlayerFromScheduler.SelectParameters.Add(
"GroupName"
, parameter);
ODSLoadPlayerFromScheduler.SelectParameters.Add(
"projectGroupID"
, projectGroupID.ToString());
}
else
{
ODSLoadPlayerFromScheduler.SelectParameters.Add(
"projectGroupID"
, projectGroupID.ToString());
}
}
private
void
LoadDBAfterPostback()
{
int
projectGroupID = pgID;
if
(!parameter.ToLower().Contains(
"administrators"
))
{
ODSLoadPlayerFromScheduler.SelectParameters[
"GroupName"
].DefaultValue = parameter;
ODSLoadPlayerFromScheduler.SelectParameters[
"projectGroupID"
].DefaultValue = projectGroupID.ToString();
}
else
{
ODSLoadPlayerFromScheduler.SelectParameters[
"projectGroupID"
].DefaultValue = projectGroupID.ToString();
}
}
protected
void
Timer1_Tick(
object
sender, EventArgs e)
{
LoadDBAfterPostback();
}
Can you help me with the solution to my problem?
BR
Reiner