Hi,
When I'm in a grid and change value of cell, in the RowSelector at the left of the grid, a small pencil image is displayed.
It is possible to never show this image? I can call the method UpdateData of the grid to hide it but it is possible to never show it?
Thank you.
You can hide the RowSelectors entirely by using the RowSelectors property on the override.
So something like:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override; ov.RowSelectors = DefaultableBoolean.False; }
If you want to keep the RowSelectors, then you will need to change the images. Do you want to remove all RowSelector images or just the pencil?
Whatever you want to do, you can do it using the RowSelectorImages property on the DisplayLayout.
So, for example, this will get rid of the pencil image on an inactive row:
layout.RowSelectorImages.DataChangedImage = null;
If you want to remove the pencil on the active row, you could do this:
layout.RowSelectorImages.ActiveAndDataChangedImage = null;
But that will also remove the little active row triangle.
Thank you Mike, this is exactly what I want to know... change the image to null.
I written this code:
System.Drawing.Image image = base.DisplayLayout.RowSelectorImages.ActiveRowImage;
base.DisplayLayout.RowSelectorImages.DataChangedImage = image;
base.DisplayLayout.RowSelectorImages.AddNewRowImage = image;
base.DisplayLayout.RowSelectorImages.ActiveAndDataChangedImage = image;
base.DisplayLayout.RowSelectorImages.ActiveAndAddNewRowImage = image;
But the problem now is that the little triangle is red when the row is modified. Immediately after changing of row, the triangle on the active line is back to black like the normal behavior.
Do you know why the triangle is red in the case below?
Hello,
This post helped me to resolve my issue to Hide Row Selector.
Following is my Code to Hide Row Selector
Dim cUltraGrid As UltraGrid = DirectCast(Me.ulGanttView.GetType().GetField("grid", Reflection.BindingFlags.CreateInstance Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).GetValue(Me.ulGanttView), UltraGrid)
If Not (cUltraGrid Is Nothing) Then
cUltraGrid.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False
End If
Thanks To all for help.
Thanks
Eemran
Hi Mike,
Thank you. This is exactly what I've maid just before you sent the last reply. I've seen a method 'Save' in the property ActiveRowImage and just change the red color to black.
Problem solve! :)
What happens is that we take the default image and apply the forecolor to it so that it's always visible against the background color. So we use images that have a specific color which can be replaced. So I guess you really can't assign one image to another like you have here because our code doesn't do the color replacement when you assign an image, it only does this for our built-in images.
So I recommend that you save the image to a file and then you can edit it with any paint program so that it is the correct color and then re-apply it to the grid.