This question is locked. New answers and comments are not allowed.
i use a radlistbox to display a list of clients. i have set the DataSource, DisplayMember,ValueMember property. during the ItemBound event i set the DescriptionText property for each RadListBoxItem. when the app loads i can only see the DisplayMemebr. the DescriptionText doesn't appear. i have put the RadLisBox inside a RadPanelBar. after i switch to another RadPanelBarGroupElement and come back to the element which shows the client list box, everything is fine. RadPanelBar is set to outlook style.
how can i solve this issue?
how can i solve this issue?
5 Answers, 1 is accepted
0
Hello Shaihan Murshed,
Thank you for writing. I am afraid that I could not reproduce the behavior you described.
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thank you for writing. I am afraid that I could not reproduce the behavior you described.
Please post the code that you are using so that I may assist you further.
Best wishes,
Victorthe Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Shaihan
Top achievements
Rank 1
answered on 04 Mar 2010, 06:26 PM
here is the code for binding data and the event handler
i have attached 2 screenshots before and after switching to another group in the navigation panel.
private void BindNaviagationPanelData() |
{ |
// bind client listbox datasource |
lstbxClients.DataSource = GlobalLookup.Clients; |
lstbxClients.DisplayMember = "FullName"; |
lstbxClients.ValueMember = "Id"; |
lstbxClients.ItemDataBound += new Telerik.WinControls.UI.ItemDataBoundEventHandler(lstbxClients_ItemDataBound); |
} // end BindNaviagationPanelData |
void lstbxClients_ItemDataBound(object sender, Telerik.WinControls.UI.ItemDataBoundEventArgs e) |
{ |
RadListBoxItem item = e.DataBoundItem as RadListBoxItem; |
UserBasicProfile i = (UserBasicProfile)e.DataItem; |
StringBuilder dsc = new StringBuilder(); |
if (string.IsNullOrEmpty(i.Phone)) |
{ |
dsc.Append("Phone: \n"); |
} |
else |
{ |
dsc.Append("Phone: ").Append(i.Phone).Append("\n"); |
} |
if (string.IsNullOrEmpty(i.Email)) |
{ |
dsc.Append("Email: \n"); |
} |
else |
{ |
dsc.Append("Email: ").Append(i.Email); |
} |
item.DescriptionText = dsc.ToString(); |
item.DescriptionFont = new Font(item.Font.FontFamily, item.Font.Size, FontStyle.Regular); |
} // end lstbxClients_ItemDataBound |
i have attached 2 screenshots before and after switching to another group in the navigation panel.
0
Accepted
Hi Shaihan Murshed,
You must subscribe to ItemDataBound event before you set the data source. The items are created when the data source is set. You simply need to move lstbxClients.ItemDataBound line before the lstbxClients.DataSource line.
Kind regards,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You must subscribe to ItemDataBound event before you set the data source. The items are created when the data source is set. You simply need to move lstbxClients.ItemDataBound line before the lstbxClients.DataSource line.
Kind regards,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Shaihan
Top achievements
Rank 1
answered on 05 Mar 2010, 01:53 PM
yup..... that solves my problem
thanks
thanks
0
Hi Shaihan Murshed,
Write again if you need further assistance.
Sincerely yours,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Write again if you need further assistance.
Sincerely yours,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.