Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
43 views
I have a webdatagrid on the page. I have a BindingList full of custom objects. At runtime I set the datasource of the webdatagrid to the BindingList, and then I call DataBind().
When the page renders, there is nothing there, except when I look at View Source, I see all the items. They just don't show in the browser. What is going on?
Also, I don't know if it matters, but when I look at the View Source, I see a couple tables with style set to "visibility:hidden".
christinalevinee
Top achievements
Rank 1
 asked on 22 Feb 2018
0 answers
65 views

Hi,

I have written the following function to sort numbers in my Rad Grid. The output of this function shows up correctly when I push it in a array and view the result while debugging but when afte the dataBind event the data shows up in Grid, the data sort order is wrong.

For example: For Descending order sort of a:150,b:100,c:100 shows up in array while debug as b:100,c:100,a:150 but in grid it shows up as c:100,a:150,b:100.

Also, The data in dataItems of Radgrid while debug in rowDataBound event shows as a:150 b:100 a:150 and not b:100 c:100 a:150 after the sort.

Method:

//Ascending

var masterTable = sender.get_masterTableView();

var items = sender.get_masterTableView().get_dataItems()

var fieldName = args.get_commandArgument();

var sortOrder;
for (var i = 0; i < sortExpressions.get_count(); i++)
{
if (sortExpressions.getItem(i).get_fieldName() == fieldName)
{
sortOrder = sortExpressions.getItem(i).get_sortOrder();
}
}

if (sortOrder == 1) 

{
items.sort(function compareNumbers(a, b)
{
return Number(b._dataItem[fieldName]) - Number(a._dataItem[fieldName])

})
}

//Descending
else if (sortOrder == 2)
{
items.sort(function compareNumbers(a, b)
{
return Number(a._dataItem[fieldName]) - Number(b._dataItem[fieldName])

})
}

masterTable.dataBind()

}

Regards

Agasthya

agasthya
Top achievements
Rank 1
 asked on 22 Feb 2018
0 answers
75 views
Problem: The Select button in RadGridShapeInformation is clicked. The event SelectedIndexChanged fires.  In both my local system and the production set the textboxes in SelectedIndexChanged.
Local shows the correct values in the textbox on the web page.
Production show the original values.

Here is what I have:
Visual Studio 2017 Community Version
Telerik from 2015 – UI for ASP.NET AJAX

<asp:TextBox
    ID="TextBoxSelectedShape"
    runat="server"
    Width="30%"
    BorderStyle="None"
    Font-Size="Medium"
    ForeColor="White"
    Font-Bold="true"
    ReadOnly="True"
    BorderWidth="0px"
    BackColor="Blue"
    Text="--No Shape Selected--">
</asp:TextBox>

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxyShapeAdmin" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGridShapeInformation">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="TextBoxSelectedShape" />
                <telerik:AjaxUpdatedControl ControlID="TextBoxErrorMessage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>


<telerik:radPageView ID="PageViewShapeInformation"
    runat="server"
    Width="100%">
    <br />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelShapeInformation" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanelShapeInformation"
        runat="server"
        LoadingPanelID="RadAjaxLoadingPanelShapeInformation">
        <telerik:RadGrid
           ID="RadGridShapeInformation" 
            runat="server"
            AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            AutoGenerateColumns="False"
            AutoGenerateDeleteColumn="True"
            AutoGenerateEditColumn="True"
            DataSourceID="odsShapes"
            GroupPanelPosition="Top">
            <GroupingSettings CollapseAllTooltip="Collapse all groups" />
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
            <MasterTableView
                . . .
                <Columns>
                    <telerik:GridButtonColumn
                        CommandName="Select"
                        Text="Select"
                        UniqueName="Select">
                    </telerik:GridButtonColumn>
                . . .
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
</telerik:radPageView>




CODE
    Public Sub RadGridShapeInformation_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RadGridShapeInformation.SelectedIndexChanged
        myDebug.SetMessage("Entered Index Changed")
        Dim rg As RadGrid = CType(sender, RadGrid)
        Dim dataItem = TryCast(RadGridShapeInformation.SelectedItems(0), GridDataItem)
        If dataItem IsNot Nothing Then
            Patterns.DAL.MessageDAL.InsertMessage("Index Changed Shape Administration", "ENDING", SessionVariables.UserID)
            SetSelectedShapeID(dataItem("ShapeID").Text, dataItem("ShapeName").Text)
            Patterns.DAL.MessageDAL.InsertMessage(TextBoxShapeID.Text.ToString, "ENDING", SessionVariables.UserID)
            Patterns.DAL.MessageDAL.InsertMessage(TextBoxSelectedShape.Text, "ENDING", SessionVariables.UserID)
        Else
            ResetPage()
            Patterns.DAL.MessageDAL.InsertMessage("Index NOT Changed Shape Administration", "ENDING", SessionVariables.UserID)
        End If
    End



    Private Sub SetSelectedShapeID(pShapeID As String, pShapeName As String)
        If pShapeID.Length = 0 Then
            Me.TextBoxShapeID.Text = ""
            Me.TextBoxSelectedShape.Text = "--No Shape Selected--"
        Else
            Me.TextBoxShapeID.Text = pShapeID
            Me.TextBoxSelectedShape.Text = pShapeName
        End If
    End Sub
James
Top achievements
Rank 1
 asked on 21 Feb 2018
1 answer
192 views

The documentation says I can include more than the one column in the search of my DataTable by using the DataKeyNames property. Maybe I am not understanding but its not working. I have my DataTextField column set to "Name" and my DataKeyNames set to "Alias". I expected the search to go against the Name column and the Alias column but it seems to be only searching the Name column. 

Does not get any simpler scenario than this so I must not be understanding how DataKeyNames works.

DataTable columns: Id, Name, Alias

<telerik:RadSearchBox ID="requestSearchBox" runat="server" Width="400" CssClass="SearchBox" EnableAutoComplete="true"
                            DataValueField ="Id"
                            DataKeyNames= "Alias"
                            DataTextField="Name">
                        </telerik:RadSearchBox>

 

Brian

Vessy
Telerik team
 answered on 21 Feb 2018
0 answers
272 views

 

 
GRID : A
 
<telerik:RadGrid RenderMode="Lightweight" ID="ParkingLockSytemGrid" OnItemCommand="ParkingLockSytemGrid_ItemCommand" skin="Silk" runat="server" Width="800" PagerStyle-AlwaysVisible="true" OnNeedDataSource="ParkingLockSytemGrid_NeedDataSource" AllowSorting="true" AllowPaging="false" AllowFilteringByColumn="false">
 
       <MasterTableView AutoGenerateColumns="False" AllowAutomaticInserts="true"  DataKeyNames="ID"  CommandItemDisplay="Top" ShowHeader="true" EnableColumnsViewState="true"  PagerStyle-AlwaysVisible="true">
           <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="true" />
 
            
           <Columns>
 
               <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
               <ItemStyle Width="50px"></ItemStyle>
           </telerik:GridEditCommandColumn>
 
               <telerik:GridTemplateColumn UniqueName="ImageName" SortExpression="Name">
                   <ItemTemplate>
                     <img alt="" src="<%#Eval(" Icon ") %>" />
                   </ItemTemplate>
                   <EditItemTemplate>
                       </EditItemTemplate>
                   </telerik:GridTemplateColumn>
 
 
               <telerik:GridBoundColumn DataField="DeviceName" HeaderText="Device Name" SortExpression="DeviceName"
                   UniqueName="DeviceName">
               </telerik:GridBoundColumn>
 
               <telerik:GridBoundColumn DataField="ZoneName" HeaderText="Zone" SortExpression="Zone"
                   UniqueName="Zone">
               </telerik:GridBoundColumn>
 
                
 
               <telerik:GridBoundColumn DataField="GeneralState" HeaderText="State" SortExpression="State"
                   UniqueName="State">
               </telerik:GridBoundColumn>
 
               <telerik:GridButtonColumn Text="Delete" CommandName="Delete" />
 
 
           </Columns>
       </MasterTableView>
        <ClientSettings EnablePostBackOnRowClick="true" AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                   <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"></Selecting>
                   <ClientEvents OnRowDropping="demo.onRowDropping"></ClientEvents>
                   <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
               </ClientSettings>
       </telerik:RadGrid>
B
<telerik:RadGrid RenderMode="Lightweight" ID="ApplianceLogsGrid" runat="server" Skin="Silk" OnNeedDataSource="ApplianceLogsGrid_NeedDataSource" AllowSorting="true" AllowPaging="false">
   <MasterTableView ShowHeader="true" ShowHeadersWhenNoRecords="true" CssClass="table table-striped table-hover" AutoGenerateColumns="False" AllowPaging="false" DataKeyNames="EntityID" PageSize="7">
      <Columns>
         <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
         </telerik:GridEditCommandColumn>
         <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName"
            UniqueName="UserName">
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="Timestamp" HeaderText="Date Time" SortExpression="Date"
            UniqueName="DateTime">
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="UserID" HeaderText="User ID" SortExpression="UserID"
            UniqueName="UserID">
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="OperationName" HeaderText="Operation" SortExpression="Operation"
            UniqueName="LogOperation">
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="Parameters" HeaderText="Log Description" SortExpression="Description"
            UniqueName="LogDescription">
         </telerik:GridBoundColumn>
         <telerik:GridButtonColumn Text="Delete" CommandName="Delete" />
      </Columns>
   </MasterTableView>
</telerik:RadGrid>

 

 

Here is event Code !

protected void ParkingLockSytemGrid_ItemCommand(object sender, GridCommandEventArgs e)
      {
         
 
 
              switch (e.CommandName)
              {
                  case "RowClick":
                      GridDataItem dataItem = e.Item as GridDataItem;
                      Response.Redirect("~/ParkDeviceDetails.ascx?id=" + dataItem["UniqueName"].Text);
                      break;
                  default:
                      break;
              }
 
 
 
           
 
      }

 

This does not work i get error : Cannot find a cell bound to column name 'UniqueName'
 i tried changing to ID or entityid but nothing !!, what am I doing wrong here , can somebody help? thanks

Bonge
Top achievements
Rank 1
 asked on 21 Feb 2018
0 answers
75 views

I want to create a team scheduler in  which will show:

1. Days for One  from .

2. Each as per user.

3. Weekends marked in .

4. Leaves marked in blue .

Please guide for the same.

 

abhijeet
Top achievements
Rank 1
 asked on 21 Feb 2018
0 answers
109 views
I have implemented the drag and drop row feature of telerik RadGrid. Now i have to comfirm/prompt user for drag and drop row action with some message like 'Are you sure to drag the selected row?'

I have implemented below two events for the same 

1) Client Side: 

function onRowDropping(sender, args) {

// some code to do something

}

2) Code behind:

protected void grd_RowDrop(object sender, GridDragDropEventArgs e)
{

// some code to do something

}

So, Please suggest how can we achieve this functionality.

1) Once user attempt to drag and drop the row, a confirmation popup should come.

2) If user confirm the action row should be dropped and re-ordered.

3) Else action should be reverted from client side itself.

 

Any help would be highely appriciated.

 

Thnaks,

Manish
Manish
Top achievements
Rank 1
 asked on 21 Feb 2018
0 answers
71 views
I have implemented the drag and drop row feature of telerik radgrid. Now i have to comfirm/prompt user for drag and drop row action with some message like 'Are you sure to drag the selected row?'

I have implemented below two events for the same 

1) Client Side: 

function onRowDropping(sender, args) {

// some code to do something

}?

2) Code behind:

protected void grd_RowDrop(object sender, GridDragDropEventArgs e)
{

// some code to do something

}

So, Please suggest how can we achieve this functionality.

1) Once user attempt to drag and drop the row, a confirmation popup should come.

2) If user confirm the action row should be dropped and re-ordered.

3) Else action should be reverted from client side itself.

 

Any help would be highely appriciated.

 

Thnaks,

Manish
Manish
Top achievements
Rank 1
 asked on 21 Feb 2018
7 answers
237 views
I am trying to use the ClientEvent OnCommand to develop custom client-side sorting based on the data type of the column being sorted.  How do I actually accomplish this?  Firing sender.get_masterTableView().sort(mysortexpression); causes an endless loop since the OnCommand event is fired.  Here is my code

function

 

SORT(sender, args) {

 

args.set_cancel(

true); //cancels postback

 

 

if (args.get_commandName() == "Sort") {

 

var

 

sortexp = new Telerik.Web.UI.GridSortExpression();

 

sortexp.set_fieldName(args.get_commandArgument());

sortexp.set_sortOrder(2);

 

 

sender.get_masterTableView().sort(sortexp

);//this causes an endless loop

 

 

}

Thanks

 

agasthya
Top achievements
Rank 1
 answered on 21 Feb 2018
3 answers
171 views

I have a page that I am trying to place two grids and set the heights or grid correctly correctly. I am making some success, see attached screen shot. I have the top grid loading somewhat visually correct but when I select a row in the grid (see second attached screen shot) it all falls part.

here is my page 

<%@ Page Title="" Language="C#" MasterPageFile="~/Modules/Module.Master" AutoEventWireup="true" CodeBehind="ManageEmployees.aspx.cs" Inherits="HelmOnline.Web.Modules.TimeClock.ManageEmployee" %>

<%@ Register Src="~/Common/Controls/CustomerIdField.ascx" TagPrefix="uc1" TagName="CustomerIdField" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ModuleContent" runat="server">
    <div style="margin: 10px; height: 100%; background-color: pink;">

        <style type="text/css">
            .rightAlign {
                float: right;
            }
        </style>

        <telerik:RadScriptBlock runat="server">
            <script type="text/javascript">
                function Resize() {
                    setTimeout(function () {
                        var scrollArea = document.getElementById("<%= RadGrid1.ClientID %>" + "_GridData");
                if (scrollArea) {
                    //scrollArea.style.height = 100%;
                    alert(document.body.offsetHeight);
                    scrollArea.style.height = ((document.body.offsetHeight) / 2) - 150 + "px";
                }

                if (window["<%= RadGrid1.ClientID %>"].ClientSettings.Scrolling.UseStaticHeaders) {
                    var header = document.getElementById("<%= RadGrid1.ClientID %>" + "_GridHeader");
                    scrollArea.style.height = document.body.offsetHeight - header.offsetHeight + "px";
                }
                    }, 200);
                }
                window.onresize = window.onload = Resize;

                function OpenWCEntry(sender, punchid, customerid, employeeid, punchtimein, punchtimeout) {
                    //alert('Hello');
                    var dialogWindow = $find("<%=RadWindow1.ClientID%>");
                    dialogWindow.set_title("Modify Punch Entry");
                    //dialogWindow.set_navigateUrl(dialogWindow._navigateUrl);
                    var baseUrl = "Dialog/AddEditWebTime.aspx";
                    baseUrl = baseUrl + "?";
                    baseUrl = baseUrl + "punchid=" + punchid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "customerid=" + customerid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "employeeid=" + employeeid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "punchtimein=" + punchtimein;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "punchtimeout=" + punchtimeout;
                    dialogWindow.set_navigateUrl(baseUrl)
                    dialogWindow.set_modal(true);
                    dialogWindow.show();
                }

                function OnClientCloseHandler(sender, args) {
                    var btnRefreshGrids = $find("<%=btnRefreshGrids.ClientID%>");
                    btnRefreshGrids.click();
                }

                function OpenWebClockReport(sender, customerid, startdate, enddate) {

                    var baseUrl = "Dialog/WebClockReport.aspx";
                    baseUrl = baseUrl + "?";
                    baseUrl = baseUrl + "customerid=" + customerid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "startdate=" + startdate;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "enddate=" + enddate;

                    document.title = 'Web Clock Report';
                    window.open(baseUrl);
                }

                function OpenWebClockEmployeeReport(sender, customerid, employeeid, startdate, enddate) {

                    //alert(customerid);
                    //alert(employeeid);
                    //alert(startdate);
                    //alert(enddate);
                    var baseUrl = "Dialog/WebClockEmployeeReport.aspx";
                    baseUrl = baseUrl + "?";
                    baseUrl = baseUrl + "customerid=" + customerid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "employeeid=" + employeeid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "startdate=" + startdate;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "enddate=" + enddate;

                    document.title = 'Web Clock Employee Report';
                    window.open(baseUrl);
                }
            </script>
        </telerik:RadScriptBlock>

        <telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow RenderMode="Lightweight" ID="RadWindow1" runat="server" Height="400" Width="1000" NavigateUrl="~/Modules/TimeClock/Dialog/AddEditWebTime.aspx" OnClientClose="OnClientCloseHandler" Behaviors="Close" />
            </Windows>
        </telerik:RadWindowManager>

        <telerik:RadAjaxManager ID="RadRadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                        <telerik:AjaxUpdatedControl ControlID="btnAdd" />
                        <telerik:AjaxUpdatedControl ControlID="btnEdit" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnRefreshGrids">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnRefreshGrids" />
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
            <ClientEvents />
        </telerik:RadAjaxManager>

        <asp:Panel runat="server" ID="pcustomerDateSelect">
            <div style="margin: 0px; height: 10%;">
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <telerik:RadLabel runat="server" ID="radlabel1" Text="Customer ID"></telerik:RadLabel>
                            </td>
                            <td>
                                <uc1:CustomerIdField runat="server" ID="CustomerIdField" />
                            </td>
                            <td>
                                <telerik:RadLabel runat="server" ID="radlabel3" Text="Start Date"></telerik:RadLabel>
                            </td>
                            <td>
                                <telerik:RadDatePicker runat="server" ID="StartDate"></telerik:RadDatePicker>
                            </td>
                            <td>
                                <telerik:RadLabel runat="server" ID="radlabel4" Text="End Date"></telerik:RadLabel>
                            </td>
                            <td>
                                <telerik:RadDatePicker runat="server" ID="EndDate"></telerik:RadDatePicker>
                            </td>
                            <td>
                                <telerik:RadButton runat="server" ID="btnLoadCustomer" Text="Submit" OnClick="btnLoadCustomer_Click"></telerik:RadButton>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </asp:Panel>

        <telerik:RadAjaxPanel runat="server" ID="pCustomerEmployee" PostBackControls="btnExportGrid" Height="100%">
            <div style="margin: 0px; height: 5%; background-color: red;">
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <telerik:RadLabel runat="server" ID="radlabel2" Text="Customer"></telerik:RadLabel>
                            </td>
                            <td width="30%">
                                <telerik:RadLabel runat="server" ID="lblCustomerIDName"></telerik:RadLabel>
                            </td>
                            <td width="30%">
                                <telerik:RadLabel runat="server" ID="lblSelectDate"></telerik:RadLabel>
                            </td>
                            <td width="15%">
                                <asp:LinkButton runat="server" ID="btnReport" Text="Web Clock Report" />
                                <%--<asp:LinkButton runat="server" ID="btnEmployeeReport" Text="Web Clock Employee Report" />--%>
                            </td>
                            <td width="25%">
                                <telerik:RadButton runat="server" ID="btnTimeImport" CssClass="rightAlign" Text="Import Time" OnClick="btnTimeImport_Click" />
                            </td>
                        </tr>
                    </tbody>
                </table>
                <telerik:RadButton ID="btnRefreshGrids" Text="Refresh" OnClick="btnRefreshGrids_Click" runat="server" Style="display: none;" />
            </div>

            <div style="margin: 0px; height: 50%; background-color: green;">
                <div>
                    <asp:ImageButton ID="btnExportGrid" runat="server" ImageUrl="/Images/Excel_XLSX.png" Height="24" Width="24" OnClick="btnExportGrid_Click" AlternateText="ExportToExcel" />
                </div>
                <telerik:RadGrid runat="server" ID="RadGrid1" Width="100%" Height="100%" AutoGenerateColumns="false" AllowPaging="False" AllowSorting="true" ShowGroupPanel="false" PageSize="10" RenderMode="Classic" AllowFilteringByColumn="true" GroupingSettings-CaseSensitive="false" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" OnNeedDataSource="RadGrid1_NeedDataSource">
                    <MasterTableView Width="100%" >
                        <Columns>
                            <telerik:GridBoundColumn HeaderStyle-Width="0" SortExpression="Customerid" HeaderText="Customerid" HeaderButtonType="TextButton" DataField="Customerid" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn SortExpression="EmployeeID" HeaderText="EmployeeID" HeaderButtonType="TextButton" DataField="EmployeeID" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn SortExpression="FirstName" HeaderText="FirstName" HeaderButtonType="TextButton" DataField="FirstName" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn SortExpression="LastName" HeaderText="LastName" HeaderButtonType="TextButton" DataField="LastName" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn SortExpression="TotalHours" HeaderText="TotalHours" HeaderButtonType="TextButton" DataField="TotalHours" DataFormatString="{0:###,##0.00}" />
                        </Columns>
                    </MasterTableView>
                    <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" EnablePostBackOnRowClick="true" Selecting-AllowRowSelect="true">
                        <Selecting AllowRowSelect="True"></Selecting>
                        <Resizing AllowRowResize="False" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing>
                        <Scrolling UseStaticHeaders="true" AllowScroll="true"  />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>

            <div style="margin: 0px; height: 50%; background-color: yellow;">
                <div>
                    <asp:LinkButton runat="server" ID="btnAdd" Text="Add New Punch" OnClick="btnAdd_Click" Visible="false"></asp:LinkButton>
                </div>
                <telerik:RadGrid ID="RadGrid2" OnNeedDataSource="RadGrid2_NeedDataSource" runat="server" AutoGenerateColumns="false" AllowPaging="False" AllowSorting="true" ShowGroupPanel="false" PageSize="10" RenderMode="Classic" Width="100%" Height="100%" AllowFilteringByColumn="false" GroupingSettings-CaseSensitive="false" OnItemCreated="RadGrid2_ItemCreated" OnItemCommand="RadGrid2_ItemCommand">
                    <MasterTableView Width="100%">
                        <Columns>
                            <telerik:GridButtonColumn UniqueName="btnDelete" CommandName="Delete" ButtonType="LinkButton" Text="Delete" HeaderStyle-Width="45" HeaderText="Delete" ConfirmText="Do want to delete punch?" ImageUrl="../../Images/redx-md.png" />
                            <telerik:GridButtonColumn UniqueName="btnEdit" ButtonType="LinkButton" Text="Modify" HeaderText="Modify" HeaderStyle-Width="55" />
                            <telerik:GridBoundColumn HeaderStyle-Width="0" SortExpression="Customerid" HeaderText="Customerid" HeaderButtonType="TextButton" DataField="Customerid" DataFormatString="{0:d}" />
                            <telerik:GridDateTimeColumn SortExpression="dt" HeaderText="Date" HeaderButtonType="TextButton" DataField="dt" DataType="System.DateTime" DataFormatString="{0:M/d/yyyy}" />
                            <telerik:GridBoundColumn SortExpression="DayOfWeek" HeaderText="Day Of Week" HeaderButtonType="TextButton" DataField="DayOfWeek" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn HeaderStyle-Width="0" SortExpression="EmployeeID" HeaderText="EmployeeID" HeaderButtonType="TextButton" DataField="EmployeeID" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn HeaderStyle-Width="0" SortExpression="FirstName" HeaderText="FirstName" HeaderButtonType="TextButton" DataField="FirstName" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn HeaderStyle-Width="0" SortExpression="LastName" HeaderText="LastName" HeaderButtonType="TextButton" DataField="LastName" DataFormatString="{0:d}" />
                            <telerik:GridBoundColumn SortExpression="PunchID" HeaderText="PunchID" HeaderButtonType="TextButton" DataField="PunchID" DataFormatString="{0:d}" />
                            <telerik:GridDateTimeColumn SortExpression="PunchInDate" HeaderText="Punch In Date" HeaderButtonType="TextButton" DataField="PunchInDate" DataType="System.DateTime" DataFormatString="{0:M/d/yyyy}" />
                            <telerik:GridDateTimeColumn SortExpression="PunchInTime" HeaderText="Punch In Time" HeaderButtonType="TextButton" DataField="PunchInTime" DataType="System.DateTime" />
                            <telerik:GridDateTimeColumn SortExpression="PunchOutDate" HeaderText="Punch Out Date" HeaderButtonType="TextButton" DataField="PunchOutDate" DataType="System.DateTime" DataFormatString="{0:M/d/yyyy}" />
                            <telerik:GridDateTimeColumn SortExpression="PunchOutTime" HeaderText="Punch Out Time" HeaderButtonType="TextButton" DataField="PunchOutTime" DataType="System.DateTime" />
                            <telerik:GridBoundColumn SortExpression="Hours_Worked" HeaderText="Hours Worked" HeaderButtonType="TextButton" DataField="Hours_Worked" DataFormatString="{0:###,##0.00}" />
                        </Columns>
                    </MasterTableView>
                    <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="True"></Selecting>
                        <Resizing AllowRowResize="False" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing>
                        <Scrolling UseStaticHeaders="true" AllowScroll="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>
        </telerik:RadAjaxPanel>
    </div>
</asp:Content>

Eyup
Telerik team
 answered on 21 Feb 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?