I have two listboxes (source and destination listbox)
I added server side code to have the checkbox checked in the destination listbox depending on a database value. Here is the code to do that. But when I transfer one of the items back to the source listbox, all the checkboxes get unchecked in the destination listbox. Can you tell me why this is happening?
protected void RadListBoxDestination_Inserted(object sender, RadListBoxEventArgs e)
{
string selectedQlfr = QlfrDropDown.SelectedValue;
BtodGenericGrid GridSchema = BtodGenericGrid.CreateInstance(selectedQlfr, "Default", "-1");
for (int i = 0; i < e.Items.Count; i++)
{
string colName = e.Items[i].Text.ToString().ToUpper();
for (int x = 0; x <= GridSchema.ColumnNamesWithAliasSplit.Length - 1; x++)
{
if (colName == GridSchema.ColumnNamesWithAliasSplit[x].ToUpper())
{
if (GridSchema.ColumnVisibleSplit[x].ToString() == "1")
{
e.Items[i].Checked = true;
}
break;
}
}
// e.Items[i].Checked = true;
}
}
I added server side code to have the checkbox checked in the destination listbox depending on a database value. Here is the code to do that. But when I transfer one of the items back to the source listbox, all the checkboxes get unchecked in the destination listbox. Can you tell me why this is happening?
protected void RadListBoxDestination_Inserted(object sender, RadListBoxEventArgs e)
{
string selectedQlfr = QlfrDropDown.SelectedValue;
BtodGenericGrid GridSchema = BtodGenericGrid.CreateInstance(selectedQlfr, "Default", "-1");
for (int i = 0; i < e.Items.Count; i++)
{
string colName = e.Items[i].Text.ToString().ToUpper();
for (int x = 0; x <= GridSchema.ColumnNamesWithAliasSplit.Length - 1; x++)
{
if (colName == GridSchema.ColumnNamesWithAliasSplit[x].ToUpper())
{
if (GridSchema.ColumnVisibleSplit[x].ToString() == "1")
{
e.Items[i].Checked = true;
}
break;
}
}
// e.Items[i].Checked = true;
}
}