or
if (RadGridOSPProposal.Style["display"] != null && RadGridOSPProposal.Style["display"].ToString() == "none") RadGridOSPProposal.Style["display"] = ""; else RadGridOSPProposal.Style.Add("display", "none");
<!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"> <title></title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server"> <Configuration UploadPaths="/Uploads/examples" ViewPaths="/Uploads/examples" DeletePaths="/Uploads/examples" MaxUploadFileSize="2097151000" SearchPatterns=".jpg" /> </telerik:RadFileExplorer> </div> </form></body></html>private void LoopEvents(){ RadListBox rlbResources = PanelBar.Items[0].Items[0].FindControl("rlbResources") as RadListBox; DataTable dt; string canceled = "Canceled"; string sql = "SELECT * FROM AppointmentResource"; string errString = ""; DateTime currdt = Convert.ToDateTime("1/1/1901"); dt = PageData.GetData(sql, ref errString).Tables[0]; if (rlbResources.Items.Count == 0) rlbResources.DataBind(); foreach (Telerik.Web.UI.RadDate rd in RadCalendar1.SelectedDates) { foreach (Telerik.Web.UI.Appointment a in RadScheduler1.Appointments) { foreach (Telerik.Web.UI.RadListBoxItem l in rlbResources.Items) { if (l.Checked & a.Resources.GetResource("Resource", Convert.ToInt32(l.Value)) != null) { //Occurrences of a recurrence master are not generated untill they //are within RadScheduler's visible range. This mandates the occurrences //information to be extracted from the Master's recurrence rule as follows: if ((a.RecurrenceState == RecurrenceState.Master) & RadCalendar1.SelectedDates.Count > 1) { RecurrenceRule parsedRule; RecurrenceRule.TryParse(a.RecurrenceRule.ToString(), out parsedRule); //If a recurring appointment does not have specified end time it will have //endless occurrences. In this case you can explicitly put a restriction: if (RadCalendar1.SelectedDates.Count > 1) parsedRule.SetEffectiveRange(RadCalendar1.SelectedDates[0].Date, RadCalendar1.SelectedDates[RadCalendar1.SelectedDates.Count - 1].Date); else parsedRule.SetEffectiveRange(RadCalendar1.SelectedDate.AddDays(-1), RadCalendar1.SelectedDate.AddDays(1)); foreach (DateTime occurrence in parsedRule.Occurrences) { if (occurrence.ToShortDateString() == rd.Date.ToShortDateString()) { //We have a match } } } else //Get the rest of the appointments //If the SelectedDate of RadScheduler is set so that the visible range encompasses occurences of //a recurring appointement, these occurences will be generated now so they will be added once again //to the DataTable. To prevent this, we use the following check: //if (a.RecurrenceState != RecurrenceState.Occurrence) //{ if (WithinDate(a.Start, a.End, rd.Date)) { //We have a match } //} } } } }}<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"GridLines="None" ShowGroupPanel="True" AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource"> <MasterTableView GridLines="None" Width="100%" CommandItemDisplay="Top"> <Columns> <telerik:gridboundcolumn datafield="FirstName" headertext="First Name"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="LastName" headertext="Last Name"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Business Name" headertext="Business Name"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="State" headertext="State"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Zip" headertext="Zip"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Address" headertext="Address"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="City" headertext="City"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Phone" headertext="Phone"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Fax" headertext="Fax"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="CellPhone" headertext="Cell"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Eamil" headertext="Email"> </telerik:gridboundcolumn> <telerik:gridboundcolumn datafield="Edit" headertext="Edit"> </telerik:gridboundcolumn> </Columns> </MasterTableView> <ClientSettings AllowDragToGroup="True"> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings></telerik:RadGrid>'this function gets the data for the rad gridPrivate Function getData() Dim table As DataTable = New DataTable() table.Columns.Add("First Name") table.Columns.Add("Last Name") table.Columns.Add("Business Name") table.Columns.Add("State") table.Columns.Add("Zip") table.Columns.Add("Address") table.Columns.Add("City") table.Columns.Add("Phone") table.Columns.Add("Fax") table.Columns.Add("Email") table.Columns.Add("CellPhone") table.Columns.Add("Edit") 'my sql connection Dim myConn As New Data.SqlClient.SqlConnection(conn) 'the name of the stored procedure Dim strSQL = "getAllCustomers" 'add the initial - Please Select - 'table.Rows.Add(New String() {"-1", "- Please Select -"}) Try myConn.Open() Dim readCommand As New Data.SqlClient.SqlCommand(strSQL, myConn) 'while we have rows from the stored procedure 'we will add them to a data table Dim cdr As SqlDataReader = readCommand.ExecuteReader() While cdr.Read() If (cdr.Item(0).ToString <> "") Then table.Rows.Add(New String() {cdr.Item(1), cdr.Item(2), cdr.Item(3), cdr.Item(4), cdr.Item(5), cdr.Item(6), cdr.Item(7), cdr.Item(8), cdr.Item(9), cdr.Item(10), cdr.Item("<a href='EditCustomer.aspx?id=" & cdr.Item(0) & "'>Edit</a>")}) End If End While 'while cdr.Read() Catch ex As Exception End Try myConn.Close() Return tableEnd Function 'createTableProtected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource RadGrid1.DataSource = getData()End Sub<table style="width:100%"> <tr> <td> <telerik:RadGrid ID="grd" runat="server" Skin="Windows7" Width="100%" Height="120px" AutoGenerateColumns="false"> <MasterTableView Width="100%" TableLayout="Fixed"> <Columns> <telerik:GridTemplateColumn> <HeaderStyle Width="50%" /> <HeaderTemplate> <asp:Label ID="lblNameHeader" runat="server" Text="Name"></asp:Label> </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblName" runat="server" Text='<%#Eval("Name")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn> <HeaderStyle Width="50%" /> <HeaderTemplate> <asp:Label ID="lblSurnameHeader" runat="server" Text="Surname"></asp:Label> </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblSurname" runat="server" Text='<%#Eval("Surname")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"> <Selecting AllowRowSelect="true" /> <Scrolling ScrollHeight="120px" AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings> </telerik:RadGrid> </td> </tr></table>public partial class GridTest : System.Web.UI.Page { List<MyClass> lst = new List<MyClass>(); protected void Page_Load(object sender, EventArgs e) { this.lst.Add(new MyClass("Andrew", "Dimech")); this.lst.Add(new MyClass("Rachel", "Smith")); this.lst.Add(new MyClass("James", "Black")); this.grd.DataSource = this.lst; this.grd.DataBind(); } } public class MyClass { public MyClass(string name, string surname) { this.Name = name; this.Surname = surname; } private string name; public string Name { get { return name; } set { name = value; } } private string surname; public string Surname { get { return surname; } set { surname = value; } } }