Skip to content

Replies

0
Mike
Mike answered on Nov 25, 2008 8:11 AM

Hi,

I have implemented a drawfilter to draw a dotted line around the checkIndicatorUIElement. This works fine 😉 BUT since the Element is also drawn completely to the left ( x = 0 ) I want to move it a couple to pixels to the right. Somehow the location property is not the right way….

Maybe you could give me a hint what to do:

 

public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams)

{

if (drawParams.ControlElement.Control.Focused)

{

System.Drawing.Rectangle elementRect = drawParams.Element.Rect;

drawParams.Graphics.DrawRectangle(

new System.Drawing.Pen(System.Drawing.Color.Red), elementRect.X , elementRect.Y + 1, elementRect.Width, elementRect.Height);elementRect.Location = new System.Drawing.Point( elementRect.X + 1 , elementRect.Y);return false;

}

elsereturn false;

}

public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams)

{

if (drawParams.Element is Infragistics.Win.CheckIndicatorUIElement)

return Infragistics.Win.DrawPhase.BeforeDrawElement;

elsereturn Infragistics.Win.DrawPhase.None;

}

#endregion

}

0
Mike
Mike answered on Nov 18, 2008 4:03 PM

Yes there is a focus rectangle when it has focus, but only on the text not on the box itself. So if there is no text as in my case then one can not see that the checkbox has focus. Is it possile to set a drawfilter in this case?

0
Mike
Mike answered on Nov 18, 2008 3:13 PM

Hi Mike,

thanks, but the manual does not describe how to show the dotted line around the checkbox itself. It only shows how to remove the dotted line.

thanks

Stefan

0
Mike
Mike answered on Aug 14, 2008 2:48 PM

Thanx!!!! It really works!

 I am sorry I have to bug you again…

This does not work with a numeric editor.

                      oNum = NEW Infragistics.Win.UltraWinEditors.UltraNumericEditor();
                      oNum.Appearance.TextHAlign = Infragistics.Win.HAlign:Right ;
                     args.Row.Cells["ParameterValue"].EditorControl = oNum;
                     args.Row.Cells["ParameterValue"].Appearance.TextHAlignAsString = "Right";

If the cell is not selected and ative then it is aligned correct, but as soon as I click into the cell the alignment goes to the left again. What am I doing wrong?

Stefan 

 

0
Mike
Mike answered on Aug 13, 2008 3:56 PM

thanks for your quick reply.

Actually what I am doing is following. I have a Column of the type of String but in the database it is stored in different types:

The DB Table has  fields boolvalue as bool, intvalue as int, …. When filling the dataset I convert them to String so I can show it in the grid and I have a second field which holds the display type e.g. "BOOL". The boolvalue becomes "TRUE" or "FALSE". On the initializeRow Event I change the EditorControl of the Cell to CheckboxControl if the datatype field has the value of "BOOL" so it can show as a checkbox. The cool thing is I actually get a checkbox if the Value is the string "TRUE" or "FALSE". BUT the checkbox is not centered.

 This may seem strange but maybe you know a better way of having different fields of a dataset in the same column.

For your understanding :

DB Table Fields: ParaValueInt as int, ParaValueBool as BOOL, ParaValueString as VARCHAR, DataType AS VARCHAR…..

Dataset Fields: ParaValue AS String, Datatype AS String –> Depending on the value of DataType in the DB Table I fill the field ParaValue in the Dataset.

What I actually would need is the possibility to display different fields in one colomn, so this is my workaround,

regards

Stefan