We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

REGD---Formula Cell

Hi Clay, I have few issues with the formula cell, 1.)5% 2.)(2+5)% This gives the result as Invalid Expression.Can you give us solution for this. Regards, Manohar B.

7 Replies

AD Administrator Syncfusion Team March 16, 2005 05:10 PM UTC

We currently support using % postfixed to constants as part of expressions. So, if you enter something like = 5% * A1 + A3 as a formula then this should work for you. But currently, we do not handle setting a value like 5% into some cell, say A2, and then using a formula like "= A2 * A1 + A3". We will add the works, but I do not know when it will be available). Now I am not sure what you mean as far as what you are trying to do. Both the lines you entered above did not have equal signs so I am not sure what you are trying to do. If you want to enter 5% in a cell, and then later reference that cell in a formula and have the value .05 used in the calculation, then that should work in the next release. But with an expression like (5 + 4)%, if you have that in one cell and are trying to reference it from another cell, then that will not be supported.


AD Administrator Syncfusion Team March 18, 2005 09:29 AM UTC

Hi Clay, 1.)=(5+4)% doesn''t work what I mean to say is that when % follows a ")" parenthesis that is follwoing a nested formula the expression is not evaluated and gives an error message "Invalid Expression". I have few more clarification regarding binding Arraylist to GridDataBoundGrid. 1.)If the ArrayList contains objects with Public Value Type Properties.Is there any way I could show blank cell in case my property contains default values like ZERO. 2.)Can I change column positions when GridDataBoundGrid is binded with ArrayList.


AD Administrator Syncfusion Team March 18, 2005 09:50 AM UTC

1) If you handle grid.Model.QueryCellInfo, you can try setting e.Style.Text = "" for any cell you want. This should blank it out (if "" is a valid value for that particular CellValueType. If it is not a valid value, then you may need to set e.Style.CellValue = null or maybe DNull.Value). 2) The grid will raised grid.Model.ColsMoved events when your user drags a column to a new position. At that point, you would have to rearrange things in your arraylist to reflect the column moves, or you would have to maintain a mapping array that maps the new index to the old index. To do this, you start with an array whose values are 1,2,3,4... Then when the columns are moved, you swap the members of this array in the same manner. Then when you go to index some column in the grid using an integer, you do not index it directly with the integer. Instead you index this mapping array with th einteger to get the old column index, and use this old column index to index the column in the grid.


AD Administrator Syncfusion Team March 18, 2005 10:05 AM UTC

Hi Clay, While setting the column styles I would like to position the columns in the specified index. Is this possible. Regards, Manohar B.


AD Administrator Syncfusion Team March 18, 2005 11:05 AM UTC

To set a column style in a GridDataBoundGrid, you index either grid.GridBoundColumns or grid.Binder.InternalColumns depending upon whether you have explicitly added gridBoundColumns to the grid.GridBoundColumns collection. Both of these collections can be indexed either by a zero based integer or by a column mappingname. If you want to initially set the order of columns in a GridDataBoundGrid, then you do need to explicitly add GridBoundColumns to the grid.GridBoundColumns collection. The order in which the columns are added control the order of the display in the grid. GridBoundColumn gbc = new GridBoundColumn(); gbc.MappingName = "SomeAColumnName"; //make column red gbc.StyleInfo.BackColor = Color.Red; this.grid.GridBoundColumns.Add(gbc); //... continue adding the other columns you want to see.


AD Administrator Syncfusion Team March 18, 2005 02:27 PM UTC

Hi Clay, Some how we were sucessfull in removing the default value in the cell but when put some text in the cell and delete it and move the focus to some other cell for some reason one error is comming "Cannot widen from Target Type to Primitive Type".What are the possible reasons for getting this error. Regards, Manohar B.


AD Administrator Syncfusion Team March 18, 2005 02:42 PM UTC

This is a Framework error message. Not really sure, but I think this error can happen when you try to do something like use a an Integer value where a Short or Byte is expected. If you can post a sample project showing the problem, maybe we can suggest a solution.

Loader.
Live Chat Icon For mobile
Up arrow icon