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.
Unfortunately, activation email could not send to your email. Please try again.

Formula & Comments Storing in GBDG

Thread ID:

Created:

Updated:

Platform:

Replies:

12759 Apr 12,2004 02:18 AM Apr 13,2004 03:13 AM Windows Forms 3
loading
Tags: GridControl
Satish
Asked On April 12, 2004 02:18 AM

Hi there, I would like to store the Formula & Comments in GBDG for each cell into the Database. I want these formula''s and comments needs to be retrieved from the database based user requests. How can you implement this please! I would appricate, if you could send me the sample code to store the formula and comments for each cell in the grid into database. Thanks Satish

Administrator [Syncfusion]
Replied On April 12, 2004 04:08 AM

The GridDataBoundGrid only stores the CellValue (or equivalently CellText) on a cell by cell basis as this is all that the DataSource provides. It does not, by default, store things like BackColor or FormulaTags or Tags or any of the other GridStyleInfo properties. If you want to use such properties on a cell by cell basis, then you have to maintain them yourself in some data store like an arraylist or hashtable or ???. You would then handle the Model.QueryCellInfo event to set your saved properties into e.Style based on the e.RowIndex and e.COlIndex passed in. Here is a forum link that discusses using formula cell in a GridDataBoundGrid. It has a sample attached. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=2956 Here is a link to a KB article that discusses excel comments in a GridDataBoundGrid. It has a sample. http://www.syncfusion.com/Support/article.aspx?id=10369

Satish
Replied On April 12, 2004 09:59 PM

Hi, I read the below statement which mentioned in the http://www.syncfusion.com/Support/article.aspx?id=10439 URL. -------------------------------------- The reason is that in a GridDataBoundGrid, there is nothing stored in the grid on a cell by cell basis. The only cell specific information that is available is the value (which comes from the datasource and is not stored in the grid). So, if you want to use formulas in a GridDataBoundGrid, then you must provide the formula and also provide the FormulaTag, both on a cell basis. Attached is a sample (VB.NET and C#) that uses the Model.QueryCellInfo event handler to provide the formula (generated in the handler dynamically), and to provide the FormulaTag (saved in an arraylist). It also handles the Model.SaveCellInfo event to make sure the FormulaTag information is updated properly. ------------------- My Question is I dont know in the beginning what formula i will be using. So it diffcult for me to add the formula to the formula tag before adding the record. ------------- I have created table called ''ORDER_PROCESSING'' which has got about 5 fields in table. ex. 1. ORDER_NO 2. ORDER_DATE 3. RATE 4. FORMULA This table is bind with the Databoundgrid. Now user wants to create a new record by pressing ''Add'' button row will be created and made ''RATE'' Field as Formula Cell type. User enters ex. ''=COS(10)'' in the rate field, i should get the value 0.985 in the Rate field and ''=COS(10)'' formula should be updated into ''Formula'' Field in the table. Like this user can enter many records with different formulas. Please let me know if you have sample formula database application Thanks Satish >The GridDataBoundGrid only stores the CellValue (or equivalently CellText) on a cell by cell basis as this is all that the DataSource provides. It does not, by default, store things like BackColor or FormulaTags or Tags or any of the other GridStyleInfo properties. If you want to use such properties on a cell by cell basis, then you have to maintain them yourself in some data store like an arraylist or hashtable or ???. You would then handle the Model.QueryCellInfo event to set your saved properties into e.Style based on the e.RowIndex and e.COlIndex passed in. > >Here is a forum link that discusses using formula cell in a GridDataBoundGrid. It has a sample attached. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=2956 > >Here is a link to a KB article that discusses excel comments in a GridDataBoundGrid. It has a sample. http://www.syncfusion.com/Support/article.aspx?id=10369

Administrator [Syncfusion]
Replied On April 13, 2004 03:13 AM

You do not have to add the FormulaTag until you know what you want to add. In your case, you would add it in your Add Button handler. Are Rate and Formula loaded from, and saved to, your DataBase? If so, you could try setting the GridBoundColumn.StyleInfo.CellType for Rate column to be "FormulaCell". If they are not columns in your DataBase, then are they to be considered unbound columns that will not be persisted anywhere? Another option you could use is to use Expression columns directly in your DataTable. This way, the DataTable will handle the calculations, and the grid will just display the columns like they were just any other column. Anyway, here is a sample doing what you described, adding a new row when you click a button. forum12973_2054.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;