or
<th scope="col" class="rgHeader hasNestedTable" style="font-weight: bold; text-align: center;"> <table class="nestedHeaderTable" datatable="0" cellspacing="0"> <tbody><tr> <td colspan="4" align="center"><b># of Providers</b></td> </tr> <tr> <td align="center" width="25%"><b>Required</b></td>
<td align="center" width="25%"><b>Submitted</b></td> </tr> </tbody></table> </th>
//calling this function inside an event public void loadGrid() { //looping for creating 31 columns for (int I_ColumnCount = 1; I_ColumnCount <= 31; I_ColumnCount++) { GridTemplateColumn gridtemplatecolumn = new GridTemplateColumn(); gridtemplatecolumn.ItemTemplate = new MyTemplate(Convert.ToString(I_ColumnCount)); gridtemplatecolumn.HeaderText = Convert.ToString(I_ColumnCount); this.rg_Attendence.MasterTableView.Columns.Add(gridtemplatecolumn); ViewState["grid_DayCount"]=Convert.ToString(I_ColumnCount); } } public class MyTemplate : ITemplate { protected RadComboBox lblControl; public string colname; public MyTemplate(string cName) { colname = cName; } public void InstantiateIn(System.Web.UI.Control container) { lblControl = new RadComboBox(); lblControl.ID = colname; container.Controls.Add(lblControl); } } //this function contains data which is retrieved from database and need to bind to rad grid and comboboxes(which are created inside rad grid dynamically) protected void loadEmployees() { RadComboBox lblControl = new RadComboBox(); DataTable DT_Employee = new DataTable(); DT_Employee = BLL.get_Attendance(_obj_Smhr_Attendance); if (DT_Employee.Rows.Count == 0) { rg_Attendence.Visible = true; rg_Attendence.DataSource = DT_Employee; rg_Attendence.DataBind(); for (i = 0; i <= rg_Attendence.Items.Count - 1; i++) { //here i am trying to bind data to comboboxes which are created dynamically inside rad grid rcmbList = rg_Attendence.Items[i].FindControl("lblControl") as RadComboBox; if (Convert.ToString(Convert.ToString(DT_Employee.Rows[i][3])) == "0") rcmbList.SelectedIndex = rcmbList.FindItemIndexByValue(Convert.ToString("P")); else if (Convert.ToString(Convert.ToString(DT_Employee.Rows[i][3])) == "1") rcmbList.SelectedIndex = rcmbList.FindItemIndexByValue(Convert.ToString("L")); } } else { rg_Attendence.Visible = false; btn_Save.Visible = false; btn_Finalize.Visible = false; } } else { _obj_Smhr_Attendance.OPERATION = operation.Check; _obj_Smhr_Attendance.ATTENDANCE_MODE = true; DT_Employee = BLL.get_Attendance(_obj_Smhr_Attendance); rg_Attendence.Visible = true; rg_Attendence.DataSource = DT_Employee; rg_Attendence.DataBind(); for (i = 0; i <= rg_Attendence.Items.Count - 1; i++) { //here i am trying to bind data to comboboxes which are created dynamically inside rad grid lblControl = rg_Attendence.Items[i].FindControl("colname") as RadComboBox; if ((Convert.ToString(Convert.ToString(DT_Employee.Rows[i][2]))).Trim() == "P") { lblControl.SelectedIndex = lblControl.FindItemIndexByValue(Convert.ToString("P")); } else if ((Convert.ToString(Convert.ToString(DT_Employee.Rows[i][2]))).Trim() == "L") { lblControl.SelectedIndex = lblControl.FindItemIndexByValue(Convert.ToString("L")); } } } }}<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebDesigner.WebForm4" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <style type="text/css"> html, body, form { height: 100%; margin: 0; padding: 0; } </style> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="ScriptManager" runat="server"> </telerik:RadScriptManager> <telerik:RadTabStrip ID="exceptionTabStrip" runat="server" SelectedIndex="0" MultiPageID="exceptionMultiPage"> <Tabs> <telerik:RadTab runat="server" Text="short" Selected="True"> </telerik:RadTab> <telerik:RadTab runat="server" Text="long"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage ID="exceptionMultiPage" runat="server" ScrollBars="Auto" SelectedIndex="0"> <telerik:RadPageView ID="ShortException" runat="server" Selected="True"> <div> ShortException </div> </telerik:RadPageView> <telerik:RadPageView ID="DetailedException" runat="server"> <div> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> DetailedException DetailedException DetailedException DetailedException <br /> </div> </telerik:RadPageView> </telerik:RadMultiPage> </form></body></html>