This is a migrated thread and some comments may be shown as answers.
GridMaskedColumn Validation
0 Answers 4 Views
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 04 Aug 2017, 03:31 PM

Hello, 

I am in need of a way to validate my GridMaskedColumns. The input mustbe in military time. (00:00) to (23:59) Can you all help me find the best possible solution. 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="50%" Width="2000px">
    <table>
        <tr>
            <td align="center" style="background-color: dimgray">
                <h2>Weekly Schedule</h2>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="Panel1" runat="server" Width="2000px" >
                    <table>
                        <tr>
                            <td>
                                <telerik:RadDatePicker RenderMode="Lightweight" ID="dpStartDate" Height="20px" Width="100%" runat="server" DateInput-Label="" EnableTyping="false" ToolTip="Select Week - Starting with Monday" Skin="Metro"></telerik:RadDatePicker>
                            </td>
                            <td>
                                <telerik:RadDropDownList RenderMode="Lightweight" ID="ddDepartments" runat="server"  DropDownHeight="200px" Height="20px" Width="150px" DefaultMessage="-Department-" DropDownWidth="150px" Skin="Metro" ToolTip="Departments">
                                    <Items>
                                        <telerik:DropDownListItem runat="server" Text="Finish Ops" />
                                        <telerik:DropDownListItem runat="server" Text="Hardware" />
                                        <telerik:DropDownListItem runat="server" Text="Machining" />
                                        <telerik:DropDownListItem runat="server" Text="Quality" />
                                        <telerik:DropDownListItem runat="server" Text="Sheet Metal" />    
                                        <telerik:DropDownListItem runat="server" Text="Shipping" />
                                    </Items>
                                </telerik:RadDropDownList>
                            </td>
                            <td>
                                <telerik:RadDropDownList RenderMode="Lightweight" ID="ddShifts" runat="server"  DropDownHeight="100px" Height="20px" Width="150px" DefaultMessage="-Shift-" DropDownWidth="150px" Skin="Metro" ToolTip="Shift">
                                    <Items>
                                        <telerik:DropDownListItem runat="server" Text="First" />
                                        <telerik:DropDownListItem runat="server" Text="Second" />
                                        <telerik:DropDownListItem runat="server" Text="Weekend" />
                                    </Items>
                                </telerik:RadDropDownList>
                            </td>
                            <td>
                                <telerik:RadButton ID="btnLoad" runat="server" Height="20px" OnClick="btnLoad_Click" Skin="Metro" Text="Load" ToolTip="Load"></telerik:RadButton>
                            </td>
                            <td>
                                <telerik:RadButton ID="btnTransfer" runat="server" Height="20px" OnClick="btnTransfer_Click" Skin="Metro" Text="Transfer" ToolTip="Transfer schedule from previous week"></telerik:RadButton>
                           </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td style="vertical-align:top">
                <telerik:RadGrid ID="gvDetailsMain" Skin="Metro" ScrollBars="Vertical" runat="server" AutoGenerateColumns="False" Width="2000px" Height="900px"
                    OnNeedDataSource="gvDetailsMain_NeedDataSource" OnItemDataBound="gvDetailsMain_ItemDataBound"  OnUpdateCommand="gvDetailsMain_UpdateCommand"
                    GroupPanelPosition="Top" ClientSettings-AllowKeyboardNavigation="true">
                    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
                        <MasterTableView Name="MasterTableView_Schedule" TableLayout="Fixed" CommandItemDisplay="Top" EditMode="Batch" DataKeyNames="EmployeeCode, sMondayID, sTuesdayID, sWednesdayID, sThursdayID, sFridayID, sSaturdayID, sSundayID">
                            <CommandItemSettings ShowRefreshButton="true" ShowAddNewRecordButton="false" AddNewRecordText="Add" />
                            <BatchEditingSettings EditType="Cell" /> 
                            <ColumnGroups>
                                <telerik:GridColumnGroup Name="EmployeeInfo" HeaderText="Employee Info" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Monday" HeaderText="Monday" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Tuesday" HeaderText="Tuesday" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Wednesday" HeaderText="Wednesday" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Thursday" HeaderText="Thursday" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Friday" HeaderText="Friday" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Saturday" HeaderText="Saturday" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridColumnGroup Name="Sunday" HeaderText="Sunday" HeaderStyle-HorizontalAlign="Center" />
                            </ColumnGroups>
                            <Columns>
                                <telerik:GridMaskedColumn UniqueName="FullName" DataField="FullName" Aggregate="None" HeaderText="Employee" SortExpression="Type" HeaderStyle-Width="35px" ReadOnly="true" ColumnGroupName="EmployeeInfo"/>
                                <telerik:GridMaskedColumn UniqueName="EmployeeCode" DataField="EmployeeCode" Aggregate="None" HeaderText="Clock #" SortExpression="EmployeeCode" HeaderStyle-Width="10px" ReadOnly="true" ColumnGroupName="EmployeeInfo"/>
 
                                <telerik:GridMaskedColumn UniqueName="sMonday" DataField="sMonday" Aggregate="None" HeaderText="In" SortExpression="sMonday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Monday" Mask="##:##" ColumnValidationSettings-RenderValidatorBeforeEditor="true"/>
                                <telerik:GridMaskedColumn UniqueName="eMonday" DataField="eMonday" Aggregate="None" HeaderText="Out" SortExpression="eMonday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Monday" Mask="##:##"/>
 
                                <telerik:GridMaskedColumn UniqueName="sTuesday" DataField="sTuesday" Aggregate="None" HeaderText="In" SortExpression="sTuesday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Tuesday" Mask="##:##"/>
                                <telerik:GridMaskedColumn UniqueName="eTuesday" DataField="eTuesday" Aggregate="None" HeaderText="Out" SortExpression="eTuesday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Tuesday" Mask="##:##"/>
                                
                                <telerik:GridMaskedColumn UniqueName="sWednesday" DataField="sWednesday" Aggregate="None" HeaderText="In" SortExpression="sWednesday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Wednesday" Mask="##:##"/>
                                <telerik:GridMaskedColumn UniqueName="eWednesday" DataField="eWednesday" Aggregate="None" HeaderText="Out" SortExpression="eWednesday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Wednesday" Mask="##:##"/>
                           
                                <telerik:GridMaskedColumn UniqueName="sThursday" DataField="sThursday" Aggregate="None" HeaderText="In" SortExpression="sThursday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Thursday" Mask="##:##"/>
                                <telerik:GridMaskedColumn UniqueName="eThursday" DataField="eThursday" Aggregate="None" HeaderText="Out" SortExpression="sThursday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Thursday" Mask="##:##"/>
       
                                <telerik:GridMaskedColumn UniqueName="sFriday" DataField="sFriday" Aggregate="None" HeaderText="In" SortExpression="sFriday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Friday" Mask="##:##"/>
                                <telerik:GridMaskedColumn UniqueName="eFriday" DataField="eFriday" Aggregate="None" HeaderText="Out" SortExpression="eFriday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Friday" Mask="##:##"/>
            
                                <telerik:GridMaskedColumn UniqueName="sSaturday" DataField="sSaturday" Aggregate="None" HeaderText="In" SortExpression="sSaturday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Saturday" Mask="##:##"/>
                                <telerik:GridMaskedColumn UniqueName="eSaturday" DataField="eSaturday" Aggregate="None" HeaderText="Out" SortExpression="eSaturday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Saturday" Mask="##:##"/>
 
                                <telerik:GridMaskedColumn UniqueName="sSunday" DataField="sSunday" Aggregate="None" HeaderText="In" SortExpression="sSunday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Sunday" Mask="##:##"/>
                                <telerik:GridMaskedColumn UniqueName="eSunday" DataField="eSunday" Aggregate="None" HeaderText="Out" SortExpression="eSunday" HeaderStyle-Width="10px" ReadOnly="false" ColumnGroupName="Sunday" Mask="##:##"/>
                            </Columns>         
                        </MasterTableView>
                        <ClientSettings>       
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"/>
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>
                </telerik:RadGrid>
            </td>
        </tr>
    </table>
</telerik:RadAjaxPanel>
 
<telerik:RadNotification ID="rnMessage" runat="server" Skin="Metro" EnableRoundedCorners="true" EnableShadow="true" Text="Please fill in all feilds" Title="Message" Width="500" Height="100"></telerik:RadNotification>
<telerik:RadNotification ID="rnMessageMonday" runat="server" Skin="Metro" EnableRoundedCorners="true" EnableShadow="true" Text="Please select your week starting with Monday" Title="Message" Width="500" Height="100"></telerik:RadNotification>
<telerik:RadNotification ID="rnMessageGood" runat="server" Skin="Metro" EnableRoundedCorners="true" EnableShadow="true" Text="Good To GO!" Title="Message" Width="500" Height="100"></telerik:RadNotification>

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Share this question
or