李晓亮的博客

导航

第三方控件C1.Win.C1FlexGrid用法小结

1.为指定列设置DataMap

代码
    //DataMap必须是一个字典集合
    public void SetGridDataMap(C1.Win.C1FlexGrid Grid1,string strColName)
        {
            
try
            {
                ListDictionary listDic
=new ListDictionary();
                listDic.Add(
"0""未完成");
                listDic.Add(
"1""已完成");
                Grid1.Cols[strColName].DataMap
=listDic;
                Grid1.Cols[strColName].AllowEditing 
=false;
            }
            
catch(Exception err)
            {
                
throw new Exception(err.Message);
            }
        }

    
public void SetGridDataMap(C1.Win.C1FlexGrid Grid1,string strColName)
        {
            
try
            {
                ArrayList arrLstObj
=new ArrayList();
                arrLstObj.Add(
new DictionaryEntry("0","未完成"));
                arrLstObj.Add(
new DictionaryEntry("1","已完成"));
                Grid1.Cols[strColName].DataMap
=arrLstObj;
                Grid1.Cols[strColName].AllowEditing 
=false;
            }
            
catch(Exception err)
            {
                
throw new Exception(err.Message);
            }
        }

 

 

 

posted on 2010-10-27 16:49  LeeXiaoLiang  阅读(2535)  评论(0)    收藏  举报