Hi,
I have a usecase where in I have a table which has time column as one of the column. We will add rows to the UltraGrid based on time which means we should have rows in ascending of Time.
Requirements are as follows:
1. When I send start and endtimes then that grid scroll bar adjust to show these values(first row should be the start time or first row after start time).
2. Currently I have two different types of rows where I rendered them with two different colors. If I change color, how do I update this color on the row[s] without clearing the table and reload again.Please note that I am setting the fore color for a row in IntitializeRow method. It seems like it is not correct for updating the color in IntializeRow since IntializeRow will be called when a row is getting added to the table.This is different with the updating of a row color which is already present in the table.
Can anyone help me on this.
Thanks in advance,
Sanjeev.
Hi Mike,
I set the initial color for rows in a table in InitializeRowEvent itself. However I want to change this color even though none of the value in the row changed. It seems like it is not possible through InitializeRow method, since none of the value changed. Is it possible to do change this color of the row in this particular case.
Thanks,
Hi Sanjeev,
There's no built-in search functionality in the grid. You could filter the rows or you could loop through the rows and examine the cell values to find the one you want.
Regarding chancing the colors on a row, the InitializeRow event is the best place to do this. I don't understand what you are asking beyond that. InitializeRow fires any time any value in a row changes, so it's ideal for changing the colors on a row or cell based on the value(s) of that row or cell.
Thanks Mike,
That sounds like answered my first question. However i have few doubts here, how do we compare a particalur values with a column in all rows. This is because I want to find out the first row based on the given start time.(A row that has time column equal to given this value or the first row whose time column values is after the given time). Hence I can place this row at the top.
Second question is about, how do we change the fore colors of rows with out clearing the rows in grid and reinitializing them again.
sanjeev_reddy24 said:1. When I send start and endtimes then that grid scroll bar adjust to show these values(first row should be the start time or first row after start time).
It sounds like you want to scroll a particular row to the top of the grid. To do that, you would set grid.ActiveRowScrollRegion.FirstRow to the row you want at the top.
1. Not sure I understood this but if you are asking how to programmatically sort the column, you add an entry to the band's SortedColumns collection for that column's key.
2. Again not sure I understood but if you are asking how to differentiate between a row being initialized for the first time and subsequent times, the event arguments for the InitializeRow event expose a boolean 'ReInitialize' property which tells you whether the row has already been initialized before.