Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

Help needed with methode

Hi,
In my methode CustomColumnDisplayText I tried to call
for the function checktype. The purpose of this function
is to check if a string contains a comma (,) or a (.) if so then
false otherwise true. But I don't know how to call for this
function in the customcolumndisplay-event. And the declaration
in the customcolumndisplay-event to devide and multilpy the
value isn't correct either.

 private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName == "Value")
            {
                if ((Properties.Settings.Default.IsMGDL == false) || (CheckType = true))
                {
                    e.DisplayText = (e.Value / 18).ToString();
                }
                else if ((Properties.Settings.Default.IsMGDL == true) || (CheckType = false))
                {
                    e.DisplayText = (e.Value * 18).ToString();
                }
            }

        }
        //*-------------------------------------------------------------*//
        static bool CheckType(string value)
        {
            return value.Contains(",") || value.Contains(".");
        }
        //*-------------------------------------------------------------*//

Open in new window

     

ERRORS:

1. Cannot assign to 'CheckType' because it is a 'method group'
2. Operator '/' cannot be applied to operands of type 'object' and 'int'      
3. Cannot assign to 'CheckType' because it is a 'method group'
4. Operator '*' cannot be applied to operands of type 'object' and 'int'      


Who can help me?

Peter
ASKER CERTIFIED SOLUTION
Avatar of lojk
lojk
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peter Kiers

ASKER

Super you have helped me alot.

Thanks.


500 p's comming your way...


Peter Kiers
You are welcome Peter.

Gotta love that stupid "Cannot assign to 'CheckType' because it is a 'method group'" error.

Why they can't just say 'you forgot the brackets, dummy' is beyond me ;-)

Have a good day.

Alan