Hello,
I'm starting with ASP.Net MVC and I was working with the article:
http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=igGrid.html
However I did not get a result out of this sample: my grid is not displayed:
my biggest problem is the datasourceurl: "BindGridFiltering" -> where is this action method;
i also tried datasource, but the grid was not displayed.
Perhaps you could send me an MVC sample for showing basis datasource for igGrid.
Thank you.
Model:
public class GridFilteringModel { public GridFilteringModel() { //The GridModel class holds all the properties for the MVC grid. GridFiltering = new Infragistics.Web.Mvc.GridModel(); }
public Infragistics.Web.Mvc.GridModel GridFiltering { get; set; } }
Controller:
<ActionName("Filtering")> Public Function GridFiltering() As ActionResult ' Zweck: GridFiltering Try DIm model As New GridFilteringModel() model.GridFiltering.DataSourceUrl = Url.Action("BindGridFiltering") model.GridFiltering.Height = "500px" model.GridFiltering.Columns.Add(new GridColumn("Autokennzeichen", "Autokennzeichen", "string", "300px")) model.GridFiltering.Columns.Add(new GridColumn("Bemerkung", "Bemerkung", "string", "205px")) Dim Filtering As new GridFiltering() model.GridFiltering.Features.Add(Filtering)
Return View(model)
Catch ex As Exception __Context.Prot.Err(ex) Throw ex End Try End Function
view:
@Html.Infragistics.Grid("grid1", Model.GridFiltering)
You need to add the DataSourceUrl in the controller.I have attached a sample that demonstrates this. I have used our CDN references due to size restriction on the attachment as shown in below link:
<http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=Deployment_Guide_Infragistics_Content_Delivery_Network(CDN).html>
The attached sample is created using razor syntax.
I hope this helps.
Thanks for this example which works.
However I use VB razor Syntax: vbhtml
And I would be very happy if you could transform these simplified code lines from cshtml to vbhtml:
I do not have success in doing this.
@(Html.Infragistics().Grid<Employee>()
.Columns(column =>
{
column.For(x => x.Id).HeaderText("Id");
column.For(x => x.Name).HeaderText("Name");
column.For(x => x.JobId).HeaderText("JobId");
})
.DataSourceUrl(Url.Action("GetEmployee"))
.DataBind()
.Render()
)
Then it will work, I think.
Thanks in advance.
I am just following up to see if you have any assistance with this matter.
As per my understanding the images are missing in you application. I would suggest you to use IE Developer toolbar or firebug to find out what styles are missing. Refer to the link below that will give you download and more details on debugging tool:
<http://www.microsoft.com/download/en/details.aspx?id=18359>
<http://getfirebug.com/>
Additional Note: The above links are neither created nor maintained by Infragistics.
But in my grid the filter line has no "icons" (e.g. the filter symbol and the "<",">","=" icons)
What is missing ? a refernce to a icon library ?
I did the css and javascript references as shown in the examples.
I am just following if you need any further assistance with this matter.
Thank you for the update. Here is the VB syntax for the View:
@(Html.Infragistics().Grid(Of Employee)().ID("EmpGrid").PrimaryKey("Id") _ .Columns(Function(column) column.[For](Function(x) x.Id).DataType("string").HeaderText("Id") column.[For](Function(x) x.Name).DataType("string").HeaderText("Name") column.[For](Function(x) x.JobId).DataType("string").HeaderText("JobId") End Function).DataSourceUrl(Url.Action("GetEmployee")) _ .Width("100%").Height("350px") _ .AutoGenerateColumns(False).ClientDataSourceType(ClientDataSourceType.JSON).DataBind().Render() ))