Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
Remove default Active Row
posted

Hi,

I'm trying to load my grid and to remove the default selection and the default active row (row selector) on the first load.  Normally in a simple project, i just set my grid's ActiveRow to null and clear my Selected  rows by doing the following code

this.ultraGrid.ActiveRow = null;

this.ultraGrid.Selected.Rows.Clear();

 

As I said, in a normal simple project, this works fine.  Except i'm working on a little more complicated project, which for some reason this code doesn't work as intended.  Even if i set the ActiveRow to null, my dataTable's first record is always set as the ActiveRow.

 

What's even weirder, is that i can't seem to figure out where the code is being fired from.  From the call stack, it seems to be called by Infragistics internal code, looks like it's trying to  "Ensure" that an ActiveRow is assigned.  Is there another property somewhere that can change the behavior of the UltraGrid to not set the ActiveRow when initially loading the grid?  I'm posting my call stack to show you that after loading my grid, initialize the layout and set the ActiveRow to null, the "BeforeRowActivate" event fires on it's own.

 

>    VSEConnector.dll!VSEConnector.Framework.Search.AdvancedSearch.grdResults_BeforeRowActivate(object sender = {Infragistics.Win.UltraWinGrid.UltraGrid}, Infragistics.Win.UltraWinGrid.RowEventArgs e = {Infragistics.Win.UltraWinGrid.RowEventArgs}) Line 1833    C#
     Infragistics2.Win.UltraWinGrid.v5.3.dll!Infragistics.Win.UltraWinGrid.UltraGrid.OnBeforeRowActivate(Infragistics.Win.UltraWinGrid.RowEventArgs e = {Infragistics.Win.UltraWinGrid.RowEventArgs}) + 0x61 bytes   
     Infragistics2.Win.UltraWinGrid.v5.3.dll!Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(Infragistics.Win.UltraWinGrid.GridEventIds id = BeforeRowActivate, System.EventArgs e = {Infragistics.Win.UltraWinGrid.RowEventArgs}) + 0x501 bytes   
     Infragistics2.Win.UltraWinGrid.v5.3.dll!Infragistics.Win.UltraWinGrid.UltraGrid.OnActiveRowChange(Infragistics.Win.UltraWinGrid.UltraGridRow newActiveRow = {Infragistics.Win.UltraWinGrid.UltraGridRow}, bool scrollIntoView = false) + 0xed bytes   
     Infragistics2.Win.UltraWinGrid.v5.3.dll!Infragistics.Win.UltraWinGrid.UltraGridBase.SetActiveRow(Infragistics.Win.UltraWinGrid.UltraGridRow row = {Infragistics.Win.UltraWinGrid.UltraGridRow}, bool scrollIntoView = false) + 0x95 bytes   
     Infragistics2.Win.UltraWinGrid.v5.3.dll!Infragistics.Win.UltraWinGrid.UltraGrid.EnsureTempActiveRowAssigned() + 0x15d bytes   
     Infragistics2.Win.UltraWinGrid.v5.3.dll!Infragistics.Win.UltraWinGrid.UltraGridBase.PaintTimer_Tick(object source = {Interval = 1000}, System.EventArgs e = {System.EventArgs}) + 0x91 bytes   
     System.Windows.Forms.dll!System.Windows.Forms.Timer.OnTick(System.EventArgs e) + 0x17 bytes   
     System.Windows.Forms.dll!System.Windows.Forms.Timer.TimerNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes   
     System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 275, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes   
     [Native to Managed Transition]   
     [Managed to Native Transition]   
     System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) + 0x2ea bytes   
     System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x17d bytes   
     System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes   
     System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) + 0x2e bytes   
     Company.AppName.UI.AppEnvironment.exe!Company.AppName.UI.Program.Main(string[ args = {Dimensions:[0]}) Line 178 + 0xb bytes    C#
 

Any help would be appreciated,

Thanks