UniGrid Selection and Sorting Issues

Delford Chaffin asked on May 13, 2015 23:52

I can put together a simple UniGrid like this ...

<cms:unigrid id="gridProducts" runat="server" ObjectType="cms.user">
    <GridOptions ShowSelection="true" ShowSortDirection="true" />
    <GridColumns>
        <ug:Column Caption="UserID" Source="UserID" />
    </GridColumns>
</cms:unigrid>

... and when I make a selection (e.g. the first three items) and then sort the grid, the first three items are still selected even though those are now no longer the three I chose before sorting. In other words, the display order changes, but the checked boxes do not move appropriately with their related items.

What am I doing wrong or is this a bug?

Thanks Kentico v7.0.102

Recent Answers


Roman Koníček answered on May 15, 2015 10:00

Hello Delford,

Indeed, you hit a bug. You will have to upgrade to version 8.2 to fix the issue. I am sorry for inconvenience.

Best regards, Roman Konicek

0 votesVote for this answer Mark as a Correct answer

Delford Chaffin answered on May 15, 2015 15:36

So, this won't be fixed in v7 at all? Moving this site to 8.2 is not a realistic option at the moment.

0 votesVote for this answer Mark as a Correct answer

Delford Chaffin answered on May 19, 2015 16:48

So, just to put this out there with the community ...

To begin, there are bugs that are a nuisance and then there are bugs that make something unusable. This, in my opinion, is the latter type. I can't have the select column there and have it completely break after sorting.

So, I sent a message back to Kentico stating that the suggestion to upgrade from v7.0.102 to v8.2 was not an acceptable answer and asked if they could at least point me in the direction to fix the code myself and got back the following:

Thank you for your message.
I am sorry to hear that upgrade is not an option for you. We was not aware of this circumstance. Anyway, fixing bugs only for the latest stable release is our official bug-fixing policy. Please refer to http://www.kentico.com/Support/Support-files/Product-Support-Lifecycle, section "Bug Fixing Policy."

This is not about support of older versions. We still support Kentico 6, 7 and 8.x. However, support does not automatically mean bug fixing policy. It means technical support with queries or issues besides unexpected issues - bugs. They are decided to be fixing only for the latest version.

Luckily, if you have full source code, you can try to fix it yourself. The following change should help:

In file:

~/UIControls/Controls/UniGrid/GridViewTemplate.cs

private void BindCheckData(object sender, EventArgs e)

Replace old code:
if (UniGridControl.SelectedItems != null)
{
 checkBox.Checked = UniGridControl.SelectedItems.Contains(argument);
}

By new code:
checkBox.Page.PreRenderComplete += ((senderObj, eventArgs) => { if (uniGrid.SelectedItems != null) { checkBox.Checked = uniGrid.SelectedItems.Contains(argument, StringComparer.InvariantCultureIgnoreCase); } });

To start with, does Kentico really not understand that upgrading a large site to the next major version is a significant investment in time and resources? When there are custom web parts and modules written for a project, all those things have to be tested and prepared for a new version.

Second, I do have access to the source and can paste in these new lines, but when I try to build the source code I downloaded, I get 286 errors in VS2012. Can anyone point me in the proper direction to be able to edit this code?

Finally, this bug fix is apparently already known and affects 3 lines of code. Why will Kentico not just put that in a Hotfix?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 19, 2015 22:50

Hello Delford,

Thank you for sharing this. We do understand that it may be complicated to upgrade a large site and it is time and resources consuming. We are trying to make the upgrades easier - that's why there were so many changes in Kentico 8. so we understand that this upgrade can be really complicated. However, keeping old architecture and maintaining a code that is years old would hold us behind from delivering new features and keeping up with current standards.

We also offer the Upgrade audit service that will review your project so you can foresee any possible issues during the upgrade - so you can upgrade smoothly.

My colleague on support made the extra effort to find what needs to be changed for you since you have the access to the source code. If you could share what errors you are getting we will be happy to help! The password should be available in the text file. Another issue that happens pretty often is like the one described here.

Best regards,
Juraj Ondrus
Customer care manager

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.