Mar 06, 2010, 1:24 AM
The bug with the propertygrid
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());</p>
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();</p>
tr.name = cp.Name;
tr.id = nf.ID;</p>
Coolite.Ext.Web.ToolTip tp = new ToolTip();</p>
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;
}</p>
case "morethanequel":
{
if (total >=
float.Parse(ds.Tables[0].Rows[i]["???"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;</p>
}
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;
}</p>
case "notequel":
{
if (total != float.Parse(ds.Tables[0].Rows[i]["???"].ToString()))
{
tp.Icon = Icon.Accept;
}
break;
}</p>
default: tp.Icon = Icon.Error; break;
</p>
}
li.Add(tr);
nf.ToolTips.Add(tp);
cp.Editor.Clear();
cp.Editor.Add(nf);
Mark.Source.Add(cp);
</p>
</p>
</p>
</p>
}</p>
Mark.SetSource(Mark.Source);</p>
}
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;</p>
xdetail.Attributes.Append(xaid);
xdetail.Attributes.Append(xavalue);</p>
xrecord.AppendChild(xdetail);</p>
}
i can't read any item from the source atall .</p>