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)
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.
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.