WebGrid 7 - Need To Keep Column Size Static

17 replies. Last post: January 19, 2011 9:12 AM by A Yousif
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
A YousifMember

We use a custom check box in our grid in the first column using the ITemplate.  We need this column to be a static size of 30 pixels.  However, it never stays that way no matter what we do.  It usually changes when another column is manually resized or Best Fit is used.

I've recently rigged a custom row checker that's infused into the header and I'm able to reset the width on the header through javascript, e.g.,

oHeader.childNodes[0].childNodes[0].childNodes[0].style.width = "30px";

And this works.  However, when I try the same with each cell in each row, it has no impact whatsoever.  I get each row's cell and process it like this:

oCell.CellElement.width = "30px";
oCell.CellElement.style.width = "30px";
oCell.CellElement.style.border = "solid 1px #ff0000";

The width has no impact on the cell.  I did debug into it to verify that the CellElement is the TD tag and it is.

Note that the border was just put in for testing to verify that I was updating the correct element and it shows it correctly.

I will send a video later to show the issue in more detail.  In the meanwhile, any ideas?  We've tried every style setting we can think of on the server side and client side withour the results we need.

All times are GMT -5. The time now is 9:29 PM.
Previous Next