Hi,
i have a requirement to display grouped items in radlistbox like below
General Action
Transfer
Document
Re-Open
Escalation
Parts
Field Involvement
Other Actions
Marketing
Owner Advantage
i have to load these items in runtime(server side) because based on some conditions i have to disable/enable listitems.Also i have to differentiate the group name and child by font and space like above.
1.Now i can able to disable items. But i am not able to insert space before the child items. please check the code below which i used to generate these items
2.For group items if i disable it , the foreground color gets changed to grey. which i want it in black color like above.
foreach (var group in CASEACTION_GROUPS)
{
RadListBoxItem groupListItem = new RadListBoxItem { Text = group, Enabled = false };
groupListItem.Font.Bold = true;
groupListItem.Font.Italic = true;
groupListItem.ForeColor = Color.Black;
listBoxCaseActions.Items.Add(groupListItem);
foreach (var caseActon in caseActions)
{
var listItem = new RadListBoxItem { Text = caseActon.EntityName, Value = caseActon.ObjectTypeCode };
if (!caseActon.HasPrivileges)
{
listItem.Enabled = false;
listItem.Text = string.Concat(caseActon.EntityName, CASEACTION_NO_PRIVILEGES);
}
else if ((caseActon.ObjectTypeCode.Equals("10022") && !_caseStatus.ToLower().Equals(CASE_STATUS_PENDING_CLOSED))) //Close Case
{
listItem.Enabled = false;
listItem.Text = string.Concat(caseActon.EntityName, string.Format(CASEACTION_NOT_AVAILABLE, _caseStatus));
}
else if (caseActon.ObjectTypeCode.Equals("10051")) //Re-open Case
{
if (_caseStatus.ToLower().Equals(CASE_STATUS_CLOSED))
{
this._caseActionsBusinessComponent = _caseActionsBusinessComponent ?? new CaseActionsBusinessComponent();
var role = this._caseActionsBusinessComponent.GetUserSecurityRole();
if (CASEACTION_USER_ROLE.Where(r => role.ToLower().Contains(r)).Count() > 0)
{
listItem.Enabled = true;
}
else
{
listItem.Enabled = false;
listItem.Text = string.Concat(caseActon.EntityName, CASEACTION_NO_PRIVILEGES);
}
}
else
{
listItem.Enabled = false;
listItem.Text = string.Concat(caseActon.EntityName, string.Format(CASEACTION_NOT_AVAILABLE, _caseStatus));
}
}
listBoxCaseActions.Items.Add(listItem);
}
}
Am I missing something.Can anybody help me on this issue.
Thanks in advance
Jayaprakash Krishnan