in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

Browse by Tags

All Tags » Win.Net » Development (RSS)
  • Element Type of CLR

    et_unknown Undefined type. et_void ELEMENT_TYPE_VOID. et_boolean ELEMENT_TYPE_BOOLEAN, System.Boolean. et_char ELEMENT_TYPE_CHAR, System.Char. et_int8 ELEMENT_TYPE_I1, System.SByte. et_uint8 ELEMENT_TYPE_U1, System.Byte. et_int16 ELEMENT_TYPE_I2, System.Short. et_uint16 ELEMENT_TYPE_U2, System.UShort. et_int32 ELEMENT_TYPE_I4, System.Int. et_uint32 ELEMENT_TYPE_U4, System.UInt. et_int64 ELEMENT_TYPE_I8, System.Long. et_uint64 ELEMENT_TYPE_U8, System.ULong. et_float32 ELEMENT_TYPE_R4, System.Float...
    Posted Jun 28 2008, 10:21 AM by wicky with | with no comments
    Filed under: , ,
  • Toolbar, Focus and Validation

    通常一个控件在离开焦点的时候,才会触发Validation事件,而Toolbar是不会获得焦点的,所以在输入空间输入了某些内容,直接点Toolbar按钮,当前输入的内容可能并没有更新到控件的相关属性,或者是DataSource里面。 比如RichTextBox,在没用DataBinding (Rtf)的时候,程序里赋SelectedText,改变会更新到Text属性,如果使用了DataBinding (Rtf),改变就不会更新到Text属性,太奇怪了。当然,在没有离开焦点的时候,Text的改变不会更新到DataSource。 我们可以使用以下函数解决这个问题: 1) 调用相关Container的ValidateChildren 方法 (强制控件进行Validation) 2) 调用相关控件的BindingContext[].EndCurrentEdit方法 (强制把变动更新到DataSource) 另外可以参考本人 另外一篇关于DataSourceUpdateMode的文章
    Posted Mar 21 2007, 08:52 AM by wicky with | with no comments
    Filed under: ,
  • XtraGrid: How to filter a second LookUp column based on a first LookUp column's value

    https://www.devexpress.com/Support/Center/ViewKBIssue.aspx?kbid=A237&searchtext=lookupedit+datasource&pgid=ecb3be56-c75a-4166-aa68-cb462cd2dd2b&pid=382e0f17-f133-4866-aa3f-aeb2f50b59b7 Description Let's assume that there is an XtraGrid with two combo boxes (dropdown lists) in one row. The list items of the second combo depends upon the current value of the first combo. If a user selects any value in the first combo, the second combo must filter its list items. Is this possible to implement...
    Posted Feb 13 2007, 11:43 AM by wicky with | with 1 comment(s)
    Filed under: ,
  • 关于初次DataBind的时候会触发ValueChanged事件的问题

    由于MS Binding的机制的影响,在ShowDialog的时候,数据绑定的相关控件会触发ValueChanged事件。 对于XtraEditors,会触发EditValueChanged事件。 但是这个是我们不期望的,因为他只相当于Form的初始化。 一个解决办法就是在Form Load事件里面邦定EditValueChanged事件, 而不在InitializeComponent里面绑定。 这样第一次的数据绑定将不会激发EditValueChanged事件。
    Posted Feb 13 2007, 11:26 AM by wicky with | with no comments
    Filed under: ,
  • DataSourceUpdateMode in DataBinding

    有时我们希望在控件的值一修改就更新绑定的数据源。但是默认的DataBinding却不会这样做。 因为默认的DataSourceUpdateMode是OnValidation,一般也就是在离开焦点的时候才做这件事。 如果用DevExpress的XtraEditors,通常有几种方法: 1) call BaseEdit.DoValidate方法 2) call BindingContext[].EndCurrentEdit方法 3) 绑定的时候将DataSourceUpdateMode设置成OnPropertyChanged 例如: luePayTerms.DataBindings.Add("EditValue", dt, "PAYTERMS", false, DataSourceUpdateMode.OnPropertyChanged ); 某些情况下,由于MS Binding机制的关系,可能只有第3)种方法可用。 比如在LookupEdit的EditValueChanged事件里面就是这样的。
    Posted Feb 13 2007, 11:18 AM by wicky with | with 3 comment(s)
    Filed under: , ,
  • 如何得到硬盘序列号?.NET版本[C#]

    http://study.pay500.com/4/s44901.htm 硬盘序列号(Serial Number)不等于卷标号(Volume Name),后者虽然很容易得到,但是格式化分区后就会重写,不可靠。遗憾的是很多朋友往往分不清这一点。 要得到硬盘的物理序列号,可以通过WMI,也就是Win32_PhysicalMedia.SerialNumber。可惜的是Windows 98/ME的WMI并不支持这个类,访问时会出现异常。 受陆麟的例子的启发,我们还可以通过S.M.A.R.T.接口,直接从RING3调用API DeviceIoControl()来获取硬盘信息,而不需要写VXD或者DRIVER。这样这个问题就解决了,我对它进行了封装,大量使用了P/Invoke技术,一个完整的Library。支持Windows 98-2003。 使用上很简单: HardDiskInfo hdd = AtapiDevice.GetHddInfo(0); // 第一个硬盘 Console.WriteLine("Module Number: {0}", hdd.ModuleNumber); Console...
    Posted Feb 07 2007, 11:46 AM by wicky with | with no comments
    Filed under: , ,
  • Error: The constructor to deserialize an object of type 'XXX' was not found.

    You implement ISerializable interface. using System.Runtime.Serialization; [Serializable] class YourClassName { ... } You MUST wrote in your derived class this protected constructor for deserialization without any implementation. protected YourClassName(SerializationInfo info, StreamingContext context) :base(info,context){} Now you can serialize and deserialize your collection.
    Posted Nov 06 2006, 03:51 PM by wicky with | with no comments
    Filed under: , ,
  • C#编程:时间格式的转换

    http://dotnet.chinaitlab.com/CSharp/525282.html 有时候我们要对时间进行转换,达到不同的显示效果 默认格式为:2005-6-6 14:33:34 如果要换成成200506,06-2005,2005-6-6或更多的该怎么办呢 我们要用到:DateTime.ToString的方法(String, IFormatProvider) using System; using System.Globalization; String format="D"; DateTime date=DataTime,Now; Response.Write(date.ToString(format, DateTimeFormatInfo.InvariantInfo)); 结果输出 Thursday, June 16, 2005 参数format格式详细用法 格式字符 关联属性/说明 d ShortDatePattern D LongDatePattern f 完整日期和时间(长日期和短时间) F FullDateTimePattern(长日期和长时间) g 常规(短日期和短时间...
    Posted Sep 22 2006, 04:56 PM by wicky with | with 1 comment(s)
    Filed under: , ,
  • C#中的Nullable Type和??操作符

    The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand. 以前我们会这么写: string param = Request.Params[ "param" ]; if ( param == null ) { param = defaultValue; } 或 string param = Request.Params[ "param" ] == null ? defaultValue : Request.Params[ "param" ]; 现在这么写就可以了: string params = Reqeust.Params[ "param" ] ?? defaultValue; 够简单了吧。 定义Nullable Type: int? a = null; int b = 1; int c = a??0 + b;
    Posted Jun 14 2006, 10:47 PM by wicky with | with 1 comment(s)
    Filed under: , ,
Copyright SDT, 2006-2009. All rights reserved.