DynamicQuery Adapter - Grid Format

Hi

So I got some great advice about using the DynamicQuery adapter - really does make returning data so much easier!

image

This is a simple grid that I’ve populated using BAQ. Question is how to control the decimal format - can’t specify it in the customisation because the grid is blank and has no columns at runtime. (the headers aren’t shown at least until it’s run).

This is the BAQ:

And finally, when you Analyse the BAQ it does honour the format correctly:
image

Many Thanks
Mark

Images didn’t upload

I’ve edited the post - can’t work out how to get it to display the images though, even though they are local to the forum site now that they are uploaded.

Sounds like the grid is taking over the formatting of that decimal value. You can force it by putting this in the grid InitializeLayout event:

 urgrid.DisplayLayout.Bands[0].Columns["UrColName"].Format = "###,##0.00";

Another option is to cast the BAQs result to a string, then you dont have to worry about it. If you ever need to edit this field then this is not a good option (if it ever was)

Anyone know how to format a grid column as right aligned?

https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/27348/change-the-alignment-of-the-text-in-the-columns

2 Likes

Perfect.
e.Layout.Bands[0].Columns[“Col 1”].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right;

1 Like

So if you add the word “infragistics” to about any formatting question you have, a solution usually shows up using google. It’s a pretty widespread control platform, and what Epicor is built on.

1 Like

thank you. its working fie.