Hello
I used the tutorial to create my own custom template for the Advanced Form for inserting and updating appointments in the Scheduler.
One of the resources I have are various a patient that a doctor can schedule an appointment for. This resource is really big so its inefficient putting it in a comboBox and scrolling. Instead I added a RadGrid with filtering so a person can search for a patient easier. I wanted to add code on the selectIndexchanged that would set the subject as the patient selected and also select the appropriate value in the ComboBox based on PatientID. The postback code however doesn't do anything and it just stays empty. Does anyone know how I can get that working or could make a suggestion on a more efficient way to handle this scenario?
Thanks in advance!
Edit: forgot to post the code I did so far
AdvancedForm.ascx -->added this code in this form
Code-behind:
I used the tutorial to create my own custom template for the Advanced Form for inserting and updating appointments in the Scheduler.
One of the resources I have are various a patient that a doctor can schedule an appointment for. This resource is really big so its inefficient putting it in a comboBox and scrolling. Instead I added a RadGrid with filtering so a person can search for a patient easier. I wanted to add code on the selectIndexchanged that would set the subject as the patient selected and also select the appropriate value in the ComboBox based on PatientID. The postback code however doesn't do anything and it just stays empty. Does anyone know how I can get that working or could make a suggestion on a more efficient way to handle this scenario?
Thanks in advance!
Edit: forgot to post the code I did so far
AdvancedForm.ascx -->added this code in this form
<
table
>
<
tr
>
<
td
>Search Patient:
</
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
DataSourceID
=
"SqlDataSourceAllPats"
GridLines
=
"None"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
EnableLinqExpressions
=
"False"
Width
=
"600px"
OnSelectedIndexChanged
=
"RadGrid1_SelectedIndexChanged"
>
<
MasterTableView
Width
=
"600px"
DataSourceID
=
"SqlDataSourceAllPats"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"Account_Number"
ClientDataKeyNames
=
"Account_Number"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
/>
<
Columns
>
<
telerik:GridButtonColumn
HeaderText
=
""
Text
=
"Select"
CommandName
=
"Select"
/>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Account_Number column"
HeaderText
=
"Acct No"
UniqueName
=
"AcctNo"
DataField
=
"Account_Number"
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"StartsWith"
ShowFilterIcon
=
"false"
EmptyDataText
=
""
Visible
=
"true"
ItemStyle-Width
=
"60px"
HeaderStyle-Width
=
"60px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter FirstName column"
HeaderText
=
"First Name"
UniqueName
=
"FirstName"
DataField
=
"FirstName"
EmptyDataText
=
""
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"StartsWith"
ShowFilterIcon
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter LastName column"
HeaderText
=
"Last Name"
UniqueName
=
"LastName"
DataField
=
"LastName"
EmptyDataText
=
""
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"StartsWith"
ShowFilterIcon
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Birthdate column"
HeaderText
=
"Date of Birth"
UniqueName
=
"Birthdate"
DataField
=
"Birthdate"
EmptyDataText
=
""
DataFormatString
=
"{0:MM/dd/yyyy}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter SSN column"
HeaderText
=
"SSN"
UniqueName
=
"SSN"
DataField
=
"SSN"
EmptyDataText
=
""
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"StartsWith"
ShowFilterIcon
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Address column"
HeaderText
=
"Address"
UniqueName
=
"Address"
DataField
=
"Address"
EmptyDataText
=
""
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
Visible
=
"True"
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
Visible
=
"True"
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
></
Scrolling
>
</
ClientSettings
>
</
telerik:RadGrid
>
</
td
>
</
tr
>
</
table
>
<
asp:SqlDataSource
ID
=
"SqlDataSourceAllPats"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:kcMedic_Central_Connection %>"
SelectCommand="sp_patientList" SelectCommandType="StoredProcedure">
<
SelectParameters
>
<
asp:SessionParameter
DefaultValue
=
"C002"
Name
=
"SITE_ID_LNK"
SessionField
=
"SiteId"
Type
=
"String"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
Code-behind:
protected
void
RadGrid1_SelectedIndexChanged(
object
sender, EventArgs e)
{
string
KeyID = (RadGrid1.SelectedItems[0]
as
GridDataItem).GetDataKeyValue(
"Account_Number"
).ToString();
string
name = (RadGrid1.SelectedItems[0]
as
GridDataItem)[
"FirstName"
].Text.Trim() +
" "
+
(RadGrid1.SelectedItems[0]
as
GridDataItem)[
"LastName"
].Text.Trim();
(ResPatient.FindControl(
"ResourceValue"
)
as
RadComboBox).SelectedValue = KeyID;
Subject = name;
this
.SubjectText.Text = name;
this
.SubjectText.ReadOnly =
true
;
}