I am using asp.net MVC and IgGrid in my Web Application.
I have a screen, in which there are 2 dropdowns:
@Html.DropDownListFor(m => m.SelectedYear, Model.lstYear, "- Select Year -", htmlAttributes: new { @class = "form-control", @id = "cmbYear", @onChange = "doCascade(this, '" + Url.Action("GetType", "Project", new { area = "Main" }) + "', 'cmbType')" })@Html.DropDownListFor(m => m.SelectedType, Model.lstType, "- Select Type -", htmlAttributes: new { @class = "form-control", @id = "cmbType"})
and a Load button:Load
When I select the fields from dropdown list and click on Load button, to populate the data inside igGrid, While under loading process, the columns are cramped (this is for some seconds, until the loading process)
Please let me know how to resolve it. Attached is the snapshot of the issue-
Thanks in advance
Hi Pree,
Can you send me a running sample that demonstrates the issue?
Regards,
Tsanna
Hi Tsanna,Thank you for the reply. Please kindly review my posted question again, I had uploaded the image of the issue that i am facing. If possible please try to rectify the issue without sample code and let me know some way to resolve it.Thanks in advance.
Hello Pree,
I noticed that you have several features including ColumnFixing. However please note that currently ColumnFixing is not supported with Unbound columns. Did you try my previous suggestion to use column virtualization in case that you have a lot of columns?
Regards,Tsanna
Hi Tsanna,Thank you for the reply. I am new in infragistics igGrid so I am unable to add the code for column virtualization in my existing features file(that I has attached in above reply). I read post on the same and tried implementing the code in my existing features file but couldn't succeed. Could you please help me to implement the code for column virtualization in my existing attached code ?Waiting for the reply.Thanks in advance.
Hello Pree Khanna,
I am assisting with this issue since Tsanna is not available due to a holiday.
You can enable column virtualization by setting the GridModel's ColumnVirtualization property to true. You can also find additional information on using column virtualization in our documentation here.
If you need further assistance with this, please let me know and I will be glad to help.
Hi Michael,
Thank you for the reply.
There is a "GridModel" class in which below properties are pre-defined:
public bool? ColumnVirtualization { get; set; }public bool? Virtualization { get; set; }public VirtualizationMode? VirtualizationMode { get; set; }public string AvgColumnWidth { get; set; }public string AvgRowHeight { get; set; }//etcpublic bool? AutoGenerateColumns { get; set; }
In "UCHierarchicalGridUI.cs" class, I am trying to set the ColumnVirtualization as below:
private void SetGridModel(GridModel oGridModel, GridDO oGridDO){ oGridModel.AutoGenerateColumns = false;
oGridModel.ColumnVirtualization = true; //added}
Now, when I run the application, I get below error:
Multi-column headers feature is not supported with columnVirtualization
Please let me know what is wrong and how to resolve it.
NOTE: to know what are the features of igGrid I am using in my application, please refer to the attached igGrid Properties.txt file.
Multi-column headers and columnVirtualization cannot be used together on the same grid. You will need to disable one of these features. This limitation is listed in our documentation here.
If you have any further questions or concerns with this, please let me know.
When I set VirtualizationMode to Fixed, as below:
private void SetGridModel(GridModel oGridModel, GridDO oGridDO){ //GridMultiColumnHeaders oGMCH = new GridMultiColumnHeaders();
oGridModel.VirtualizationMode = Infragistics.Web.Mvc.VirtualizationMode.Fixed;oGridModel.ColumnVirtualization = true;oGridModel.AvgColumnWidth="500px";
//oGridModel.Features.Add(oGMCH);}
Then I get below error: The resizing feature does not work when either virtualization or column virtualization is enabled with virtualizationMode fixed. To prevent this exception please set virtualizationMode to 'continuous' or use only rowVirtualization.
Again, when I set VirtualizationMode to Continuous, as below:
oGridModel.VirtualizationMode = Infragistics.Web.Mvc.VirtualizationMode.Continuous;oGridModel.ColumnVirtualization = true;oGridModel.AvgColumnWidth="500px";
Then I get below error: columnVirtualization is applicable for fixed virtualization only.
Please tell how to achieve my requirement. What is wrong in my code ?
NOTE: to know what are the features of igGrid I am using in my application, please refer to the attached .txt file in my above replies.
Thanks in advance.
Hi Pree Khanna,
Looking back on the thread history, I do not see any details about if you have widths set on your columns. Since the issue is that the columns are initially cramped while loading, you could try ensuring that the columns have a width defined. I see that you have the following code, but I do not know the resulting values.
Width = d.Attribute("Width") == null ? string.Empty : d.Attribute("Width").Value,
Please check for me if any values are being set for the column widths. If not, you could set a default width to have the columns render with that width.
As for the errors you are receiving, since the igGridResizing feature does not work with virtualizationMode fixed and columnVirtualization does not work with continuous virtualization, you have a couple options. You can remove igGridResizing or remove columnVirtualization to resolve these errors.
Looking forward to hearing from you.