in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

Browse by Tags

All Tags » Simple Projects (RSS)
  • SimpleDatabase.DbTable now support Binary data

    SimpleDatabase.DbTable 现在已经支持更新二进制类型。 DbTable.Insert 和 DbTable.Update已经可以使用来更新二进制字段,只需将参数设置成byte[]。 如下类型测试通过: Oracle: Blob Sql Server: Image, Varbinary, Binary
    Posted Aug 14 2007, 03:40 PM by wicky with | with no comments
    Filed under:
  • ColumnFormatString of SimpleGridView

    这个阔别已久的属性终于回到了GridView的怀抱,用法当然以简单而又强大为主: ColumnFormatString=";;D;000;N3;;C2;;;;;T;DT;###" -- D日期,T时间,DT日期时间,其他可为.net标准格式化字符串,与列一一对应 DefaultDateFormat="yyyy MMM dd" -- D对应的格式 DefaultDateTimeFormat="MMM dd yyyy, HH:mm:ss" -DT对应的格式 DefaultTimeFormat="HH:mm" -T对应的格式 DefaultIntegerFormat="N0" -整数类型对应的格式,仅在AutoColumnFormat=true有用 DefaultDoubleFormat="N2" -Double,Decimal对应的格式,仅在AutoColumnFormat=true有用 AutoColumnFormat="false" -- 自动设置列格式...
    Posted Aug 10 2007, 10:26 PM by wicky with | with 2 comment(s)
    Filed under:
  • Scroll to Bottom of TextBox

    有时我们想在textbox内容改变后,自动滚动到最后一行。一下就是解决方案: 方法1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [DllImport( "User32.dll" , CharSet = CharSet.Auto, EntryPoint = "SendMessage" )] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam,IntPtr lParam); public static void ScrollToBottom(TextBoxBase tb) { const int WM_VSCROLL = 277; const int SB_BOTTOM = 7; IntPtr ptrWparam = new IntPtr(SB_BOTTOM); IntPtr ptrLparam = new IntPtr(0); SendMessage(tb.Handle, WM_VSCROLL, ptrWparam, ptrLparam); } 方法2: 1 2 3 4 5 public...
    Posted Jun 15 2007, 08:41 AM by wicky with | with no comments
    Filed under: ,
  • Make fixed columns with SimpleGridView

    Just set SimpleGridView.FixedColumns to the number of columns to be fixed, and then adjust your gridview style. For example: .sgvFixedColumnHeaderCell { position: relative; left: expression(parentNode.parentNode.parentNode.parentNode.parentNode.scrollLeft-1); z-index: 10; } .sgvFixedColumnDataCell { background-color: white; position: relative; left: expression(parentNode.parentNode.parentNode.parentNode.parentNode.scrollLeft-1); z-index: 10; } .sgvHeaderRow{ POSITION: relative; TOP: expression(this...
    Posted Jun 08 2007, 07:53 PM by wicky with | with no comments
    Filed under:
  • 记一次对话:SimpleGridView.MultipleSelectDataSourceField作什么用?

    注:对话经整理,有删节。 Peter_Li_ZY says: SelectValueField="ID" AllowMultipleSelect="True" MultipleSelectDataSourceField="INGROUP" MultipleSelectDataSourceField 作什么用的? CheckBox选定不是根据SelectValueField吗? Wicky_Hu_WQ says: 确实有点难懂。 要回忆一下才行 等一回写一篇2000字的blog (注:这是夸张的修辞手法) Peter_Li_ZY says: 晕,回忆录 Wicky_Hu_WQ says: 是这样的 MultipleSelectDataSourceField 是用来决定哪一列是checkbox SelectValueField是用来决定checkbox 列checked 的时候,保存的值 SelectValueField="ID" AllowMultipleSelect="True" MultipleSelectDataSourceField="INGROUP" INGROUP就是在界面上的checkbox对应的列...
    Posted Jan 12 2007, 11:22 AM by wicky with | with no comments
    Filed under:
  • HandleStringAsParameter in SimpleDatabase.DbTable

    在SimpleComponents里面,SimpleDatabase的Insert/Update/Delete的处理都是拼凑成sql语句执行的,这样做比较通用,但是有安全性的漏洞,处理日期方面也不大方便。所以在SimpleControls里面,已开始已经全部改成使用Parameter的形式。但是在测试的过程中,发现不同的数据库结果不一样。所以添加HandleStringAsParameter属性,默认是true。如果发现执行有问题,可以尝试设置HandleStringAsParameter=false。
    Posted Dec 29 2006, 10:40 AM by wicky with | with no comments
    Filed under:
  • SimpleComboBox

    SimpleControls.Web添加一个SimpleComboBox控件。
    Posted Jul 10 2006, 05:42 PM by wicky with | with no comments
    Filed under:
  • SimpleCache

    ASP.Net提供很好的缓存对象和页面的机制(System.Web.Caching)。 其中缓存对象是可以用在Web和WinForm程序里面的。 比如: public static void InitDropDownList(DropDownList ddl, string tableName, string valueField, string textField, int options, string selectedValue) { DataTable dt = null ; object o = SimpleCache.Get(tableName); if (o != null ) { dt = o as DataTable; } if (dt == null ) { ...... dt = _db.ExecQuery(sql); //cache it for 1 hour SimpleCache.Insert(tableName, dt, null , DateTime.Now.AddHours(1), SimpleCache.NoSlidingExpiration); }...
    Posted Jun 24 2006, 02:27 PM by wicky with | with no comments
    Filed under:
  • TextBox.ReadOnly in ASP.Net 2.0 and SimpleTextBox.ClientReadOnly

    有时候,我们不希望用户直接编辑TextBox,而是希望通过客户端脚本的方式来设置内容,一般的做法是设置TextBox的属性ReadOnly为true。但在ASP.NET 2.0里有了变化,设置了ReadOnly为true的TextBox,在服务器端不能通过Text属性获取在客户端设置的新内容,在Reflector里比较一下LoadPostData的实现 .NET 1.1中, bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection) { string text1 = this.Text; string text2 = postCollection[postDataKey]; if (!text1.Equals(text2)) { this.Text = text2; return true; } return false; } .NET 2.0中, protected virtual bool LoadPostData(string postDataKey,...
    Posted Jun 23 2006, 11:27 AM by wicky with | with 2 comment(s)
    Filed under:
  • SimpleJSProgress & SimpleSelect

    SimpleControls.Web新增了2个控件: SimpleJSProgress: javascript进度条。 SimpleSelect: 这个经典Tools.Net控件(TSelect)终于移植进了Simple Web。 算法基本上没有变化,慢慢再优化吧。 毫无疑问,Tools.Net的存在意义将越来越小了。 欢迎各位测试并使用。
    Posted Jun 17 2006, 05:24 PM by wicky with | with no comments
    Filed under:
  • 在客户端用脚本操作SimpleTextBox

    只要设置RegisterClientVariable=true,就可以在JavaScript代码中用与ID同名的变量操作SimpleTextBox了。 例如: <simple:SimpleTextBox ID="txtPCode" runat="server" RegisterClientVariable="True" /> <script language="javascript"> function test() { txtPCode.value = "abc"; } </script>
    Posted May 30 2006, 05:23 PM by wicky with | with 3 comment(s)
    Filed under:
  • SimpleGridView的批量编辑支持

    SimpleGridView目前添加了最基本的批量编辑支持。 设置属性AllowBulkEdit=true,则整个GridView就会处于编辑状态。 默认都是TextBox,可以使用模板列定制编辑的控件。使用模板列的ReadOnly属性设置成只读。 PostBack后使用DirtyRows或者DirtyRowsCollection取得改动过的行号。然后利用Rows集合取得修改的值。 目前只保存了修改的行号而不是所有修改的内容,所以需要在第一次PostBack是取得本页的修改内容(包括转页/排序等) 另外一个要注意的问题是,如果使用动态设置SelectCommand的SqlDataSource控件,必须保证在该控件OnInit时恢复上次的Sql,否则是取不到上次的Rows集合的。 示例(摘自CDA): (这里的GridView继承自SimpleGridView) <cda:GridView runat="server" ID="gvData" DataSourceID="dsGridView" AutoGenerateColumns="False" AllowBulkEdit="true...
    Posted May 21 2006, 02:28 PM by wicky with | with no comments
    Filed under:
Copyright SDT, 2006-2009. All rights reserved.