We are using the RadScheduler to view and manipulate the doctors appointment list.
In day view we want to show the patient name and also som detailed information - neatly organised as in multiple columns.
We have tried using formating options for the Appointment.Description like "{0}\t{1}\t" and "{0,30} {1,10}" which doesn't seem to help.
Our goal is to see appointment organised like this:
09:20 JACK NICHOLSON 22.04.1937 GPO YYN
09:40 LINDA BLAIR 22.01.1959 KL YN
What we get is this:
09:20 JACK NICHOLSON 22.04.1937 GPO YYN
09:40 LINDA BLAIR 22.01.1959 KL YN
Is there a way to make the string formatting work as expected (simplest) or to add string objects with predefined width to the appointments (more complex).
Best regards,
Gunnar

Hello,
I am wondering how to use a RadListBox control with the Filter Template in a RadGrid? I looked at the demos for filtering but did not see any for how to handle the multiple selections of a RadListBox control. Would anyone be able to point me in the right direction as far as documentation?
Thanks!

Hello,
I have a RadGrid that is using the Header Context filtering and I am trying to bind the list boxes, but I received this kind of error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compilation Error Message: BC30456: 'radGrid1_FilterCheckListItemsRequested" is not a member of 'ASP.cad_cadlog_aspx'.
I'm following everything that the Telerik demo for Excel-filtering says to include, but I receive the above error regardless. I've copy/pasted what the event name is and everything. Still no luck. Here is my RadGrid code:
<Telerik:RadGrid ID="radGrid1" runat="server" ShowFooter="true" Width="100%" Height="650px" Visible="true" DataSourceID="dsCADLog" AllowFilteringByColumn="true" FilterType="HeaderContext" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" OnFilterCheckListItemsRequested="radGrid1_FilterCheckListItemsRequested">I have manually created RadGrids based on data. The grids create just fine but I don't know how to add the sorting and pagination to a DYNAMICALLY created RadGrid.
Here is my RadGrid creation code:
Private Function CreateGrid(ByVal strLine As String) As RadGrid
Dim rg As New RadGrid
rg.ID = strLine rg.Width = Unit.Percentage(280) rg.PageSize = 40 rg.AllowPaging = True rg.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric rg.PagerStyle.AlwaysVisible = True rg.MasterTableView.PagerStyle.AlwaysVisible = True rg.AutoGenerateColumns = False rg.ExportSettings.FileName = strLine Dim boundColumn As GridBoundColumn boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Process" boundColumn.HeaderText = "Process" boundColumn.UniqueName = "Process" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Product" boundColumn.HeaderText = "Product" boundColumn.UniqueName = "Product" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Tested" boundColumn.HeaderText = "Tested" boundColumn.UniqueName = "Tested" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Passed" boundColumn.HeaderText = "Passed" boundColumn.UniqueName = "Passed" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Failed" boundColumn.HeaderText = "Failed" boundColumn.UniqueName = "Failed" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Yield" boundColumn.HeaderText = "Yield" boundColumn.UniqueName = "Yield" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "Top5" boundColumn.HeaderText = "Top 5 Rejects" boundColumn.UniqueName = "Top5" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left boundColumn = New GridBoundColumn rg.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = "TrueFailure" boundColumn.HeaderText = "True Failure?" boundColumn.UniqueName = "TrueFailure" boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center Return rg
End Function
The way I have done it on a project that was NOT dynamically created:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Session("Report") = CreateTable()
End If
End Sub
Protected Sub rdgAgeReport_PageIndexChanged(sender As Object, e As Telerik.Web.UI.GridPageChangedEventArgs) Handles rdgAgeReport.PageIndexChanged
rdgAgeReport.DataSource = CType(Session("Report"), DataTable)
rdgAgeReport.DataBind()
End Sub Protected Sub rdgAgeReport_PageSizeChanged(sender As Object, e As Telerik.Web.UI.GridPageSizeChangedEventArgs) Handles rdgAgeReport.PageSizeChanged
rdgAgeReport.DataSource = CType(Session("Report"), DataTable)
rdgAgeReport.DataBind()
End Sub
I've had Load on Demand working with the RadComboBox for a long time with a TelerikController Web API resource. While building-out more of our API I recently made all JSON responses camel case like so:
Dim settings As JsonSerializerSettings = GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettingssettings.Formatting = Formatting.Indentedsettings.ContractResolver = New CamelCasePropertyNamesContractResolver()
The camel casing breaks RadComboBox though. Items returned from the web service will not be displayed in the dropdown. Is there any property that can be set to change this behavior or do we have to give up camel casing? I don't want to manually handle the response event and parse the JSON.
Thank you
I have an autocomplete on my page that is bound to a sqldatasource. Not sure why it is not working the progress meter just spins and spins. The reason i think its with bootstrap is because if i take the control and the sqldatasource to a blank page, it works? I dont get an error so its hard to diagnose. Please take a look at my code and tell me where the conflict is. Thank You
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet"><script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script><style> .numberCircle { border-radius: 50%; width: 36px; height: 36px; line-height: 36px; vertical-align:middle; margin: 5px; background: #fff; border: 2px solid #666; color: #666; position: absolute; left: -50px; text-align: center; font: 28px Arial, sans-serif;} .required { color: #e31937; font-family: Verdana; margin: 0 5px; } .field-validation-error { color: #e31937; font-weight: bold; }</style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:Literal ID="distID" runat="server" Text=""></asp:Literal> <asp:Literal ID="error" runat="server" Text=""></asp:Literal> <h4>Use this option to add a single student. This is an ideal option prior to printing scan sheets and when only a few students need to be addedd. If you already printed and distributed the scan sheets you need to print out a blank scan sheet and add the student responses directly into Remark. Please click here for more information on how to that. </h4> <br /> <div class="container"> <div class="btn-group btn-toggle"> <asp:Button ID="btnElementary" CssClass="btn btn-primary" runat="server" Text="Elementary" OnClick="btnElementary_Click" ViewStateMode="Enabled" CausesValidation="False" /> <asp:Button ID="btnSecondary" CssClass="btn btn-default" runat="server" Text="Secondary" OnClick="btnElementary_Click" ViewStateMode="Enabled" CausesValidation="False" /> </div> <br /> <br /></div> <div class="col-lg-6"> <div class="numberCircle">1</div> </div> <div class="container"> <div class="jumbotron"> <div class="row"> <div class="form-group-lg"> <div class="col-lg-2"> <div class="form-group"> <label class="col-2 col-form-label">Student ID</label> <div class="col-10"> <input class="form-control" runat="server" type="text" value="" id="StudentID"> <div class="collapse"> <asp:RequiredFieldValidator ID="STUvalid" ValidationGroup="validSTU" runat="server" ErrorMessage="Student ID Required" Display="None" ControlToValidate="StudentID"> </asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="STUValidSecondary" ValidationGroup="validSecondary" runat="server" ErrorMessage="Student ID Required" Display="None" ControlToValidate="StudentID"> </asp:RequiredFieldValidator> </div> </div></div><div class="form-group"> <label for="example-search-input" class="col-2 col-form-label">Student Name</label> <div class="col-10"> <input class="form-control" runat="server" type="text" value="" id="Name"> <div class="collapse"> <asp:RequiredFieldValidator ID="stuNameValid" ValidationGroup="validSTU" runat="server" ErrorMessage="Student Name Required" Display="None" ControlToValidate="Name"> </asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="stuNameValidSecondary" ValidationGroup="validSecondary" runat="server" ErrorMessage="Student Name Required" Display="None" ControlToValidate="Name"> </asp:RequiredFieldValidator> </div> </div></div><div class="form-group"> <label for="example-email-input" class="col-2 col-form-label">School ID</label> <div class="col-10"> <asp:TextBox ID="tbSchoolID" runat="server" CssClass="form-control input-lg" TextMode="Number"></asp:TextBox> <div class="collapse"> <asp:RequiredFieldValidator ID="SchoValid" ValidationGroup="validSTU" runat="server" ErrorMessage="School ID Required" Display="None" ControlToValidate="tbSchoolID"> </asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="SchoValidSecondary" ValidationGroup="validSecondary" runat="server" ErrorMessage="School ID Required" Display="None" ControlToValidate="tbSchoolID"> </asp:RequiredFieldValidator> </div> </div></div><div class="form-group"> <label for="example-url-input" class="col-2 col-form-label">Grade</label> <div class="col-10"> <asp:DropDownList ID="ddlGrade" CssClass="btn btn-default dropdown-toggle btn-lg" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged"> <asp:ListItem class="dropdown-header"> Grade </asp:ListItem> <asp:ListItem Text="K" Value="0"/> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> <asp:ListItem>8</asp:ListItem> <asp:ListItem>9</asp:ListItem> <asp:ListItem>10</asp:ListItem> <asp:ListItem>11</asp:ListItem> <asp:ListItem>12</asp:ListItem> </asp:DropDownList> </div></div></div><div class="col-lg-2"> </div><div class="col-lg-2"><div class="form-group"> <label for="example-tel-input" class="col-2 col-form-label">Ethnicity</label> <div class="col-10"> <div class="col-10"> <asp:DropDownList ID="ddlRace" CssClass="btn btn-default dropdown-toggle btn-lg" runat="server"> <asp:ListItem Enabled="False">-- Select Ethnicity --</asp:ListItem> <asp:ListItem Text="White" Value="WHT"/> <asp:ListItem Text="African American" Value="AA"/> <asp:ListItem Text="Hispanic" Value="HIS"/> <asp:ListItem Text="Asian" Value="Asian"/> <asp:ListItem Text="Other" Value="Other"/> </asp:DropDownList> </div> </div></div><div class="form-group"> <label for="example-password-input" class="col-2 col-form-label">Language Fluency</label> <div class="col-10"> <asp:DropDownList ID="ddlLF" CssClass="btn btn-default dropdown-toggle btn-lg" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlLF_SelectedIndexChanged"> <asp:ListItem class="dropdown-header"> LF </asp:ListItem> <asp:ListItem Text="English Only" Value="EO"/> <asp:ListItem Text="English Learner" Value="EL"/> <asp:ListItem Text="IFEP" Value="IFEP"/> <asp:ListItem Text="RFEP" Value="RFEP"/> </asp:DropDownList> </div></div><div class="form-group" id="LFlevel" runat="server"> <label for="example-password-input" class="col-2 col-form-label">CELDT Level</label> <div class="col-10"> <asp:DropDownList ID="ddlLF_level" CssClass="btn btn-default dropdown-toggle btn-lg" runat="server"> <asp:ListItem class="dropdown-header"> Level </asp:ListItem> <asp:ListItem Text="Begining" Value="1"/> <asp:ListItem Text="Early Intermediate" Value="2"/> <asp:ListItem Text="Intermediate" Value="3"/> <asp:ListItem Text="Early Advanced" Value="4"/> <asp:ListItem Text="Advanced" Value="5"/> </asp:DropDownList> </div></div><div class="form-group"> <label for="example-number-input" class="col-2 col-form-label">Special Education</label> <div class="col-10"> <asp:DropDownList ID="ddlSped" CssClass="btn btn-default dropdown-toggle btn-lg" runat="server"> <asp:ListItem class="dropdown-header"> SPED </asp:ListItem> <asp:ListItem Text="Yes" Value="Y"/> <asp:ListItem Text="No" Value=""/> </asp:DropDownList> </div></div><div class="form-group"> <label for="example-datetime-local-input" class="col-2 col-form-label">US Entry Date</label> <div class="col-10"> <telerik:RadDatePicker Skin="Bootstrap" ID="RDusDate" runat="server"></telerik:RadDatePicker> </div></div></div><div class="col-lg-2"></div> <div class="col-lg-2" id="DIVelemTeacher" runat="server"> <div class="form-group"> <label for="example-email-input" class="col-2 col-form-label">Elemtary Teacher</label> <div class="col-10"> <telerik:RadAutoCompleteBox ID="ELEMautoTeacher" runat="server" Skin="Bootstrap" InputType="Text" DataSourceID="sqlTeacher" DataTextField="teacher" DataValueField="teacher" Filter="StartsWith" EmptyMessage="Start typing"></telerik:RadAutoCompleteBox> </div></div> </div> <%-- ---VALIDATION------%> <div class="col-lg-2" > <div class="form-group"> <asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="validSTU" CssClass="field-validation-error" DisplayMode="BulletList" runat="server" /> <asp:ValidationSummary ID="ValidationSummary2" ValidationGroup="validSecondary" CssClass="field-validation-error" DisplayMode="BulletList" runat="server" /> </div> </div> <%------ END ------%> </div> </div> <br /> <br /> <asp:Button ID="btnStudent" ValidationGroup="validSTU" CssClass="btn btn-primary" runat="server" Text="Add Student" OnClick="btnStudent_Click" /> </div> </div> <div id="target" runat="server" class="hidden"> <div class="col-lg-6"> <div class="numberCircle">2</div> </div> <%-- ---BEGIN SECONDARY PERIODS-----%> <div class="container"> <div class="jumbotron"> <div class="form-inline"> <asp:DropDownList ID="ddlPeriod" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Period </asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> </asp:DropDownList> <asp:TextBox ID="tbTeacherName1" runat="server" Width="175px" CssClass="form-control input-lg" placeholder="Teacher Name" ></asp:TextBox> <div class="collapse"> <asp:RequiredFieldValidator ID="p1Teacher" ValidationGroup="validSecondary" runat="server" ErrorMessage="Period Teacher Name Required" Display="None" ControlToValidate="tbTeacherName1"> </asp:RequiredFieldValidator> </div> <asp:TextBox ID="tbTeacherID1" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="TeacherID"></asp:TextBox> <div class="collapse"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="validSecondary" runat="server" ErrorMessage="Period Teacher ID Required" Display="None" ControlToValidate="tbTeacherID1"> </asp:RequiredFieldValidator> </div> <asp:TextBox ID="tbCourse1" runat="server" CssClass="form-control input-lg" Width="175px" placeholder="Course Name"></asp:TextBox> <div class="collapse"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="validSecondary" runat="server" ErrorMessage="Course Name Required" Display="None" ControlToValidate="tbCourse1"> </asp:RequiredFieldValidator> </div> <asp:TextBox ID="tbCourseID1" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="Course ID"></asp:TextBox> <div class="collapse"> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ValidationGroup="validSecondary" runat="server" ErrorMessage="Course ID Required" Display="None" ControlToValidate="tbCourseID1"> </asp:RequiredFieldValidator> </div> <asp:DropDownList ID="ddlDept1" runat="server" CssClass="dropdown-toggle btn-lg" height="45px"> <asp:ListItem class="dropdown-header"> Dept </asp:ListItem> <asp:ListItem>ELA</asp:ListItem> <asp:ListItem>Math</asp:ListItem> <asp:ListItem>Hist</asp:ListItem> <asp:ListItem>SCI</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnPeriod1" ValidationGroup="validSecondary" runat="server" CssClass="btn btn-primary pull-right" Text="Insert this class" OnClick="btnPeriod1_Click" /> <br /> <div id="radio-group1" class="btn-group" data-toggle="collapse" data-target="#period2" aria-expanded="false" aria-controls="collapseExample"> <h4> <span class="glyphicon glyphicon-plus-sign" ></span> Add Another Class </h4> <br /> </div> </div> <%--NEW PERIOD--%> <div class="collapse" id="period2"> <div class="form-inline"> <asp:DropDownList ID="ddlPeriod2" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Period </asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> </asp:DropDownList> <asp:TextBox ID="tbTeacherName2" runat="server" Width="175px" CssClass="form-control input-lg" placeholder="Teacher Name"></asp:TextBox> <asp:TextBox ID="tbTeacherID2" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="TeacherID"></asp:TextBox> <asp:TextBox ID="tbCourse2" runat="server" CssClass="form-control input-lg" Width="175px" placeholder="Course Name"></asp:TextBox> <asp:TextBox ID="tbCourseID2" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="Course ID"></asp:TextBox> <asp:DropDownList ID="ddlDept2" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Dept </asp:ListItem> <asp:ListItem>ELA</asp:ListItem> <asp:ListItem>Math</asp:ListItem> <asp:ListItem>Hist</asp:ListItem> <asp:ListItem>SCI</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnPeriod2" runat="server" ValidationGroup="validSecondary" CssClass="btn btn-primary pull-right" Text="Insert this class" OnClick="btnPeriod2_Click" Enabled="False" /> <div id="radio-group2" class="btn-group" data-toggle="collapse" data-target="#period3" aria-expanded="false" aria-controls="collapseExample"> <h4> <span class="glyphicon glyphicon-plus-sign" ></span> Add Another Class </h4> <br /> </div> </div> </div> <%-- ----------- NEW PERIOD-----------%> <div class="collapse" id="period3"> <div class="form-inline"> <asp:DropDownList ID="ddlPeriod3" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Period </asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> </asp:DropDownList> <asp:TextBox ID="tbTeacherName3" runat="server" Width="175px" CssClass="form-control input-lg" placeholder="Teacher Name" ></asp:TextBox> <asp:TextBox ID="tbTeacherID3" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="TeacherID"></asp:TextBox> <asp:TextBox ID="tbCourse3" runat="server" CssClass="form-control input-lg" Width="175px" placeholder="Course Name"></asp:TextBox> <asp:TextBox ID="tbCourseID3" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="Course ID"></asp:TextBox> <asp:DropDownList ID="ddlDept3" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Dept </asp:ListItem> <asp:ListItem>ELA</asp:ListItem> <asp:ListItem>Math</asp:ListItem> <asp:ListItem>Hist</asp:ListItem> <asp:ListItem>SCI</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnPeriod3" runat="server" CssClass="btn btn-primary pull-right" Text="Insert this class" OnClick="btnPeriod3_Click" /> <div id="radio-group3" class="btn-group" data-toggle="collapse" data-target="#period4" aria-expanded="false" aria-controls="collapseExample"> <h4> <span class="glyphicon glyphicon-plus-sign" ></span> Add Another Class </h4> <br /> </div> </div> </div> <%-- ----------- NEW PERIOD-----------%> <div class="collapse" id="period4"> <div class="form-inline"> <asp:DropDownList ID="ddlPeriod4" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Period </asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> </asp:DropDownList> <asp:TextBox ID="tbTeacherName4" runat="server" Width="175px" CssClass="form-control input-lg" placeholder="Teacher Name" ></asp:TextBox> <asp:TextBox ID="tbTeacherID4" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="TeacherID"></asp:TextBox> <asp:TextBox ID="tbCourse4" runat="server" CssClass="form-control input-lg" Width="175px" placeholder="Course Name"></asp:TextBox> <asp:TextBox ID="tbCourseID4" runat="server" CssClass="form-control input-lg" Width="115px" placeholder="Course ID"></asp:TextBox> <asp:DropDownList ID="ddlDept4" runat="server" CssClass="btn btn-default dropdown-toggle btn-lg"> <asp:ListItem class="dropdown-header"> Dept </asp:ListItem> <asp:ListItem>ELA</asp:ListItem> <asp:ListItem>Math</asp:ListItem> <asp:ListItem>Hist</asp:ListItem> <asp:ListItem>SCI</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnPeriod4" runat="server" CssClass="btn btn-primary pull-right" Text="Insert this class" OnClick="btnPeriod4_Click" /> <br /> </div> </div> </div> </div> </div> <br /> <br /> <br /> <script> $('.glyphicon').click(function () { $(this).toggleClass('glyphicon glyphicon-plus-sign').toggleClass('glyphicon glyphicon-minus-sign'); }); </script> <asp:SqlDataSource ID="sqlTeacher" runat="server" ConnectionString="<%$ ConnectionStrings:MyMatrixConnectionString %>" ProviderName="<%$ ConnectionStrings:MyMatrixConnectionString.ProviderName %>" SelectCommand="SELECT DISTINCT teacher FROM CRS"> <SelectParameters> <asp:SessionParameter Name="DistrictID" SessionField="DistrictID" /> </SelectParameters> </asp:SqlDataSource></asp:Content>
namespace Matrix_Builder{ public partial class addStudent : System.Web.UI.Page { MembershipUser username = Membership.GetUser(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { LFlevel.Visible = false; //period.Visible = false; //distID.Text = Session["DistrictID"].ToString(); } } protected void btnStudent_Click(object sender, EventArgs e) { if (Page.IsValid) { int dID = 0; var DistrictID = Session["DistrictID"]; dID = Convert.ToInt32(DistrictID); //GET MEMBERSHIP USERNAME! string storeProc = "sp_InsertSTU"; SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString); conn.Open(); DateTime dt = Convert.ToDateTime(RDusDate.SelectedDate); string temp = dt.ToShortDateString(); try { SqlCommand cmd = new SqlCommand(storeProc, conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@DistrictID", dID)); cmd.Parameters.Add(new SqlParameter("@username", username.ToString())); cmd.Parameters.Add(new SqlParameter("@schoolID", tbSchoolID.Text)); cmd.Parameters.Add(new SqlParameter("@PID", StudentID.Value)); cmd.Parameters.Add(new SqlParameter("@Student_Name", Name.Value)); cmd.Parameters.Add(new SqlParameter("@grade", ddlGrade.SelectedValue.ToString())); cmd.Parameters.Add(new SqlParameter("@ethnicity", ddlRace.SelectedValue.ToString())); cmd.Parameters.Add(new SqlParameter("@LF", ddlLF.SelectedValue.ToString())); cmd.Parameters.Add(new SqlParameter("@CELDT_LVL", ddlLF_level.SelectedValue.ToString())); cmd.Parameters.Add(new SqlParameter("@SPED", ddlSped.SelectedValue.ToString())); cmd.Parameters.Add(new SqlParameter("@US_entry_date", temp)); cmd.ExecuteScalar(); conn.Close(); distID.Text = "Student Demographic Data Successfully Inserted"; } catch (Exception ex) { error.Text = ex.Message; } } if (btnElementary.CssClass == "btn btn-primary" & Page.IsValid) { string Tname = ELEMautoTeacher.Text; string teachID = ""; string course = ELEMautoTeacher.Text; string courseID = ddlGrade.SelectedValue; string period = "E"; string dept = ddlGrade.SelectedValue; string user = username.ToString(); var DistrictID = Session["DistrictID"].ToString(); var studentID = StudentID.Value; var schoolID = tbSchoolID.Text; Dictionary<string, string> testdir = new Dictionary<string, string> { {"@username",user }, {"@DistrictID",DistrictID }, {"@teacher",Tname }, {"@TeacherID", teachID }, {"@CO", course }, {"@CN", courseID }, {"@period", period }, {"@PID", studentID }, {"@schoolID", schoolID }, {"@dept", dept } }; string testconnectString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; SQLMethod("sp_InsertCRS", testconnectString, testdir, btnPeriod1); } } protected void ddlGrade_SelectedIndexChanged(object sender, EventArgs e) { int i = Int32.Parse(ddlGrade.SelectedValue); if (i > 6) { btnElementary.CssClass = "btn btn-default"; btnSecondary.CssClass = "btn btn-primary"; target.Attributes["class"] = ""; DIVelemTeacher.Visible = false; } else { btnElementary.CssClass = "btn btn-primary"; btnSecondary.CssClass = "btn btn-default"; target.Attributes["class"] = "collapse"; DIVelemTeacher.Visible = true; } } protected void ddlLF_SelectedIndexChanged(object sender, EventArgs e) { if (ddlLF.SelectedValue == "EL") { LFlevel.Visible = true; } else { LFlevel.Visible = false; } } protected void btnElementary_Click(object sender, EventArgs e) { if (sender == btnSecondary) { btnElementary.CssClass = "btn btn-default"; btnSecondary.CssClass = "btn btn-primary"; target.Attributes["class"] = ""; DIVelemTeacher.Visible = false; } if (sender == btnElementary) { btnElementary.CssClass = "btn btn-primary"; btnSecondary.CssClass = "btn btn-default"; target.Attributes["class"] = "collapse"; DIVelemTeacher.Visible = true; } } protected void btnSecondary_Click(object sender, EventArgs e) { btnElementary.CssClass = "btn btn-primary"; target.Attributes["class"] = "collapse"; } protected void btnPeriod1_Click(object sender, EventArgs e) { if (Page.IsValid) { string Tname = tbTeacherName1.Text; string teachID = tbTeacherID1.Text; string course = tbCourse1.Text; string courseID = tbCourseID1.Text; string period = ddlPeriod.SelectedValue; string dept = ddlDept1.SelectedValue; string user = username.ToString(); var DistrictID = Session["DistrictID"].ToString(); var studentID = StudentID.Value; var schoolID = tbSchoolID.Text; Dictionary<string, string> testdir = new Dictionary<string, string> { {"@username",user }, {"@DistrictID",DistrictID }, {"@teacher",Tname }, {"@TeacherID", teachID }, {"@CO", course }, {"@CN", courseID }, {"@period", period }, {"@PID", studentID }, {"@schoolID", schoolID }, {"@dept", dept } }; string testconnectString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; SQLMethod("sp_InsertCRS", testconnectString, testdir, btnPeriod1); } } protected void btnPeriod2_Click(object sender, EventArgs e) { string Tname = tbTeacherName2.Text; string teachID = tbTeacherID2.Text; string course = tbCourse2.Text; string courseID = tbCourseID2.Text; string period = ddlPeriod2.SelectedValue; string dept = ddlDept2.SelectedValue; string user = username.ToString(); var DistrictID = Session["DistrictID"].ToString(); var studentID = StudentID.Value; var schoolID = tbSchoolID.Text; Dictionary<string, string> testdir = new Dictionary<string, string> { {"@username",user }, {"@DistrictID",DistrictID }, {"@teacher",Tname }, {"@TeacherID", teachID }, {"@CO", course }, {"@CN", courseID }, {"@period", period }, {"@PID", studentID }, {"@schoolID", schoolID }, {"@dept", dept } }; string testconnectString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; SQLMethod("sp_InsertCRS", testconnectString, testdir, btnPeriod2); } public void SQLMethod(string storeProc, string connectString, Dictionary<string, string> dir, Button btn) { SqlConnection conn = new SqlConnection(connectString); conn.Open(); try { SqlCommand cmd = new SqlCommand(storeProc, conn); cmd.CommandType = CommandType.StoredProcedure; foreach (KeyValuePair<string, string> keyValue in dir) { cmd.Parameters.Add(new SqlParameter(keyValue.Key, keyValue.Value)); } cmd.ExecuteScalar(); conn.Close(); btn.Text = "Success"; btn.CssClass = "btn btn-info pull-right"; btn.Enabled = false; } catch (Exception ex) { distID.Text = ex.Message; } } protected void btnPeriod3_Click(object sender, EventArgs e) { string Tname = tbTeacherName3.Text; string teachID = tbTeacherID3.Text; string course = tbCourse3.Text; string courseID = tbCourseID3.Text; string period = ddlPeriod3.SelectedValue; string dept = ddlDept3.SelectedValue; string user = username.ToString(); var DistrictID = Session["DistrictID"].ToString(); var studentID = StudentID.Value; var schoolID = tbSchoolID.Text; Dictionary<string, string> testdir = new Dictionary<string, string> { {"@username",user }, {"@DistrictID",DistrictID }, {"@teacher",Tname }, {"@TeacherID", teachID }, {"@CO", course }, {"@CN", courseID }, {"@period", period }, {"@PID", studentID }, {"@schoolID", schoolID }, {"@dept", dept } }; string testconnectString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; SQLMethod("sp_InsertCRS", testconnectString, testdir, btnPeriod3); } protected void btnPeriod4_Click(object sender, EventArgs e) { string Tname = tbTeacherName4.Text; string teachID = tbTeacherID4.Text; string course = tbCourse4.Text; string courseID = tbCourseID4.Text; string period = ddlPeriod4.SelectedValue; string dept = ddlDept4.SelectedValue; string user = username.ToString(); var DistrictID = Session["DistrictID"].ToString(); var studentID = StudentID.Value; var schoolID = tbSchoolID.Text; Dictionary<string, string> testdir = new Dictionary<string, string> { {"@username",user }, {"@DistrictID",DistrictID }, {"@teacher",Tname }, {"@TeacherID", teachID }, {"@CO", course }, {"@CN", courseID }, {"@period", period }, {"@PID", studentID }, {"@schoolID", schoolID }, {"@dept", dept } }; string testconnectString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; SQLMethod("sp_InsertCRS", testconnectString, testdir, btnPeriod4); } }