The bug with the propertygrid
New Community Forums available at http://forums.ext.net
 

Coolite Forums

Welcome Guest ( Login | Register )
 
The bug with the propertygrid
Subscribe
Last Login: 3/11/2010 6:29:35 PM
Posts: 2,
Posted 3/5/2010 9:24:45 PM

Group: Coolite Early Adopter
 

i want to generate the PropertyGridParameter with ajax method,but the
editors did't work as the code below.

 for (int i = 0; i 
< ds.Tables[0].Rows.Count; i++)
            {
               
               

                Coolite.Ext.Web.NumberField nf = new NumberField();
               
nf.ID = ds.Tables[0].Rows[i]["id"].ToString();
               
nf.AllowBlank = false;
               
               
CReadWriteXML cw = new
CReadWriteXML(int.Parse(ds.Tables[0].Rows[i]["人员编号"].ToString()),
int.Parse(nf.ID));
                float total =
float.Parse(cw.ReadIDTotal());



                Coolite.Ext.Web.PropertyGridParameter cp = new
PropertyGridParameter();
             //   cp.Params.Add(new
Coolite.Ext.Web.Parameter());
                cp.Name =
string.Format("{0}({1}{2}{3})", ds.Tables[0].Rows[i]["分解指标"].ToString(),
ChangeLogtic(ds.Tables[0].Rows[i]["目标值逻辑"].ToString()),
ds.Tables[0].Rows[i]["目标值"].ToString(),
ds.Tables[0].Rows[i]["目标值单位"].ToString());
                cp.Encode =
true;
                cp.Value = total.ToString();
               
cp.Mode = ParameterMode.Raw;
                target tr = new
target();


                tr.name = cp.Name;
                tr.id = nf.ID;



                Coolite.Ext.Web.ToolTip tp = new ToolTip();


               
                tp.Html = "已完成:" +
total.ToString();
                string
sf=ds.Tables[0].Rows[i]["目标值逻辑"].ToString();
                switch
(sf)
                {
                    case "equal":
                       
{
                            if (total ==
float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
                           
{
                                tp.Icon = Icon.Accept;
                           
}
                            break;
                        }
                   
case "morethan":
                        {
                           
if (total > float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
                           
{
                                tp.Icon = Icon.Accept;
                           
}
                            break;
                        }



                    case "morethanequel":
                       
{
                            if (total >=
float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
                           
{
                                tp.Icon = Icon.Accept;
                           
}
                            break;


                        }
                    case "lessthan":
                       
{
                            if (total <
float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
                           
{
                                tp.Icon = Icon.Accept;
                           
}
                            break;
                        }
                   
case "lessthanequel":
                        {
                           
if (total <= float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
                           
{
                                tp.Icon = Icon.Accept;
                           
}
                            break;
                        }


                    case "notequel":
                        {
                           
if (total != float.Parse(ds.Tables[0].Rows[i]["目标值"].ToString()))
                           
{
                                tp.Icon = Icon.Accept;
                           
}
                            break;
                        }


                    default: tp.Icon = Icon.Error; break;
          


                }
                li.Add(tr);
               
nf.ToolTips.Add(tp);
                cp.Editor.Clear();
               
cp.Editor.Add(nf);
                Mark.Source.Add(cp);
               


          


 


 


            }


            Mark.SetSource(Mark.Source);


        }



and then ,i want to read the Source in the
below code,and the Source has no item included in it . is this is a
bug?
 foreach (PropertyGridParameter cp in this.Mark.Source)
           
{
                XmlNode xdetail = xd.CreateElement("detail");
               
XmlAttribute xaid = xd.CreateAttribute("id");
               
xaid.Value = cp.Editor.Editor.ID;
                XmlAttribute
xavalue = xd.CreateAttribute("value");
                xavalue.Value =
cp.Value;


                xdetail.Attributes.Append(xaid);
               
xdetail.Attributes.Append(xavalue);


                xrecord.AppendChild(xdetail);


            }

 

i can't read any item from the source at
all .

« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -5:00, Time now is 8:39pm