Hi,
I want to use WebExplorerBar to show information of model objects from a service (The service return a list like List<Model>) It is possible create a databinding to a list? The Model object has some attributes like Name, Id.... and I only want to show the name in the WebExplorerBar item. How can I do that?
I tried by this way:
foreach (var model in models ) { var item = new ExplorerBarItem { Text = model.PlantName }; group.Items.Add(item); }
This runs, but not that what I wanted. Because if I clicked an item, I have no relation to the model object.
Thanks for helping
Hi Sunnykid,
You could bind the WebExplorerBar to a List of custom objects, and then use databindings to set Text and Value fields, for example:
<DataBindings> <ig:ExplorerBarItemBinding TextField="Name" ValueField="ID" /> </DataBindings>
Then in ItemClick event, you can access these values like this:
protected void WebExplorerBar1_ItemClick(object sender, ExplorerBarItemClickEventArgs e) { string text = e.Item.Text; string id = e.Item.Value; }
After that you can get your object directly from the datasource by its ID.
Hope this helps.
thank you, this work.