DataViewConverter.cs
上传用户:szgaoree
上传日期:2009-01-05
资源大小:74k
文件大小:1k
- using System;
- using System.Text;
- using System.Data;
- namespace AjaxPro
- {
- /// <summary>
- /// Provides methods to serialize and deserialize a DataView object.
- /// </summary>
- public class DataViewConverter : IJavaScriptConverter
- {
- public DataViewConverter() : base()
- {
- }
- public override string Serialize(object o)
- {
- if(!(o is DataView))
- throw new NotSupportedException();
-
- DataView dv = (DataView)o;
-
- DataTableConverter dtc = new DataTableConverter();
- return dtc.Serialize(dv.Table);
- }
- public override Type[] SerializableTypes
- {
- get
- {
- return new Type[]{typeof(DataView)};
- }
- }
- }
- }