AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


Simple Grid Binding Example

       The following example is bind data into grid from client side program without using SQL result set.

Telerik Grid Biding

Bind value using Javascript/jQuery


var EmpCode = "";
var virtual_result = [];
var tableView = $find("<%=Student_details.ClientID %>").get_masterTableView();
for (i = 0; i < result.length; i++) {
 var obj = new Object();
 obj.EmpCode = "Reviewer" + (i+1);
 obj.Name = result[i].Name;
 virtual_result.push(obj);  
}        
tableView.set_dataSource(virtual_result);

tableView.set_virtualItemCount(result.length);
tableView.dataBind();

Example Program


<script type="text/javascript">
var EmpCode = "";
var virtual_result = [];
var tableView = $find("<%=Student_details.ClientID %>").get_masterTableView();
for (i = 0; i < 10; i++) {
 var obj = new Object();
 obj.SNO = i;
 obj.Name = "Name "+i;
 obj.RegNo = "Register Number "+(1000+i);
 virtual_result.push(obj);  
}        
tableView.set_dataSource(virtual_result);

tableView.set_virtualItemCount(virtual_result.length);
tableView.dataBind();
</script>

<div>
<telerik:RadGrid ID="Student_details"  runat="server">                                  
<MasterTableView EnableNoRecordsTemplate="true">
<NoRecordsTemplate>
<div>
There are no records to display
</div>
</NoRecordsTemplate>
 <Columns>
  <telerik:GridBoundColumn HeaderText="S.No" DataField="SNO">
  </telerik:GridBoundColumn>

  <telerik:GridBoundColumn HeaderText="Name List" DataField="Name">
  </telerik:GridBoundColumn>

  <telerik:GridBoundColumn HeaderText="Register Number" DataField="RegNo">
 </telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
 <ClientEvents OnCommand="fun_OnCommand" OnRowDataBound="fun_OnRowDataBound" />
</ClientSettings>
</telerik:RadGrid>
</div>

0 comments:

Post a Comment

Total Pageviews