I added a webdatagrid to a .NET 3.5 Web Application. Set the StyleSetName=RedPlanet, then added code in the codebehind page_load to create a datatable, add three columns and three rows. Then set datasource = datatable, and call Databind().
When I ran it the first time, I did not remember to put the scriptmanager on the screen. Got an error, then added the Infragistics WebScriptManager. The form shows an all white background and the data and column headers but absolutely no formating/styling. What am I doing wrong. This is as basic as it gets and it does not seem to be working out of the box.
This is with a downloaded version of 11v1.
This is the page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="TestIPS.WebForm1" %> <%@ Register Assembly="Infragistics35.Web.v11.1, Version=11.1.20111.1006, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI" TagPrefix="ig" %> <%@ Register Assembly="Infragistics35.Web.v11.1, Version=11.1.20111.1006, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <ig:WebScriptManager ID="WebScriptManager1" runat="server"> </ig:WebScriptManager> <div> <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" StyleSetName="RedPlanet"> </ig:WebDataGrid> </div> </form> </body> </html>
This is the code behind:
Public Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim table As DataTable = New DataTable() Dim col As DataColumn = New DataColumn("Col1", GetType(Integer)) table.Columns.Add(col) col = New DataColumn("Col2", GetType(String)) table.Columns.Add(col) col = New DataColumn("Col3", GetType(String)) table.Columns.Add(col) table.Rows.Add(1, "1", "Stuff") table.Rows.Add(2, "2", "More Stuff") table.Rows.Add(3, "3", "Even More Stuff") WebDataGrid1.DataSource = table WebDataGrid1.DataBind() End Sub End Class
Hi Michael,
Do you have the RedPlanet style set in the ig_res directory of the website? Whereever the styles are being loaded from, this folder needs to be there.
regards,David Young
Ok, I tried to "import" the Red Planet style and it says that it did, but placed it in my logged in users documents folder. Should it not be a folder within the project instead? How do I change the location of the style files?
On a side note, I noticed that the ig_res folder was in my c:users\myuser\documents folder instead of in the c:users\myuser\documents\visual studio 2010\projects\webapplication1\ folder. I wonder if there is an issue with infragistics handling spaces in the file path to place the style sets folder. My regular application that I first did this in has no spaces in the file path and it was in there, but not included in the application. Once I manually included it as part of the project (not sure why this would not be done by default anyway), it showed up as needed.
Thanks for your help!