Dear Sir/Madam,
I have the exact problem exposed by moh86fci here: http://forums.infragistics.com/forums/p/41810/231834.aspx#231834 .In my case the user must have the possibility to select rows (using RowSelector) so I can not set grid.DisplayLayout.Override.RowSizing to None .
Workaround Mike proposed, that is to set RowLayoutStyle to ColumnLayout seems to solve, but introduced a new annoyance : moving the mouse over the grid, between rows the cursor change in a up-down arrow really bad to see and also cursor change not only when over the border but with a wide margin around the border, leaving clickable space on a cell (available to activate the cell) very small.Is there a way to limit row sizing only by RowSelector ?If not, is there a way to limit up-down cursor (and related sizing functionality) to trigger only on exact border with no margin?Is there a way to change up-down cursor to the one shown on RowSelector?At least is there a way to hide up-down cursor?
Thanks in advanceCiaoGianni
Hi Gianni,
GiannisKhan said:Is there a way to limit row sizing only by RowSelector ?
Yes.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridOverride ov = layout.Override; ov.RowSizingArea = RowSizingArea.RowSelectorsOnly; }
Hi Mike!I'm taking some tries... no luck.It seems RowSizingArea setting get ignored. Is it possible? Have you already use it successfully?It seems to me that the grid starts with a certain default, then you can not change this setting. In my case row still can be sized by rowselectors and rowborders both.In a little project I made to test this it seems default is by rowselectors only and if I change it putting rowbordersonly... NO EFFECT! I attached the test, please could you take a try? What's wrong? Look at Form1.cs code.Thank you very muchGianni
It's not working in your sample because your code in the InitializeLayout event is never getting called. You are hooking the event after you have already set the grid's DataSource, so your event handler never gets called. You have to hook the InitializeLayout event before you set the grid's DataSource.
Hi Mike,I'm sorry to proposed you a silly test. Uhfh!, you're right, setting dataSource after the event subscription it works.So I can't understand why is not working in my real app.I subscripted the event in the constructor before set any data. If I put a breakpoint on the line where I set the RowSizingArea I can see that it will be hit.Is there anything I can check, observe or be aware of?
This thing is driving me crazy.
Probably some setting could interferes with the area row, but I can not isolated it.
To be sure I also tried to put a timer (tick each second) that execute following code:
foreach (UltraGridBand band in this.ultraGridStructureView.DisplayLayout.Bands) band.Override.RowSizingArea = RowSizingArea.RowSelectorsOnly;
but no effect. Debugging I can see that band.Override.RowSizingArea is set to "RowSelectorsOnly" , exactly as I want, but on the UI is still possible to resize row by row-border with the arrow cursor that come up...A so little malfunction and so big frustration.
Please let me know any ideas you can have.
thank you one more timeGianni
There are two possibilities here.
1) Something else in your code is re-setting the RowSizingArea after you set it.
What I would do is just put a button on the form that displays the property setting and click that button at run-time to make sure RowSizingArea is still set to RowSelectorsOnly. If not, then you know something in your code is changing it.
Maybe you are already setting this property in your code somewhere else.
Or maybe you are loading a layout or a preset into the grid.
2) Some other property setting on your grid is overriding this setting. I don't think there is any such setting, but perhaps I am wrong or there is a setting I am not thinking of. The only thing I can think of that might cause the grid to ignore this property is if you are using RowLayouts. I would think the property would still work, but maybe I am wrong about that.
Hi Mike,I'm sorry to take so long to reply, but I been very busy.I tried to put a button then shows RowSizingArea property value at runtime and it says me "RowsSelectorsOnly".So reading the second part of your post, I remembered that I have set this:.....RowLayoutStyle = RowLayoutStyle.ColumnLayoutcommenting this line the sizing area setting seems to have finally effect.BUT, I can not leave that line commented out, as you can read in the first post of this thread, I set the RowLayoutStyle to "ColumnLayout", to resolve the problem exposed by moh86fci here: http://forums.infragistics.com/forums/p/41810/231834.aspx#231834 .So I am locked. Please could you investigate on this curious behavior and let me know any workaround or fixing I can adopt?Many thanksGianniP.S: I am using version 2011.1 SR 2009
It works like a charm!Thank you very much Mike.
Gianni
Hi,
Try this:
Okay, in ColumnLayout mode, you are not really resizing the row, you are resizing the cell (which, of course, affects the height of the row). So you just have to turn that off, too.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override; band.RowLayoutStyle = RowLayoutStyle.ColumnLayout; ov.RowSizingArea = RowSizingArea.RowSelectorsOnly; ov.AllowRowLayoutCellSizing = RowLayoutSizing.Horizontal; }
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override;
band.RowLayoutStyle = RowLayoutStyle.ColumnLayout; ov.RowSizingArea = RowSizingArea.RowSelectorsOnly; ov.AllowRowLayoutCellSizing = RowLayoutSizing.Horizontal; }