Home      Members   Calendar   Who's On

Welcome Guest ( Login | Register )
      

Home » Skelta Workflow Net » Skelta Workflow Net » Application Development » how to bind data to gridview


how to bind data to gridviewExpand / Collapse
Author
Message
Posted Wednesday, September 23, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Monday, September 28, 2009
Posts: 5, Visits: 20
Hi,

  Can anyone tell me , how to bind the data to gridview.  

  pls let me knw what are the steps need to do to achieve this task..

  thanks in adavance..

 

harsha

Post #1578
Posted Thursday, September 24, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Thursday, January 12, 2012
Posts: 93, Visits: 121
Hi Harsha,

You can achieve the scenario (binding data to gridview) dyanciamly by writing the script on the required form control on 'OnDataChangedScript'.   Below is the sample code for your reference.  Same code snippet is available in the attached sample Skelta Form xml file as well.

For ex:  FormControl(Frequency for Budget) - OnDataChangedScript

maxCount = 0;
gridControl = Control.FindById(/*KPI Budget*/"_sys_ControlEnvironment_d213d35e8d554628ada86c0fb37bae62");
if(gridControl!=null)

  newRow=null;
 
  i=0;
  if(CurrentValue=='1')
  {
    foreach(months in ['January','February','March','April','May','June','July','August','September','October','November','December'])
    {
      i++;
      if( gridControl.Records.Count >= i )
      {
        newRow = gridControl.Records[i-1];
      }
      else
      {
        newRow=gridControl.AppendRow();
      }
      newRow.FindByName('Period').Value=months;
    }  
    maxCount = 12;
  }
  else
  {
    if(CurrentValue=='2')
    {
      i++;
      if( gridControl.Records.Count >= i )
      {
        newRow = gridControl.Records[i-1];
      }
      else
      {
        newRow=gridControl.AppendRow();
      }
      newRow.FindByName('Period').Value="Year";
      maxCount = 1;
          }
    else
    {
      if(CurrentValue=='3')
      {
        foreach(months in ['Q1','Q2','Q3','Q4'])
        {
          i++;
          if( gridControl.Records.Count >= i )
          {
            newRow = gridControl.Records[i-1];
          }
          else
          {
            newRow=gridControl.AppendRow();
          }
          newRow.FindByName('Period').Value=months;
        }  
        maxCount = 4;
      }
      else
      {
        if(CurrentValue=='4')
        {
          foreach(months in ['H1','H2'])
          {
            i++;
            if( gridControl.Records.Count >= i )
            {
              newRow = gridControl.Records[i-1];
            }
            else
            {
              newRow=gridControl.AppendRow();
            }
            newRow.FindByName('Period').Value=months;
          }  
        }

        maxCount = 2;
      }
    }
  }
}
//Remove records from the Grid which are already existing
while(gridControl.Records.Count > maxCount )
  gridControl.DeleteAt(gridControl.Records.Count-1);

Thanks, Sri

  Post Attachments 
sp1repo_KPI_1.xml.txt (183 views, 8.54 KB)

Post #1581
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
-
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.

All times are GMT -5:00, Time now is 4:23am

 
Execution: 0.156.15 queries.Compression Enabled.

Copyright © 2002 - 2009 Skelta Software. All rights reserved. Tel: 1 (678) 306 4110 | Email:sales@skelta.com
Skelta - A BPM Workflow Software Company