Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
233 views

Hello,

 

I have a grid with row BatchEditMode and GridTemplateColumn with RadAsyncUpload in Edittemplate. I try to save file to fileserver on OnBatchEditCommand, but I can not access to RadAsyncUpload from code behind.

 

<telerik:RadGrid runat="server" Skin="Metro" RenderMode="Lightweight" ID="gvAuditorium" AutoGenerateColumns="False" DataSourceID="dsAuditorium"
    AllowAutomaticDeletes="false" AllowAutomaticInserts="False" AllowAutomaticUpdates="False" AllowPaging="True"
    OnBatchEditCommand="gvAuditorium_OnBatchEditCommand">
    <MasterTableView DataKeyNames="RoomId" PageSize="50" EditMode="Batch" CommandItemDisplay="TopAndBottom">
        <CommandItemSettings ShowAddNewRecordButton="False" ShowRefreshButton="False"></CommandItemSettings>
        <BatchEditingSettings EditType="Row" OpenEditingEvent="Click"></BatchEditingSettings>         
        <Columns>
            <telerik:GridBoundColumn DataField="Number" SortExpression="Number" UniqueName="Number" HeaderText="Номер аудитории" ReadOnly="True"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="RoomName" SortExpression="RoomName" UniqueName="RoomName" HeaderText="Название" ReadOnly="True"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TypeRoomName" SortExpression="TypeRoomName" UniqueName="TypeRoomName" HeaderText="Тип аудитории" ReadOnly="True"></telerik:GridBoundColumn>
            <telerik:GridNumericColumn DataField="Square" SortExpression="Square" UniqueName="Square" DataFormatString="{0:N2}" DecimalDigits="2" HeaderText="Площадь" />
            <telerik:GridNumericColumn DataField="PlaceCount" SortExpression="PlaceCount" UniqueName="PlaceCount" DecimalDigits="0" DataFormatString="{0:0}" HeaderText="Количество мест"/>          
            <telerik:GridTemplateColumn DataField="ScanFileName" UniqueName="ScanFileName" HeaderText="План аудитории">
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="hlToFile" Target="_blank" Visible='<%# Eval("hasFile") %>' Text='<%# Bind("ScanFileName") %>' NavigateUrl='<%# "~/_layouts/15/FastAuditoriumFilling/AuditoriumFileDownload.aspx?RoomId=" + Eval("RoomId")  %>' ></asp:HyperLink>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadAsyncUpload runat="server" ID="auFileUpload" Skin="Metro" RenderMode="Lightweight" AllowedFileExtensions="pdf" ></telerik:RadAsyncUpload>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>   
</telerik:RadGrid>
protected void gvAuditorium_OnBatchEditCommand(object sender, GridBatchEditingEventArgs e)
        {
 
            if (e.Commands.Count > 0)
            {
                foreach (var editingCommand in e.Commands)
                {
                    int roomId = (int)editingCommand.Item.GetDataKeyValue("RoomId");
                    Hashtable newValues = editingCommand.NewValues;
                    RadAsyncUpload auFileUpload = gvAuditorium.FindControl(gvAuditorium.MasterTableView.ClientID + "_ScanFileName").FindControl("auFileUpload") as RadAsyncUpload;
                    if (auFileUpload != null && auFileUpload.UploadedFiles.Count > 0)
                    {
                        //SAVE FILE
                    }
                    //SAVE DATA TO DB
                }
 
            }
 
        }

If e.Commands.Count == 1, then all OK, but if e.Commands.Count > 1 then RadAsyncUpload auFileUpload = gvAuditorium.FindControl(gvAuditorium.MasterTableView.ClientID +"_ScanFileName").FindControl("auFileUpload") as RadAsyncUpload; get always first edit control.

How can I save files from all edited lines?

Marin Bratanov
Telerik team
 answered on 28 Aug 2017
0 answers
137 views

hi,

i try to export my grid data to excel with ExcelML format, i have column with timespan type and it stay empty in the export file,

how i can export this kind of type or other non primitive type

 

01.<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" DataSourceID="ObjectDataSource1" AllowPaging="true" PageSize="20" OnExcelMLExportRowCreated="RadGrid1_OnExcelMLExportRowCreated">
02.       <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" DataKeyNames="Index" DataSourceID="ObjectDataSource1" UseAllDataFields="True">
03.           <Columns>
04.               <telerik:GridBoundColumn DataField="Index" DataType="System.Guid" HeaderText="Index"
05.                   ReadOnly="true" Visible="false" SortExpression="Index" UniqueName="Index">
06.               </telerik:GridBoundColumn>
07.               <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName"
08.                           UniqueName="FirstName">
09.                       </telerik:GridBoundColumn>
10.               <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName" SortExpression="LastName"
11.                   UniqueName="LastName">
12.               </telerik:GridBoundColumn>
13.               <telerik:GridBoundColumn DataField="Age" DataType="System.Int32" HeaderText="Age"
14.                   SortExpression="Age" UniqueName="Age">
15.               </telerik:GridBoundColumn>
16.                <telerik:GridBoundColumn DataField="Time" DataType="System.TimeSpan" HeaderText="Time"
17.                   SortExpression="Time" UniqueName="Time">
18.               </telerik:GridBoundColumn>
19.           </Columns>
20.       </MasterTableView>
21.       <ExportSettings ExportOnlyData="true" />
22.   </telerik:RadGrid>
23.   <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetContacts" TypeName="myClasses.ContactList"></asp:ObjectDataSource>

 

i attach image how it look after the export

i can get to the cell of this type under the OnExcelMLExportRowCreated event but the data is read only and i can't change it

Adi
Top achievements
Rank 1
 asked on 28 Aug 2017
1 answer
129 views

I'm trying to export a grid containing RadCalendar to PDF, is there any tricks here or restrictions?

 

<telerik:RadGrid ID="Grid" runat="server" AllowSorting="false" AutoGenerateColumns="False" ShowGroupPanel="False" Skin="Silk"
        AllowPaging="True" AllowMultiRowSelection="True" PageSize="20" ShowFooter="False" AllowFilteringByColumn="false">
 
        <MasterTableView AllowCustomPaging="False" AllowCustomSorting="True" GroupLoadMode="Client"
            Name="Grid" Width="100%" >
            <Columns>
                <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Some Month" UniqueName="SomeMonthColumn">
                    <ItemTemplate>
                        <div>
                            <asp:Label ID="SomeLabel" runat="server" Text=""></asp:Label>
                        </div>
                        <div>
                            <telerik:RadCalendar ID="RadCalendar1" runat="server" Skin="Silk" RenderMode="Classic"></telerik:RadCalendar>
                        </div>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
Rumen
Telerik team
 answered on 28 Aug 2017
1 answer
118 views

Hello,

Is there a way to produce a PDF with a specific number of months, so for example the PDF would have 3 images under each other for 3 different months?

thank you,

-Sam

Peter Milchev
Telerik team
 answered on 28 Aug 2017
0 answers
196 views

Hello everyone.
First of all I am new to Telerik.
I need to create a RadGrid that has no DataSource and is shown as in figure1.
The user can edit the "Quantity" cell and the "Discount" cell but can not edit the other cells.
In the "Description" cell (and only in that cell) the user can press F2 and the window in figure2 will be displayed.
How can I do that?

Ignacio
Top achievements
Rank 1
 asked on 26 Aug 2017
0 answers
125 views

I have a RadGrid on my web page and I populate the RadGrid from my SQL database.  The RadGrid displays correctly.  I can then click on the Edit icon and I then display an email address from the RadGrid.  I allow the user to modify the email address.  If the email address adheres to my RegEx expression and is valid then I update the email address in my database.  But if it is not valid, I want to display an error message directly to the right of the email address that displays when I click Edit.  I cannot figure out how to do this.  Can anyone provide an example on how to do this?

Here is my aspx code:

<telerik:RadGrid ID="gvEmailRedirectMaint"
                         runat="server"
                         AllowFilteringByColumn="true"
                         AllowSorting="true"
                         AllowPaging="false"
                         GroupPanelPosition="Top"
                         RenderMode="Lightweight"
                         EnableLinqExpressions="false"
                         OnItemCreated="gvEmailRedirectMaint_ItemCreated"
                         OnNeedDataSource="gvEmailRedirectMaint_NeedDataSource"
                         OnUpdateCommand="gvEmailRedirectMaint_UpdateCommand"
                         OnDeleteCommand="gvEmailRedirectMaint_DeleteCommand"
                         ClientSettings-Scrolling-AllowScroll="true"
                         ClientSettings-Scrolling-UseStaticHeaders="true"
                         Height="575px">
            <GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="false"></GroupingSettings>
            <ClientSettings>
                <Resizing AllowColumnResize="true" AllowRowResize="true" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="false"AllowResizeToFit="true" />
            </ClientSettings>
            <AlternatingItemStyle BackColor="#E0E0E0" />
            <MasterTableView AutoGenerateColumns="false" TableLayout="Auto" CommandItemDisplay="Top" DataKeyNames="ID" EditMode="EditForms">
                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                <Columns>
                    <telerik:GridEditCommandColumn HeaderText="Edit:" ButtonType="ImageButton">
                        <HeaderStyle Width="50px" />
                        <ItemStyle Width="50px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="ID" AllowFiltering="false" HeaderText="ID" UniqueName="ID" ReadOnly="true" Visible="false">
                        <HeaderStyle Width="160px" />
                        <ItemStyle Width="160px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="VIPPreferredID" AllowFiltering="true" UniqueName="VIPPreferredID" ReadOnly="true" HeaderText="VIP Preferred ID">
                        <HeaderStyle Width="160px" />
                        <ItemStyle Width="160px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FullName" AllowFiltering="true" UniqueName="FullName" ReadOnly="true" HeaderText="Full Name">
                        <HeaderStyle Width="300px" />
                        <ItemStyle Width="300px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RedirectEmailAddress" AllowFiltering="true" UniqueName="RedirectEmailAddress" ReadOnly="false" HeaderText="Redirect Email Address">
                       <HeaderStyle Width="320px" />
                        <ItemStyle Width="320px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ModifiedBy" AllowFiltering="false" UniqueName="ModifiedBy" ReadOnly="true" HeaderText="Last Modified By">
                        <HeaderStyle Width="160px" />
                        <ItemStyle Width="160px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ModifiedDate" AllowFiltering="false" UniqueName="ModifiedDate" ReadOnly="true" HeaderText="Last Modified Date">
                        <HeaderStyle Width="200px" />
                        <ItemStyle Width="20px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn CommandName="Delete" HeaderText="Delete" Text="Delete" ConfirmText="Are you sure you want to delete this record?"ButtonType="ImageButton" UniqueName="DeleteColumn"></telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>

When I click Edit, the RedirectEmailAddress does display and allows the user to change the value.  I just want to display an error message to the right of this value if it fails validation.  Something like: "Invalid Email Address".  Seems like this would be rather easy but I cannot find anything that does this.

Bob
Top achievements
Rank 1
 asked on 26 Aug 2017
0 answers
84 views
I have a RADGRID running but it will not do paging. I believe I have the settings.  The ASPX setting are below.
<section id="Grid" class="Grid-container">
    <telerik:RadGrid ID="RadGridInvestigations"
        runat="server"
        AllowPaging="True"
        PageSize="10"
        AllowSorting="True"
        AllowAutomaticInserts="True"
        OnNeedDataSource="RadGridInvestigation_NeedDataSource"
        OnItemCreated="RadGridInvestigation_ItemCreated"
        OnUpdateCommand="RadGridInvestigation_UpdateCommand"
        OnInsertCommand="RadGridInvestigation_InsertCommand"
        Font-Size="Large"
        GroupPanelPosition="Top"
        Width="1051px">
        <HeaderStyle CssClass="Myheader" />
        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
        <MasterTableView
            EditMode="PopUp"
            AutoGenerateColumns="False"
            DataKeyNames="CaseID,CaseName"
            GridLines="Horizontal"
            CommandItemDisplay="Top"
            NoMasterRecordsText="No Records have been entered in the application."
            ShowFooter="False">
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton"></telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="CaseID"
                    HeaderText="Case ID"
                    ReadOnly="true"
                    ForceExtractValue="Always"
                    ConvertEmptyStringToNull="true"
                    Display="false"
                    UniqueName="CaseID" />
                <%--<telerik:GridBoundColumn DataField="CaseNumber" HeaderText="CaseNumber" UniqueName="CaseNumber" ReadOnly="false" Display="false" />--%>
                <telerik:GridHyperLinkColumn FilterControlAltText="Filter CaseNumber column"
                    UniqueName="CaseNumber" DataNavigateUrlFormatString="~/Forms/InvWithTips2.aspx?CaseNumber={0}&CaseName={1}"
                    DataTextField="CaseNumber" HeaderText="Case Number"
                    DataNavigateUrlFields="CaseNumber,CaseName"
                    SortExpression="CaseNumber" HeaderStyle-Wrap="false">
                    <HeaderStyle Wrap="False"></HeaderStyle>
                </telerik:GridHyperLinkColumn>
                <telerik:GridBoundColumn DataField="CaseName" HeaderText="Name" SortExpression="CaseName"
                    UniqueName="CaseName" Display="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="InvestigativeUnit" HeaderText="Unit Assigned" SortExpression="InvestigativeUnit"
                    UniqueName="InvestigativeUnit" HeaderStyle-Wrap="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PrimaryContact" HeaderText="PrimaryContact" SortExpression="PrimaryContact"
                    UniqueName="PrimaryContact">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PrimaryContactEmail" HeaderText="PrimaryContactEmail" SortExpression="PrimaryContactEmail"
                    UniqueName="PrimaryContactEmail">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PrimaryContactPhone" HeaderText="Primary Phone" SortExpression="PrimaryContactPhone"
                    UniqueName="PrimaryContactPhone">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DateOpened" HeaderText="DateOpened" SortExpression="DateOpened"
                    UniqueName="DateOpened" DataFormatString="{0:dd/MM/yyyy}">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Status" HeaderText="Status" SortExpression="Status"
                    UniqueName="Status">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DateClosed" HeaderText="DateClosed" SortExpression="DateClosed"
                    UniqueName="DateClosed" DataFormatString="{0:dd/MM/yyyy}">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings UserControlName="InvestigationDetailsControl.ascx" EditFormType="WebUserControl">
                <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                <PopUpSettings Width="500px" />
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
</section>
<telerik:RadInputManager runat="server" ID="RadInputManager1" Enabled="true">
    <telerik:TextBoxSetting BehaviorID="TextBoxSetting1">
    </telerik:TextBoxSetting>
</telerik:RadInputManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
correct can someone take a look and let me know if you see the proble.
Perry
Top achievements
Rank 1
 asked on 25 Aug 2017
3 answers
502 views
Hi

I am using Rad editor Version Q1 2011.
I am using editor print functionality to print. Is there any way to add custom header and footer on each page.

Or i can manage if you can provide me any way to add custom header and footer in PDF export.

Please help me.

Regards
Atul Kumar Srivastav
Rumen
Telerik team
 answered on 25 Aug 2017
0 answers
135 views

Hello,

im wondering if it is possible to add a line with 'sep=;' to a csv export. Our code currently exports csv files with the semicolon delimiter however excel does not always recognize this as the delimiter and takes the comma instead. This produces some unwanted effects.

Is it possible to edit the generated excel after it is generated to add this information?

 

Thanks

Johan
Top achievements
Rank 1
 asked on 25 Aug 2017
0 answers
192 views

I Have a radgrid using batch edit mode, with insert & edit item templates.

Grid is populated using OnNeedDataSource.

I also have RadAjaxManager.

There are RequiredFieldValidators in place to prevent fields being left empty. This shows an asterix next to each field that fails validation.

ValidationSettings have been configured to set ValidationGroup.

However, I am unable to get validation summary to display the 'ErrorMessage' to the user if a field is left empty and 'save' button clicked.

I am using Telerik® UI for ASP.NET AJAX, v4.0.30319.

Below is a very simple example to demonstrate the issue.

Is there some configuration I have missed either in the grid or in RadAjaxManager?

Thanks

Jason

 

aspx

001.<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
002. 
003.<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
004. 
005.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
006. 
007.<html xmlns="http://www.w3.org/1999/xhtml">
008.<head runat="server">
009.    <title></title>
010.    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
011.</head>
012.<body>
013.    <form id="form1" runat="server">
014.    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
015.        <Scripts>
016.            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
017.            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
018.            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
019.        </Scripts>
020.    </telerik:RadScriptManager>
021. 
022.    <script type="text/javascript">
023.    </script>
024.     
025.        <p>
026.            Click on a cell/row to place it in edit mode.
027.        </p>
028.        <p>
029.            Edit TextData, leave blank > Save: Validation summary should appear?
030.        </p>
031. 
032.    <telerik:RadGrid ID="radGrid" runat="server" Width="100%" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" PageSize="12"
033.                        OnNeedDataSource="radGrid_NeedDataSource"
034.                        OnItemDataBound="radGrid_ItemDataBound"
035.                        OnPreRender="radGrid_PreRender"
036.                        OnBatchEditCommand="radGrid_BatchEditCommand"
037.                        OnItemCreated="radGrid_ItemCreated"
038.                        AllowAutomaticUpdates="True"
039.                        AllowAutomaticInserts="True"
040.                        ValidationSettings-EnableValidation="true">
041.        <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top" EditMode="Batch" AutoGenerateColumns="False">
042.            <BatchEditingSettings EditType="Row"/>
043.            <SortExpressions>
044.                <telerik:GridSortExpression FieldName="Id" SortOrder="Ascending"/>
045.            </SortExpressions>
046.            <Columns>
047.                <telerik:GridTemplateColumn UniqueName="Id" SortExpression="Id" HeaderText="ID">
048.                    <ItemTemplate>
049.                        <telerik:RadLabel runat="server" ID="Id" Text='<%# Eval("Id") %>'/>
050.                    </ItemTemplate>
051.                    <InsertItemTemplate>
052.                        <telerik:RadTextBox runat="server" ID="Id" Text='<%# Eval("Id") %>'/>
053.                        <asp:RequiredFieldValidator runat="server" ID="ValidateId" ControlToValidate="Id" EnableClientScript="True" ForeColor="Red" ErrorMessage="ID is required" Text="*" Display="Static"/>
054.                    </InsertItemTemplate>
055.                    <EditItemTemplate>
056.                        <telerik:RadLabel runat="server" ID="Id" Text='<%# Eval("Id") %>'/>
057.                    </EditItemTemplate>
058.                </telerik:GridTemplateColumn>
059. 
060.                <telerik:GridTemplateColumn UniqueName="TextData" SortExpression="TextData" HeaderText="Description">
061.                    <ItemTemplate>
062.                        <telerik:RadLabel runat="server" ID="TextData" Text='<%# Eval("TextData") %>'/>
063.                    </ItemTemplate>
064.                    <InsertItemTemplate>
065.                        <telerik:RadTextBox runat="server" ID="TextData" Text='<%# Eval("TextData") %>'/>
066.                        <asp:RequiredFieldValidator runat="server" ControlToValidate="TextData" EnableClientScript="True" ForeColor="Red" ErrorMessage="Text data is required" Text="*" Display="Static" ValidationGroup="RadGridValidation"/>
067.                    </InsertItemTemplate>
068.                    <EditItemTemplate>
069.                        <telerik:RadTextBox runat="server" ID="TextData" Text='<%# Eval("TextData") %>'/>
070.                        <asp:RequiredFieldValidator runat="server" ControlToValidate="TextData" EnableClientScript="True" ForeColor="Red" ErrorMessage="Text data is required" Text="*" Display="Static" ValidationGroup="RadGridValidation"/>
071.                    </EditItemTemplate>
072.                </telerik:GridTemplateColumn>
073. 
074.                <telerik:GridTemplateColumn UniqueName="NumericData" SortExpression="NumericData" HeaderText="Selling Rate">
075.                    <ItemTemplate>
076.                        <telerik:RadLabel runat="server" ID="NumericData" Text='<%# Eval("NumericData") %>'/>
077.                    </ItemTemplate>
078.                    <InsertItemTemplate>
079.                        <telerik:RadNumericTextBox runat="server" ID="NumericData" Type="Number" Value='<%# Eval("NumericData") %>' MinValue="0" > 
080.                            <NumberFormat AllowRounding="false" KeepNotRoundedValue="false" DecimalDigits="5"/>
081.                        </telerik:RadNumericTextBox>
082.                        <asp:RequiredFieldValidator runat="server" ControlToValidate="NumericData" EnableClientScript="True" ForeColor="Red" ErrorMessage="Numeric data is required" Text="*" Display="Static" ValidationGroup="RadGridValidation"/>
083.                    </InsertItemTemplate>
084.                    <EditItemTemplate>
085.                        <telerik:RadNumericTextBox runat="server" ID="NumericData" Type="Number" Value='<%# Eval("NumericData") %>' MinValue="0" > 
086.                            <NumberFormat AllowRounding="false" KeepNotRoundedValue="false" DecimalDigits="5"/>
087.                        </telerik:RadNumericTextBox>
088.                        <asp:RequiredFieldValidator runat="server" ControlToValidate="NumericData" EnableClientScript="True" ForeColor="Red" ErrorMessage="Numeric Data is required" Text="*" Display="Static" ValidationGroup="RadGridValidation"/>
089.                    </EditItemTemplate>
090.                </telerik:GridTemplateColumn>
091.            </Columns>
092.        </MasterTableView>
093.        <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
094. 
095.        <ValidationSettings EnableValidation="true" CommandsToValidate="PerformInsert,Update" ValidationGroup="RadGridValidation"></ValidationSettings>
096.        <ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
097.    </telerik:RadGrid>
098. 
099.    <%-- Validation Summary --%>
100.    <asp:ValidationSummary id="ValidationSummary" runat="server" ShowMessageBox="False" ShowSummary="True" DisplayMode="BulletList" HeaderText="Unable to commit changes:" ValidationGroup="RadGridValidation"/>
101. 
102.    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
103.        <AjaxSettings>
104.            <telerik:AjaxSetting AjaxControlID="radGrid">
105.                <UpdatedControls>
106.                    <telerik:AjaxUpdatedControl ControlID="radGrid" LoadingPanelID="RadAjaxLoadingPanel"/>
107.                </UpdatedControls>
108.            </telerik:AjaxSetting>
109. 
110.            <telerik:AjaxSetting AjaxControlID="ValidationSummary">
111.                <UpdatedControls>
112.                    <telerik:AjaxUpdatedControl ControlID="ValidationSummary" />
113.                </UpdatedControls>
114.            </telerik:AjaxSetting>
115. 
116.        </AjaxSettings>
117.    </telerik:RadAjaxManager>
118.    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server" Modal="True" InitialDelayTime="250"/>
119.    </form>
120.</body>
121.</html>

 

c#

using System;
using System.Data;
using Telerik.Web.UI;
using System.Collections;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void radGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        DataTable table = new System.Data.DataTable();
        table.Columns.Add("Id", typeof(int));
        table.Columns.Add("TextData", typeof(String));
        table.Columns.Add("NumericData", typeof(Double));
        table.Rows.Add(1, "A string", "10");
        table.Rows.Add(2, "A string", "20");
        table.Rows.Add(3, "A string", "30");
        table.Rows.Add(4, "A string", "40");
        table.Rows.Add(5, "A string", "50");
 
        radGrid.DataSource = table;
        radGrid.VirtualItemCount = table.Rows.Count;
    }
 
    protected void radGrid_PreRender(object sender, EventArgs e)
    {
 
    }
 
    protected void radGrid_ItemCreated(object sender, GridItemEventArgs e)
    {
 
    }
 
    protected void radGrid_ItemDataBound(object sender, GridItemEventArgs e)
    {
 
    }
 
    protected void radGrid_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
    {
        // update / insert commands from grid
        foreach (GridBatchEditingCommand command in e.Commands)
        {
            if ((command.Type == GridBatchEditingCommandType.Update))
            {
                Hashtable newValues = command.NewValues;
 
                String Id = newValues["Id"].ToString();
 
                // Update record
            }
 
            if ((command.Type == GridBatchEditingCommandType.Insert))
            {
                Hashtable newValues = command.NewValues;
 
                String Id = newValues["Id"].ToString();
 
                // Insert record
            }
        }
    }
}

 

 

Jason
Top achievements
Rank 1
 asked on 25 Aug 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?