Hello everybody!
I am developping a web application.
I am using an igGrid where I can add, modify or delete a row. When editing a row, a dialog is open and I can put some information.
Therefore, I have an address book and then, when I pick up an address (an object with a visible label and an hidden ID), I add a new row that has only the text of the address (didn't save its identifiant)...What I would do is adding an object in a row..(getting both its ID and its label).
Here a part of the code:
@{
ViewBag.Source = AddressBook.Get();
}
@(Html.Infragistics().Grid<A_Form_Model>()
.ID("grid1" .PrimaryKey("IdLineA").RestSettings(rest =>
rest.RestSetting() .Create(c => c.RestVerbSetting().Url("/api/linea").Batch(true)) .Update(u => u.RestVerbSetting().Url("/api/linea"))
.Remove(r => r.RestVerbSetting().Url("/api/linea"))
)
.Columns(column =>
{
column.For(x => x.IdLineA).Hidden(true);
column.For(x => x.IdAddress).Hidden(true);
column.For(x => x.Address).Width("80px");
column.For(x => x.description).Width("80px");
})
.Features(features =>
{ features.Updating().EditMode(GridEditMode.RowEditTemplate).RowEditDialogContainment("window") .EnableAddRow(true)
.ColumnSettings(settings =>
settings.ColumnSetting().ColumnKey("Address").EditorType(ColumnEditorType.Combo)
.ComboEditorOptions(options =>
options.DataSource(ViewBag.Source).ValueKey("IdAddress").TextKey("AddressText");
});
.DataSourceUrl("/api/linea")
.LocalSchemaTransform(true)
.DataBind()
.Render()
Hope being clear!
Flo
Thank you for replying back.
I am glad that you have been able to resolve your issue!
Thank you for your response.
I had posted the question a long time ago.
I found the solution in the link : http://ko.infragistics.com/community/forums/t/73218.aspx
It's about Text/Key and it works very well.
F2O
Hello Aubry,
Thank you posting in our forum!
One possible workaround to get the desired behavior is hiding the ID column by setting its width to 1 px instead of setting its “Hidden” property to true. By using this approach the ID field would be visible in the row edit pop-up while it will not be displayed in the grid.
Hope this solution fits your requirements. If you have any questions, concerns or comments don’t hesitate to update the thread.