I have somewhat the same question as this: http://ko.infragistics.com/community/forums/p/92586/457810.aspx#457810
but I only have 1 column and there is checkbox to select the row
like this:
this checkbox column is not a datafield, but is part of the grid. It seems that there was some confusion in the post mentioned about this.
What I want now is to programmatically set the checkbox.
I've tried using
$("#grid").igGridSelection("selectRow", index);
but this just selects the row, but does not check the checkbox.
does anybody have an idea on how to check the checkbox too?
Hello Sebastian,
By default using igGridSelection.selectRow API will check the Row Selectors checkbox. I'm not sure what's the issue in your case.
Can you send your grid configuration for me to investigate, please.
Best regards,Martin PavlovInfragistics, Inc.
@(Html.Infragistics().Grid(Model.Companies) .ID("companyGrid") .AutoGenerateColumns(false) .Width("100%") .PrimaryKey("Id") .Height("25%") .Features(f => { f.Selection().Mode(SelectionMode.Row).MultipleSelection(true); f.Filtering().Type(OpType.Local).Mode(FilterMode.Simple).CaseSensitive(false); f.Sorting().ColumnSettings(x => x.ColumnSetting().ColumnKey("Name").CurrentSortDirection("asc")); f.RowSelectors() .EnableCheckBoxes(true) .EnableRowNumbering(false) .AddClientEvent("checkBoxStateChanged", "gridCheckBoxChanged"); }) .Columns(c => { c.For(x => x.Id).Hidden(true); c.For(x => x.Name).HeaderText("Company").Width("100%"); }) .DataSource(Model.Companies) .DataBind() .Render())
I created a JavaScript sample based on your configuration, but still cannot reproduce the issue. Can you please check what is your Ignite UI version by executing the following code in the browser's JavaScript console:
$.ui.igGrid.version
Is it possible to check the checkbox using the mouse?Can you check whether there are some JavaScript errors in the console.
I'm also attaching my sample for your reference.
We got it working like that. But we have to do it on startup. so when the event rowsrendered is fired we select the needed rows. and this doesn't work.
$(document).delegate("#grid1", "iggridrowsrendered", function () { $('#grid1').igGridSelection('selectRow', 1); });
but when we set a timout of 1ms it works
$(document).delegate("#grid1", "iggridrowsrendered", function () { setTimeout(function () { $('#grid1').igGridSelection('selectRow', 1); }, 1); });
is there another event that triggers later than iggridrowsrendered? because it seems when iggridrowsrendered is trigger not all elements are present yet
The fix for development issue 216216 is available in the latest service release which can be downloaded from the My Keys and Downloads page.
thanks for the help.
The only event that triggers after igGrid.rowsRendered event is the igGrid.rendered, but this event fires only once when the grid is initially created. I logged an internal issue with Development ID 216216 to investigate whether we can make the API work in the rowsRendered event.
I also created a case on your behalf with number CAS-170937-G7V2W5, so that you can be notified when there is a resolution for the issue.
You can find your active cases under Account - Support Activity in our website. Select your ticket and go to Development Issues tab to view the status of related development issues.