Home > Net >  DevExpress tip: unable to type into "system. The drawing. The color of object cast to type"
DevExpress tip: unable to type into "system. The drawing. The color of object cast to type"

Time:11-13

I write in the database is the # C0FFFF string type, give devexpress after writing treelist binding source, in the event to join
 private void treeList1_CustomNodeCellEdit (object sender, GetCustomNodeCellEditEventArgs e) 
{
If (e.c. with our fabrication: olumn FieldName!="name")
{
The object obj=e.N ode. GetValue (0);
If (obj!=null)
{
The switch (e.N ode. GetValue (0). The ToString ())
{
Case "color" :
"E.R epositoryItem=colorEdit;
//"e.R epositoryItem=colorPick;
break;

Case "automatic size" :
"E.R epositoryItem=chkEdit;
break;
}
}
}
}

Color the following colorEdit is already defined

Results after the operation, change the color will be prompted to: can't type into "system. The drawing. The color of object cast to type" system. The string "
I do not know how to solve, where, under the great god, please help the younger brother,

CodePudding user response:

Try "e.R epositoryItem=" colorEdit ";

CodePudding user response:

ColorEdit is the control variable names, can't change,

CodePudding user response:

ColorEdit is control types, and cannot be direct assignment of

CodePudding user response:

Convert a string to use
ColorTranslator. ToHtml (... )
Back in
ColorTranslator. FromHtml (... )
  •  Tags:  
  • C#
  • Related