I Work with HTLM.Infragistixs.grid ( but I Donot find the good forum ).
With Entities framework and MVC 3
How I Configure the rowselector and capture the line in my code ?
@( Html.Infragistics().Grid<MvcChantierCe40.Chantier>() .AutoGenerateColumns(false)
.Columns(column =>{
column.For(x => x.Ch_Code).DataType("int").HeaderText("Customer ID");
column.For(x => x.Ch_Nom).DataType("string").HeaderText("Company Name");
column.For(x => x.Ch_Desi).DataType("string").HeaderText("Contact Title");
column.For(x => x.Ch_Ref).DataType("string").HeaderText("Contact Name");
column.For(x => x.Ch_Ville).DataType("string").HeaderText("Country");
})
.Features(features =>{
features.Paging().PageSize(20).PrevPageLabelText("Previous").NextPageLabelText("NEXT");
features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings =>{settings.ColumnSetting().ColumnKey("Ch_Code").AllowSorting(true);
});
features.Selection().MouseDragSelect(true).MultipleSelection(true).Mode(SelectionMode.Row);
.DataSourceUrl(Url.Action("ListChantiers"))
.Width("100%")
.Height("350px")
.DataBind()
.Render()
)
Thank You CaisseOdev
Hello caiseodev,
Thank you for the update.
We are glad you are able to move forward with your application.
If you have any questions, please do not hesitate to contact us. We are here to assist you.
Ok for me that is good. I Understand how use the rowselector.
Thank you to all.
Caisseodev
If you have any questions, please do not hesitate to inform us as well.
Very good sample. I Think that is my issue.
Give me some days for testing and I will come to you
Thank you Caisseodev
Hello Caisseodev,
Please take a look at the Help API documentation regarding handling of events
http://help.infragistics.com/jQuery/2012.1/ui.iggridrowselectors#events
You can use the code snippet below :
<script type="text/javascript"> $(document).delegate("#grid2", "iggridrowselectorsrowselectorclicked", function (evt, ui) { // reference to the row the clicked row selector resides in var row = ui.row; var employeeID = $(row[0].cells[0]).text(); window.location.href = "@Url.Action("Index", "Home")" + "?employeeID=" + employeeID; }); </script> @(Html.Infragistics().Grid<igGridDataTable.Models.Employee>().ID("grid2").PrimaryKey("EmployeeID") .AutoGenerateColumns(true) .Features(features => { features.Paging().PageSize(20).Type(OpType.Local).PrevPageLabelText("Previous").NextPageLabelText("Next"); features.Sorting().Type(OpType.Local).Mode(SortingMode.Single); features.Resizing().AllowDoubleClickToResize(false).DeferredResizing(false); features.Selection().Mode(SelectionMode.Row).MultipleSelection(true); features.RowSelectors(); features.GroupBy().Type(OpType.Local); }) .DataSourceUrl(Url.Action("DataTableDS")) .DataBind() .Render())
$(document).delegate("#grid2", "iggridrowselectorsrowselectorclicked", function (evt, ui) {
// reference to the row the clicked row selector resides in
var row = ui.row;
var employeeID = $(row[0].cells[0]).text();
window.location.href = "@Url.Action("Index", "Home")" + "?employeeID=" + employeeID;
</script>
@(Html.Infragistics().Grid<igGridDataTable.Models.Employee>().ID("grid2").PrimaryKey("EmployeeID")
.AutoGenerateColumns(true)
.Features(features =>
{
features.Paging().PageSize(20).Type(OpType.Local).PrevPageLabelText("Previous").NextPageLabelText("Next");
features.Sorting().Type(OpType.Local).Mode(SortingMode.Single);
features.Resizing().AllowDoubleClickToResize(false).DeferredResizing(false);
features.Selection().Mode(SelectionMode.Row).MultipleSelection(true);
features.RowSelectors();
features.GroupBy().Type(OpType.Local);
.DataSourceUrl(Url.Action("DataTableDS"))
.Render())
Let us know if you still experience issues.