Hi,
I want to display text and value different in the grid cell.
If column data type is decimal or datetime then when server is returning with null then it should display null instead of empty, I have applied the solution to assign the null text in cell. But that property assign null whether it is empty string or null value from server.
Hi Mike,
Thanks for Reply
These columns are editable by user. I am not aware of how to use CreationFilter or DrawFilter.
If you can explain with a small example then it would be much help full for me.
If you just want to display some text for null values, then you can use the NullText property of the column.
If it's more complicated than that and you don't want to add extra columns, then you will need to use a DataFilter as I suggested.
If the cells are not editable, then you might also consider using a CreationFilter or DrawFilter. These would allow you to change the display without having to handle converting the display text back into the real value. But this won't work if the fields are editable by the user.
Hi Mike again thanks for reply,
Now I'll explain little bit more clearly. I am reading data from files, I am not sure how many columns are in file that I am deciding at run time.
I am using ultradatasource to load data on demand becuase I can have more than 1000000 rows in the grid. If I am going to add one extra column it will reduce my performace. By question is that when laoding the file following data present in the file.
Date(datetime) ID(string) ClosingBalance(decimal) MoveAve(decimal)
28/01/2001 IBM 40.500 42.360
29/01/2001 IBM null
31/01/2001 IBM 39.560 40.810
IBM null
null IBM null null
This kind of data may exists in the file. While reading the file I want to display exactly same behaviour because if I am going to assing nulltext="null" then it will dispaly null every where whether it is null or empty value.
Please take look on it carefully.
I will be very thankfull to you.
Well, I'm still not sure I understand exactly what you mean. But it sounds like there are certain values in the data that you want to display something other than the actual value to the user.
If that's the case, then the answer is yes, you can do that. There are 2 basic approaches you can take.
1) You can use a DataFilter. This allows you to trap the value of a cell as it is transitioned from the editor to the display and vice versa. Check out the Infragistics Knowledge Base for sample DataFilters.
2) The other option is slighlty less elegant, but more intuitive to implement. What you could do is hide the actual bound column in the grid and add an Unbound column. Then you could use the InitializeRow event to examine the value in the "real" cell and copy it to the unbound cell. You could translate the value to anything you want to display.
First of all thanks for reply.
My question is that, Whether can we apply different values to text property and value property of wingrid cell.
When ever we are running a query if null was entered in that row date then it should display null. That means no date was entered in this row.
If I m providing a criteria select data in particular that rang then if data does not exists in provided data range the it should display empty value instead of null.
I am reading data from file. File contains empty data and null value I want to display accordingly. Because if I am displaying data null in empty cell then customer will consider that now values was enter in this. While this empty values means no values is present in that range. For datatype datatime and decimal.
Further can we provide formatting like excel, Different formatting for different cell. Like for .rows[0].cell[0]= 5.25
.rows[1].cell[0]= null and .rows[1].cell[0]= is it possible to apply different data type to same column for different cell.
If you need code I can provide you.