Hello,
I downloaded the 13.1 Release and used the Version Utility to upgrade my project and made no other code changes.
I noticed 2 things after the upgrade to 13.1
1) By default when I load a grid I set the ActiveRow = Null as I don't want the first row to be highlighted. Now every grid in my application has the first row highlighted as if it is the Active Row. Here is a sample of the code I use.
this.ugGrid1BindingSource.DataSource = MyObject; this.ugGrid1.DataBind(); this.ugGrid1.ActiveRow = null;
2) I really like how the grids now support scrolling with the Pan Gesture. However I noticed on a Microsoft Surface tablet when I use the pen or my finger I am no longer able to simulate a mouse right click by either press and hold or when I press the button on the pen and tap the screen. Both of these actions used to simulate a mouse right click and would bring up a context menu on objects that had them. In the grid I am using a MouseDown event for the context menu. In MdiTabManager and Toolbars I am using the built in default functionality. I was looking at the documentation and it looks like I may need to capture the PressAndTapGesture and/or PressAndHoldGesture events? Please advise.
Thanks in advance.
Hello acozzi,
Thank you for contacting Infragistics.
For your first question, it would depend on when you're setting the ActiveRow to Null. If you set it in the Form.Load event handler, it won't work because the data has not been loaded into the grid at that point. I would suggest adding a Timer to the form and then setting the ActiveRow to null in the Timer.Tick event handler and then disabling the Timer.
For your second question I would recommend looking at the samples provided with NetAdvantage. If they were installed, you should see them in the Public Documents folder.
Thanks for the response.
I am setting ActiveRow = Null in methods that are called from Form.Load. This functionality worked fine in Infragistics 10.3 - 12.1. Only when I upgraded to Infragistics 13.1 has this functionality changed. What prompted the change? As parts of my application are now broken. Going thru my entire application and adding Timers doesn't sound like an elegant solution.
All of the Touch samples provided with NetAdvantage have to do with the TouchProvider. The only information I could find on the gesture events is in the link below. However there are no code samples.
http://ko.infragistics.com/help/topic/227A28B5-A878-42DB-BD8F-E8ADBC0ADC6C
Hm... after posting, I took out the DataBind call and it doesn't seem to make any difference.
I got it to work like this, though:
private void Form1_Load(object sender, EventArgs e) { var rnd = new Random(); for (int i = 0; i < 10; i++) { ultraDataSource1.Rows.Add(new object[] { rnd.Next(200).ToString() }); } ultraGrid1.DataBind(); //ultraGrid1.ActiveRow = null; this.BeginInvoke(new MethodInvoker(this.SetActiveRowToNull)); } private void SetActiveRowToNull() { ultraGrid1.Update(); ultraGrid1.ActiveRow = null; }
Hi Mike,
Thanks for the response. I have version 12.1.20121.1001 of the Infragistics 12.1 DLLs on my machine so the change in behavior happened sometime after this release.
Your sample code does work however is there a reason this functionality was changed? There is a large amount of code that will need to be changed to add BeginInvoke methods and I'm sure I'm not the only person this change in behavior effects. The main reason I set ActiveRow = null is because I don't want a row highlighted by default when the user first sees the grid. If the user clicks on a row then I do want it highlighted to show it is the ActiveRow. Any suggestions?
Hi acozzi,
I created CAS-114766-W9L3R5 to track this issue and I have submitted it to our engineers for them to research.
Thanks guys. Hopefully its a quick fix that can be put into a Service Release.
Hi,
I just wanted to let you know that we have looked unto this issue and it turns out that we cannot fix it. The current behavior is correct, even thought it's a breaking change.
This came about as the result of a bug fix. The original bug happened at design-time. Basically, when you set the grid's DataSource, the grid would perform a bunch of metrics calculations and as an incidental part of that process, the grid also ended up synching it's ActiveRow with the current position of the DotNet CurrencyManager. This was never intentional, and performing these metrics calculations at the time of binding, before the grid painted, cause the design-time experience to be unstable. Simply dirtying anything on the form would cause the grid's column widths to change slightly ever time. So the metrics calculations are now deferred until after the grid paints.
I know you said the BeginInvoke workaround was not ideal, so I have a couple of other suggestions.
1) Set SyncWithCurrencyManager to false. This is much simpler and easier than BeginInvoke and unless you are binding the grid and some other controls to the same data source and you need them to stay in synch, it won't make any difference in your app - in fact, it will be slightly more efficient.
2) Use the grid's Paint event:
bool flag = false; private void ultraGrid1_Paint(object sender, PaintEventArgs e) { if (false == this.flag) { this.flag = true; this.ultraGrid1.ActiveRow = null; } }
An initial test of setting SyncWithCurrencyManager to false is working. We are going to test additional grids in our application and will let you know if we find any issues. Thank you very much for helping us resolve this issue.