| | | Junior 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 |
| | | | Supreme 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
|
| |
|
|