Balsamiq Community Discussion

Data grid column width not working

Sometimes when I’m creating a data grid and add column widths and alignments they don’t “take”. The weird part is, if I create a new data grid and slowly add the content from the data grid that’s not working the column widths and alignments will work.

Here is the markup for a data grid where the columns widths are having no effect

Line #, Date, Auth. Code, Customer, ShipTo, Part, Quantity, Price, Fee, Warehouse, City, Prov., Country, Driver, Unit,
5,2021-12-01,2223334445,077550,121,823498,93L,$1.13,0,PBR01,London,ON,CA,Bob,555
{50C,87C,104C,100C,50C,75C,75R,50R,20R,100C,75C,40C,40C,40C,40C,5}

Now here is a grid with the exact same column widths and it is working

5,2021-12-01,2223334445,NOT FOUND,823498,93L,$1.13,0,FNB01,Paris,ON,CA,Dave,666,
{50C,87C,104C,100C,50C,75C,75R,50R,20R,100C,75C,40C,40C,40C,40C,5}

I doing the trick of creating multiple data grids and sticking them together to look like one data grid so column width is important. I pasted the column widths from one grid to another so I doubt it’s syntax. It’s not a huge deal but sucks that I have to create a new grid every time this happens.

Hi there @dandoucette and welcome to the forums!

Let’s focus on that first data set you pasted - the one where the column widths are having no effect.

Can you send us a screenshot of your Data Grid control containing that data and I’ll roll up my sleeves and dig into this.

Would you also mind confirming that you are using Balsamiq Wireframes for Desktop and you have the latest version (4.4.1) installed? Thank you.

Hello Alasdair,

I do have version 4.4.1

image001.png

I’m unable to send you a screenshot of the grid though because I had to create another and transfer the contents over in order to get the columns working. The fix I currently employ is to drag a new data grid to my wireframe, I then paste in only the header row followed by the column widths, this normally works and I can paste in the rest of the data. If I paste in all the contents I get the same issue, it’s a weird one but something that happens often. I should be able to recreate it if you give me some time.

I know I have the column syntax correct because it works fine in another grid. Another thing, sometimes the column width syntax shows up as another row in the grid, first column is {100, next is 50C, etc…

I’ll forward you a working copy as soon as I can, unfortunately I have a very busy day today and may not get to it until next week.

Regards,

image002.jpg

image003.jpg

image004.jpg

Thanks @dandoucette ,

Whatever timeline works for you works for us.

If I paste your first data set into a Data Grid control here is what I see:

It looks ‘right’ to me but I don’t know what you are seeing.

I did notice that your column width data has widths for 16 columns. Your first data set has 16 elements (but the last, right-most is blank). Your second data set has only 15 elements. I wonder if the mismatch is a factor.

We’ve seen this occasionally and it’s usually down to a missing or extra comment, or special character, tripping up the parsing.

It may be easier for us to take a look at your actual project file if that’s possible? We can pick this up if you drop an email to support@balsamiq.com and attach the file.

I should add that we know the Data Grid control needs some attention - it’s a control for which we have received soem great feedback and feature requests - and we have plans to address that in the not too distant future.

Get back to us when you’re good and ready and we’ll continue to work through this.