Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Grid : 0width Columns showing/Column showing with equal width
posted

Grid columns are showing first time without specified width,

Below is the code illustrated this issue,

@(Html.Infragistics().Grid<GridVM>()
.ID("myGrid")
.Width("100%")
//.Height("600px")
.AutoGenerateColumns(false)
.Columns(column =>
{

column.For(x => x.Serial).Width("0%").DataType("string");
column.For(x => x.CName).Width("27%").DataType("string");
column.For(x => x.JTitle).Width("13%").DataType("string");
column.For(x => x.CmpName).Width("21%").DataType("string");
column.For(x => x.CEmailId).Width("17%").DataType("string");
column.For(x => x.CNumber).Width("12%").DataType("string");
column.For(x => x.CNumber).Width("12%").DataType("string");

column.For(x => x.CNumber).Width("0%").DataType("string");

})
.DataSourceUrl(Url.Action("GetPartialView", "Controller", new { Id = ViewData["Id"] }))
.DataBind()
.Render()
)

If i run above code then first time when this grid rendered on client browser it is showing all columns with equal width instead columns should have same width which i've been set in Width settings. And when DataSourceUrl get data then column width is correctly adjust.

Can you please give me sample code for its resolution?

Also, i'm not sure about this BUT if height specified then its width set at first time. You can figure out this happening as well.

Thanks,

Sanjay