I created a new ASP.NET Web Forms app and placed an Infragistics web control onto the Site.Master page, but do not know how to use Infragistics CSS to style the control.
How do I use Infragistics css styles in a WebForms app? (Not MVC)
Stupid newbie questions:
1. Should I include an Infragistics css file from somewhere? Where is it located? What file name?
2. Should I copy an Infragistics folder structure to my app folders? Which Infragistics folders? Where are they located?
3. Do I need to specifically set CSS properties on Infragistics web controls, or will they "find" the css somewhere?
4. Is there a way to easily change the style of all Infragistics controls in my app with a few simple clicks?
Hello Ray,
I’m glad that you were able to resolve your issue.
Thank you for choosing Infragistics!
Regards, Ivan Kitanov
Your sample worked. Thank you!
I was forced to create a separate style sheet to override ig_webtab.css.
There must be some crazy caching because sometimes editing ig_webtab.css worked, but other times older css values remained in force. Only the private css file worked reliably.
I guess I have a solution for now, but remain mystified.
I have tried to reproduce this behavior, but on my side everything works as expected, once the ig_res folder has been included to the project, the changed CSS is applied correctly.
I am attaching a small sample that demonstrates what I have explained above. The sample consists of a WebDataGrid that has its igg_Header class changed, the changed property is the background-color. When running the sample, the column headers should have a purple background color.
Could you let me know if you are able to observe the change of the background color when running the sample?
If the CSS changes are applied in the sample and work correctly on your side, but not in your application, I recommend you copying the ig_res folder that the sample is using and replace the ig_res folder that you are currently using with it, to see if the CSS changes would be applied.
If the changes are still not getting applied, even if you have replaced the ig_res folder with the one from the sample, then what I can suggest you is creating your own css file and placing the CSS classes that you would like to override there. After that you can reference the file and the changes made there would be applied.
Looking forward to hearing from you.
I had performed those steps you outlined above many days ago. I guess they worked because my grid and tabs show up correctly. ig_res is included in my project, and opens in the Solution Explorer.
Now I see another perplexing issue I cannot explain. I opened ig_webtab.css from my private ig_res folder from the Solutions Explorer and edited it and saved it, but saw no effect on the tabs in my page after re-running the app.
I then used the "Inspect" menu in Google Chrome to inspect the css styles. Sure enough, the changes from my private ig_webtab.css were not used. Changing css in the Chrome inspector worked as expected.
I cannot explain where the css is coming from. The Inspector says the file comes from "">localhost:443999/.../ig_webtab.css". But it does not contain my edited values from my private ig_res folder, which is located in my project folder.
This also does not help:
<link rel="stylesheet" href="~/ig_res/Default/ig_webtab.css">
Where is IIS Express getting the css file?
What I mentioned above is correct for using VS2019, however I have tested this under VS2022 and the result is the same as yours the ig_res folder doesn’t get imported into the project. In order to fix this, all it needs to be done is copying the ig_res folder, then using the “Show All Files” option in the solution explorer and right clicking on the ig_res folder and selecting the “Include in Project” option. Thus, the folder would be included in the project and the styles would be applied.
I’ve tested this on a few projects with several different controls and couldn’t find any issue, I also tested the CSOM under VS2022 and the JavaScript related to our controls works as expected.
I’ve also contacted a colleague that is involved with the integration of our ASP WebForms controls with VS2022, it turned out that they are still polishing some things with the integration and the importing of the ig_res folder is one of them. We hope that the full integration would be finished soon. In the meantime the solution to this issue would be to add the folder manually and then using “Include in Project”.