Calculated Fields and DataGrid Control

Results 1 to 2 of 2

Thread: Calculated Fields and DataGrid Control

  1. #1
    Join Date
    Dec 1969

    Default Calculated Fields and DataGrid Control

    Can a datagrid consist of a number of columns for which output into the table cells depends upon the calculation from a number of other fields in the table? That is, can I show the result of a calculation depending upon the result of a comparison between two date fields in the dataset? <BR><BR>That is, if the date is within certain parameters, show the calculation. If it is not within that date period, then do not show the calculation.<BR><BR>Any assistance would be appreciated as I cannot locate any of the information in the technical specs.

  2. #2
    Join Date
    Dec 1969

    Default RE: Calculated Fields and DataGrid Control

    Some idea something like this<BR><BR><BR>&#060;asp:TextBox id="CALDATE1" text=&#039;&#060;%# SHOWDATECAL(Container.DataItem("FIRSTDTFIELD"),Con tainer.DataItem("SECONDDTFIELD")) %&#062;&#039;<BR> Width="45" Runat="Server"&#062;<BR>&#060;/asp:TextBox&#062;<BR><BR><BR>Function SHOWDATECAL(mvFIRST,mvSECOND)<BR>&#039;------------------------------------<BR>Dim mvDIFFDATE as integer<BR><BR>mvDIFFDATE = mvFIRST - mvSECOND &#039; check out syntax for date difference ?<BR><BR>If mvDIFFDATE &#062; 6 THen<BR> Return (mvDIFFDATE & " Days")<BR>Else<BR> Return "0 Days"<BR>End if

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts