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.
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?
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,
I ran your sample and I do see that the behavior here has changed. I could not reproduce the behavior you described with the latest service release of 12.1, but I do get it with 11.1, so it looks like this change occurred in a service release for 11.2 and up.
Anyway... the solution the problem seems very simple. Remove the call to DataBind. This method is essentially useless - setting the DataSource or DataMember on the control implicitly DataBind's it, so there is never any reason to call this method.
Thanks for the code sample.
I can see in your sample that ActiveRow has no affect. I added a DataBind to the grid right before setting ActiveRow = null
ultraGrid1.DataBind();
Using Infragistics 12.1 the Active Row is not highlighted. I then ran the version utility and upgraded a copy of your project to 13.1 and the ActiveRow is now highlighted.
I've attached an update to your project which includes the DataBind. Please advise.
Hello acozzi,
Thank you for your response. I've attached the sample project I created in order to test this issue. I created the project using NetAdvantage 2012 Volume 1. When I run the project, setting ActiveRow to null in the Form.Load event handler has no effect. If it happens that you're doing something different than I did in my sample, then please modify my sample so it does what your project does.