G
Guest 20221009
Guest
So I chose the Telerik grid over MVCContrib and I have had to add code for reordering rows on the fly.
I am doing this through a template column:
My stuff works fine, but fails when the grid goes into insert mode. I am unable to pass an id parameter since my Model for the new record is null.
I get "System.InvalidOperationException: Sequence contains no matching element"
I tried testing for a null model property and I can bring up the insert mode fine, but the actual insert fails.
please help
I am doing this through a template column:
columns.Template(c => @Html.ActionLink(c.CampaignFieldID == Model.FirstOrDefault().CampaignFieldID ? "Down" : "Up", "Order",
new
{
id = Model.Single(d => d.CampaignFieldID == c.CampaignFieldID).CampaignFieldID,
direction = Model.FirstOrDefault().CampaignFieldID.Equals(c.CampaignFieldID) ? "down" : "up"
})).Column.Title = "Order";
My stuff works fine, but fails when the grid goes into insert mode. I am unable to pass an id parameter since my Model for the new record is null.
I get "System.InvalidOperationException: Sequence contains no matching element"
I tried testing for a null model property and I can bring up the insert mode fine, but the actual insert fails.
please help