// Use the following code can only show the Html file, how to display the web page?
private void radListViewMarketBase_CellCreating(object sender, ListViewCellElementCreatingEventArgs e)
{
var cell = e.CellElement as DetailListViewDataCellElement;
if (cell != null && cell.Data.Name == "SN")
{
e.CellElement = new CustomDetailListViewDataCellElement(cell.RowElement, e.CellElement.Data);
}
}
public class CustomDetailListViewDataCellElement : DetailListViewDataCellElement
{
// private RadButtonElement _button;
private RadWebBrowserElement webBrowserElement;
public CustomDetailListViewDataCellElement(DetailListViewVisualItem owner, ListViewDetailColumn column) : base(owner, column)
{
}
protected override void CreateChildElements()
{
base.CreateChildElements();
// this._button = new RadButtonElement();
// this.Children.Add(this._button);
this.webBrowserElement = new RadWebBrowserElement
{
WebBrowserItem = { Url = new Uri(string.Format("http://www.abc.com.cn/include/map.shtml?d=10&code=000111")) },
};
this.Children.Add(this.webBrowserElement);
}
protected override Type ThemeEffectiveType
{
get { return typeof(DetailListViewHeaderCellElement); }
}
public override void Synchronize()
{
base.Synchronize();
this.Text = "";
// var rowView = this.Row.DataBoundItem as DataRowView;
// if (rowView != null)
// this._button.Text = rowView.Row["序号"].ToString();
// else
// this._button.Text = @"222";
}
public override bool IsCompatible(ListViewDetailColumn data, object context)
{
return data.Name == "SN" && base.IsCompatible(data, context);
}
}
