# DynamicQuery Adapter - Grid Format

**URL:** <https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048>\
**Category:** Epicor ERP 10\
**Created:** [February 27, 2018, 8:52pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048 "2018-02-27T20:52:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![markdamen](https://www.epiusers.help/user_avatar/www.epiusers.help/markdamen/32/54917_2.png) [@markdamen](https://www.epiusers.help/u/markdamen)\
**Post date:** [February 27, 2018, 8:52pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/1 "2018-02-27T20:52:07Z")

</div>

Hi

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

![image](https://epiusers.help/uploads/default/original/2X/6/64fa954a4cf2592962c30b3c4ba821d8d5ac4f9a.png)

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:

 ![image](https://epiusers.help/uploads/default/original/2X/9/9f71d7bfe68494283553d6490c8c99e09d957785.png)

And finally, when you Analyse the BAQ it does honour the format correctly:  
 ![image](https://epiusers.help/uploads/default/original/2X/d/d010ce4ffe334212ac926b6ca37c202bb1892e53.png)

Many Thanks  
Mark

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [February 27, 2018, 8:58pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/2 "2018-02-27T20:58:13Z")

</div>

Images didn’t upload

---

<div class="post-metadata">

**Author:** ![markdamen](https://www.epiusers.help/user_avatar/www.epiusers.help/markdamen/32/54917_2.png) [@markdamen](https://www.epiusers.help/u/markdamen)\
**Post date:** [February 27, 2018, 10:38pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/3 "2018-02-27T22:38:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [February 27, 2018, 10:53pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/4 "2018-02-27T22:53:08Z")

</div>

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:

```cs
 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)

---

<div class="post-metadata">

**Author:** ![skearney](https://www.epiusers.help/user_avatar/www.epiusers.help/skearney/32/11498_2.png) [@skearney](https://www.epiusers.help/u/skearney)\
**Post date:** [February 11, 2019, 8:52pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/5 "2019-02-11T20:52:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [February 11, 2019, 8:59pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/6 "2019-02-11T20:59:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![skearney](https://www.epiusers.help/user_avatar/www.epiusers.help/skearney/32/11498_2.png) [@skearney](https://www.epiusers.help/u/skearney)\
**Post date:** [February 11, 2019, 9:07pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/7 "2019-02-11T21:07:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [February 11, 2019, 9:09pm UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/8 "2019-02-11T21:09:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![IsaiSelvan](https://www.epiusers.help/letter_avatar_proxy/v4/letter/i/e9a140/32.png) [@IsaiSelvan](https://www.epiusers.help/u/IsaiSelvan)\
**Post date:** [March 25, 2019, 10:31am UTC](https://www.epiusers.help/t/dynamicquery-adapter-grid-format/43048/9 "2019-03-25T10:31:23Z")

</div>

thank you. its working fie.
