Hi.
I have a difficult problem attemting to validate a change in a RadComboBox that is in the EditItemTemplate of a RadGrid GridTemplateColumn. I have two such combo boxes in the EditTemplate(s), and I wnat to validate the changed to value of one against the vlaue of the other. So when the user changes the combobox "startime", the validation code examines the value (not the text) of the "endtime" combobox (and the same thing validating the "endtime" change against the "starttime"). What code must I put in the ServerValidate event for one combobox to find the control that is the other combobox? I looked through all the local objects of the radgrid during debug, and cannot find these. Declarative syntax below:
Thank you for any and all help!
Tom Stanley
I have a difficult problem attemting to validate a change in a RadComboBox that is in the EditItemTemplate of a RadGrid GridTemplateColumn. I have two such combo boxes in the EditTemplate(s), and I wnat to validate the changed to value of one against the vlaue of the other. So when the user changes the combobox "startime", the validation code examines the value (not the text) of the "endtime" combobox (and the same thing validating the "endtime" change against the "starttime"). What code must I put in the ServerValidate event for one combobox to find the control that is the other combobox? I looked through all the local objects of the radgrid during debug, and cannot find these. Declarative syntax below:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sdsCRNAShifts" GridLines="None" Skin="Simple" |
AutoGenerateColumns="False" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" PageSize="128" Width="100%" AllowSorting="True" OnEditCommand="RadGrid1_EditCommand" > |
<MasterTableView DataSourceID="sdsCRNAShifts" CommandItemDisplay="Top" DataKeyNames="shiftID" > |
<Columns> |
<telerik:GridCheckBoxColumn DataField="active" HeaderText="active" UniqueName="active" AllowFiltering="False" AllowSorting="False"> |
<HeaderStyle Width="20px" /> |
</telerik:GridCheckBoxColumn> |
<telerik:GridDropDownColumn DataField="shiftType" DataSourceID="XmlDataSource1" HeaderText="Type" |
ListValueField="ID" ListTextField="Text" UniqueName="shiftType" > |
<ItemStyle Width="60px" /> |
<HeaderStyle Width="60px" /> |
</telerik:GridDropDownColumn> |
<telerik:GridBoundColumn DataField="shiftName" HeaderText="Name" UniqueName="shiftName" ColumnEditorID="GridTextBoxColumnEditor1" > |
<HeaderStyle Width="120px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="shiftDescr" HeaderText="Description" UniqueName="shiftDescr" ColumnEditorID="GridTextBoxColumnEditor2" AllowSorting="False" > |
<HeaderStyle Width="200px" /> |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn DataField="bOff" HeaderText="BeginTime" UniqueName="bOff"> |
<EditItemTemplate> |
<telerik:RadComboBox ID="bOffRadComboBox" runat="server" DataSourceID="sdsTimeText" |
DataTextField="timeText" DataValueField="numMins" SelectedValue='<%# Bind("bOff") %>' AutoPostBack="True" OnSelectedIndexChanged="bOffRadComboBox_SelectedIndexChanged"> |
</telerik:RadComboBox> |
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="StartTime must precede EndTime" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator> |
</EditItemTemplate> |
<ItemTemplate> |
<asp:Label ID="bOffLabel" runat="server" Text='<%# Eval("beginTime") %>'></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn DataField="eOff" HeaderText="EndTime" UniqueName="eOff"> |
<EditItemTemplate> |
<telerik:RadComboBox ID="eOffRadComboBox" runat="server" DataSourceID="sdsTimeText" |
DataTextField="timeText" DataValueField="numMins" SelectedValue='<%# Bind("eOff") %>' AutoPostBack="True"> |
</telerik:RadComboBox> |
|
<asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="EndTime must follow StartTime" OnServerValidate="CustomValidator2_ServerValidate"></asp:CustomValidator> |
</EditItemTemplate> |
<ItemTemplate> |
<asp:Label ID="eOffLabel" runat="server" Text='<%# Eval("endTime") %>'></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridEditCommandColumn ButtonType="ImageButton"> |
<HeaderStyle Width="50px" /> |
</telerik:GridEditCommandColumn> |
</Columns> |
<EditFormSettings> |
<EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> |
</EditColumn> |
</EditFormSettings> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="True" /> |
</ClientSettings> |
</telerik:RadGrid> |
Thank you for any and all help!
Tom Stanley