I have tried to set numbers on row selector, i have tried to put by row numbers, it starts with number one , i have tried by row index and it also starts with number one. i want to be able to start with zero.
I want this beacuse in my grid i will be able to add "future" row that doesnt count as beging part of the others so thats why i need to enumerate it as number zero. but if i dont add that "future" row i want to the enumeration start at 1.
can you help me with some ideas?
Hi,
I'm not sure what you mean by "future row", but it sounds like maybe what you should do here is use the TemplateAddRow.
If you set AllowAddNew on the Override to TemplateOnTop (or TemplateOnTopWithTabRepeat), then this will give the user an add row where they can enter data above the first existing data row. The first row will still be row 1, and not row 0, because this is what Excel does, but the add row above it will have an asterisk in the RowSelector.
If that's no good, then the alternateive would be to change the numbers in the RowSelections using a CreationFilter to explicitly set the Text property of the TextUIElement inside the RowSelectorUIElement. This is a pretty easy CreationFilter to write, but if you have never used CreationFilters before, it could be a bit intimidating, so if you want to take that approach and you have trouble with it, let me know and I'm sure I can whip up some sample code.
In fact, there's already a CreationFilter on the forums that does almost what you want:
RowSelector numbering - Infragistics Community
The CreationFilter in this thread is assigning the value from a cell to the RowSelector. In your case, you would just use the Index property of the row minus 1.
Thanks mike, it solved my problem, the real deal with the future line.. wasnt how to add it, but how the row selector numbers should behave if there is one future line. its like a grid that has all your records untill today and you have the option to add a future line with a information that you will be doing in the future.. so that line shouldnt be count as the number one row but number zero, if that row doesnt exist in the grid so your first row should be number one. thanks for your answer it solved me the zero problem.
Now, i only have one question, i do i remove the triangle from the row selector and the pen when adding a new row. i dont want to have anything besides the numbers in the row selector.
If you want to hide all of the images in the RowSelectors, you can just do something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.RowSelectorAppearance.ImageAlpha = Alpha.Transparent; }
You could also modify the individual images using the RowSelectorImages property on the DisplayLayout. You can set each individual image to whatever you want. In this case, you would probably want to set each one to null.
Hi Mike, i'm using NetAdvantage for .net 2008 Vol 3.0 CLR 2.0 and doesnt have that property there, although i tried to use :
this
.grid.DisplayLayout.Bands[0].Override.RowSelectorAppearance.Image = null;
this.grid.DisplayLayout.Bands[0].Override.RowSelectorAppearance.ImageBackground = null;
but doesnt help because it shows the images anyway.
Thank for replying
Hi Mike, i solved the problem with the
this.grid.DisplayLayout.Bands[0].Override.RowSelectorAppearance.ImageAlpha = Alpha.Transparent;
Thank you.