Katalogerna
PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET FAQ 11093


Calculated columns in a databound Grid Please note that this article refers to the GTP.NET
Jump to article- 2008-01-01 13:04:00 - Email plexityHide

Question

 

I am using the OnBeforeDSToCell event to format some data to be displayed in the grid.  But I want one of my columns to be calculated based on two other columns - how can I do this?

 

Answer

 

Since the columns are filled from 0 to n, you cannot read the x+1 column when handling OnBeforeDSToCell for column x.

But I suggest that you get your data from the datasource instead:

 

    void NodeDataConnect_OnBeforeDSToCell(NodeDataConnect aNodeDataConnect, CellAndDSArgs args)
    {
      if (args.Cell.Column.Index==theCellCalclulatedFromTwoOtherValues)
        args.Value=(args.CurrencyManagerListItem as DataRowView).Row["Col1"].ToString()+(args.CurrencyManagerListItem as DataRowView).Row["Col2"].ToString();
    }

 

Google
WWW plexityHide GTP.NET FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...