Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
164 views
Hey everyone,

I am attempting to validate a number of fields within the "Add New Record" functionality while in "EditMode = Batch". Each GridBoundColumn has its own ColumnValidationSettings and RequiredFieldValidator. The validation message is displayed for two fields, but for four other fields no such message is displayed. Pressing "Save Changes" still requires all of the six fields to contain a value, regardless of whether a validation message is displayed or not. Furthermore, the validation messages are displayed one at a time. What is the best way to validate the field within my scenario? I want all required fields to show their validation message (if the fields are empty) once "Save Changes" is selected. I will include my current attempt that was based off a Batch Edit validation demo. I appreciate all the help I can get. Thanks!

GridBoundColumn w/ Validation (ASPX):
<telerik:GridBoundColumn DataField="Status_Field" UniqueName="Status_Field" HeaderText="Status"
    FilterControlWidth="83px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
    ShowFilterIcon="false">
    <ColumnValidationSettings EnableRequiredFieldValidation="true">
        <RequiredFieldValidator ErrorMessage="This field is required!" Display="Dynamic"
            ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
    </ColumnValidationSettings>
</telerik:GridBoundColumn>

Entire RadGrid (ASPX):
<telerik:RadGrid ID="RadGridActionItem" runat="server" AllowSorting="True" AllowPaging="true"
    AllowFilteringByColumn="True" OnNeedDataSource="RadGridActionItem_NeedDataSource"
    OnPageIndexChanged="RadGridActionItem_PageIndexChanged" OnItemCreated="RadGridAction_ItemCreated"
    OnDeleteCommand="RadGridActionItem_DeleteCommand" OnInsertCommand="RadGridActionItem_InsertCommand"
    OnBatchEditCommand="RadGrid1_BatchEditCommand" AllowAutomaticUpdates="True" AllowMultiRowEdit="True"
    OnItemDataBound="RadGridActionItem_ItemDataBound" Width="80%" HorizontalAlign="Center"
    PageSize="15" EnableViewState="true" Skin="Windows7">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView AutoGenerateColumns="false" ShowFooter="true" DataKeyNames="Action_Item_Id"
        ClientDataKeyNames="Action_Item_Id" CommandItemDisplay="Top" Width="100%" HorizontalAlign="Center"
        EditMode="Batch">
        <BatchEditingSettings OpenEditingEvent="None" EditType="Row" />
        <Columns>
            <telerik:GridNumericColumn DataField="Action_Item_Id" UniqueName="Action_Item_Id"
                HeaderText="Action Item ID" ForceExtractValue="Always" FilterControlWidth="75px"
                AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridNumericColumn>
            <telerik:GridNumericColumn DataField="Result_Id" UniqueName="Result_Id" HeaderText="Result ID"
                FilterControlWidth="65px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
            </telerik:GridNumericColumn>
            <telerik:GridBoundColumn DataField="Related_Result_Id" UniqueName="Related_Result_Id"
                HeaderText="Related Result ID" FilterControlWidth="75px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Status_Field" UniqueName="Status_Field" HeaderText="Status"
                FilterControlWidth="83px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                ShowFilterIcon="false">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ErrorMessage="This field is required!" Display="Dynamic"
                        ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Assigned_To" UniqueName="Assigned_To" HeaderText="Assigned To"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="Open_Date" UniqueName="Open_Date" HeaderText="Open Date"
                FilterControlWidth="80px" AutoPostBackOnFilter="true" PickerType="DatePicker"
                EnableTimeIndependentFiltering="true" ShowFilterIcon="true" DataFormatString="{0:M/d/yyyy}">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="Due_Date" UniqueName="Due_Date" HeaderText="Due Date"
                FilterControlWidth="80px" AutoPostBackOnFilter="true" PickerType="DatePicker"
                EnableTimeIndependentFiltering="true" ShowFilterIcon="true" DataFormatString="{0:M/d/yyyy}">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="Title" UniqueName="Title" HeaderText="Title"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ErrorMessage="This field is required!" Display="Dynamic"
                        ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Source" UniqueName="Source" HeaderText="Source"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ErrorMessage="Required!" Display="Dynamic" ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Employee_Id" UniqueName="Employee_Id" HeaderText="Employee ID"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ErrorMessage="Required!" Display="Dynamic" ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="User_System_Id" UniqueName="User_System_Id" HeaderText="User System ID"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ErrorMessage="Required!" Display="Dynamic" ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="System" UniqueName="System" HeaderText="System"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ErrorMessage="Required!" Display="Dynamic" ValidationGroup="NewRecordValidation"></RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Comparison_Type" UniqueName="Comparison_Type"
                HeaderText="Comparison Type" FilterControlWidth="80px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Actual_Access_Level" UniqueName="Actual_Access_Level"
                HeaderText="Actual Access Level" FilterControlWidth="90px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Auth_Access_Level" UniqueName="Auth_Access_Level"
                HeaderText=" Auth Access Level" FilterControlWidth="90px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Investigation_Results" UniqueName="Investigation_Results"
                HeaderText="Investigation Results" FilterControlWidth="150px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Historical_Authorization_Ticket" UniqueName="Historical_Authorization_Ticket"
                HeaderText="Historical Auth Ticket" FilterControlWidth="100px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Historical_Provisioning_Ticket" UniqueName="Historical_Provisioning_Ticket"
                HeaderText="Historical Prov Ticket" FilterControlWidth="100px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Resolution_Steps" UniqueName="Resolution_Steps"
                HeaderText="Resolution Steps" FilterControlWidth="150px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Resolution_Authorization_Ticket" UniqueName="Resolution_Authorization_Ticket"
                HeaderText="Resolution Auth Ticket" FilterControlWidth="100px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Resolution_Provisioning_Ticket" UniqueName="Resolution_Provisioning_Ticket"
                HeaderText="Resolution Prov Ticket" FilterControlWidth="100px" AutoPostBackOnFilter="true"
                CurrentFilterFunction="EqualTo" ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Batch_Name" UniqueName="Batch_Name" HeaderText="Batch Name"
                FilterControlWidth="70px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="QC_Review" UniqueName="QC_Review" HeaderText="QC/Review"
                DataType="System.Boolean" AllowFiltering="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Reviewed_By" UniqueName="Reviewed_By" HeaderText="Reviewed_By"
                FilterControlWidth="80px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                ShowFilterIcon="false">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="Review_Date" UniqueName="Review_Date" HeaderText="Review Date"
                FilterControlWidth="80px" AutoPostBackOnFilter="true" PickerType="DatePicker"
                EnableTimeIndependentFiltering="true" ShowFilterIcon="true" EmptyDataText=" "
                DataFormatString="{0:M/d/yyyy}">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="Resolved_Date" UniqueName="Resolved_Date"
                HeaderText="Resolved Date" FilterControlWidth="80px" AutoPostBackOnFilter="true"
                PickerType="DatePicker" EnableTimeIndependentFiltering="true" ShowFilterIcon="true"
                DataFormatString="{0:M/d/yyyy}">
            </telerik:GridDateTimeColumn>
            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton"
                ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this action item?" />
        </Columns>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="Action_Item_Id" SortOrder="Descending" />
        </SortExpressions>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnRowContextMenu="RowContextMenu" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2">
        </Scrolling>
        <Selecting AllowRowSelect="True"></Selecting>
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
</telerik:RadGrid>

I have also included an image of my error.

Thanks again,
Matt
Konstantin Dikov
Telerik team
 answered on 23 Aug 2014
4 answers
182 views
Hello,

I am using the Q3 2010 RadControls and I am wondering if it is possible to use the CrystalReportViewer (VS2008, Crystal 10) inside a panel that is 'Ajaxified'. I attempted to use the method prescribed in this code library example but the RequestStart method (when applied to the Ajax Manager) does not fire at all when the ReportViewer buttons are clicked, even though the loading panel appears (the event fires when other controls cause postbacks, however).

The print and export buttons therefore do nothing, and when I attempt to drill down on the report, the page throws a javascript error stating 'Object Expected'. None of these errors occur when the panel containing the viewer is not ajaxified.

Thanks in advance.
Josh
Josh
Top achievements
Rank 1
 answered on 22 Aug 2014
6 answers
223 views
Hi
I have been using radcontrols in my application.
I'm using the raddcoks in my application.
I have two dockzones and adding 3 docks per each zone.
I have requirement where I need  to set the zones height based on resolution(system) at clinetside through javascript.
I tried like Height="100%" but zones not considering the height with %.

<telerik:RadDockLayout runat="server" ID="RadDockLayout1"
                OnSaveDockLayout="RadDockLayout1_SaveDockLayout" EnableViewState="false">
                <div id="mainContainer" style="width: 100%; float:left; height:100%">
                    <div style="width:100%;">
                        <asp:Table ID="Table1" runat="server" Width="100%">
                        <asp:TableRow>
                        <asp:TableCell Width="50%" Height="95%">
                        <telerik:RadDockZone ID="RadDockZone1" runat="server" CssClass="zone" Height="540px" BorderColor="#d7d7d7">
                                    </telerik:RadDockZone>
                        </asp:TableCell>
                        <asp:TableCell  Width="50%" Height="95%">
                        <telerik:RadDockZone ID="RadDockZone2" runat="server" CssClass="zone" Height="540px"  BorderColor="#d7d7d7">
                                    </telerik:RadDockZone>
                        </asp:TableCell>
                        </asp:TableRow>
                        </asp:Table>
                    </div>
                       
                </div>
            </telerik:RadDockLayout>
Please help me as early as possible.
Slav
Telerik team
 answered on 22 Aug 2014
4 answers
295 views
Hi ,
i work on project that we should combine every image uploader with Image editor , so to do this requirement i create a custom application page with a telerik
image editor control and after image added event in image uploader i call this page as a pop up but the probleme there i dont know how can i set the image in the editor  using client side API. for the moment i get it empty.
i try to use setserverurl().

Best regards
Elliot
Top achievements
Rank 1
 answered on 22 Aug 2014
3 answers
398 views
Hi,

i´m using Telerik 2014.1.403.35 and my Datasource is a DataTable (MSSQL)

<telerik:RadGrid EnableLinqExpressions="true" OnItemDataBound="RadGrid_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand" ID="rgAbrechnungen" runat="server" GridLines="None" AutoGenerateColumns="False" Skin="Default" AllowSorting="true" AllowFilteringByColumn="true">

<telerik:GridTemplateColumn  UniqueName="zeichnungssumme" AutoPostBackOnFilter="true"  ShowFilterIcon="false" SortExpression="Zeichnungssumme" DataField="Zeichnungssumme"        HeaderText="Zeichnungssumme"      DataType="System.Decimal"  ItemStyle-HorizontalAlign="right" HeaderStyle-HorizontalAlign="right">
                    <ItemTemplate>
                       <%#Eval("Zeichnungssumme", "{0:#,0.00}")%> EUR
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

When i´m trying to filter for a decimal value (for example: 7143,05) and EnableLinqExpressions is true,
the filtering working correctly.
But if i set the EnableLinqExpressions to false, and enter my decimal value (7143,05) in my filterbox and push return, my page do a postback, but nothing more happens.
It should filter my Values and show me the one existing row with my entered value like with EnableLinqExpressions="true".

I need to set EnableLinqExpressions to false cause if i don´t, a lot of exceptions where thrown.
For example my datetime column:
If i don´t type the correct format (dd.mm.yyyy) my grid throws a exception with "no correct DateTime format".
Further, if i try to filter my System.decimal column and type something like "10.000,05", it throws an "Identifier expected" exception.

Thanks in advance

Marc Beckord
Eyup
Telerik team
 answered on 22 Aug 2014
18 answers
390 views
Hi,

Would you provide a sample for RadGrid Q1 2010 Export and Grouping together?
I tried to build a page with your drag-&-drop column header grouping, then export the grouped grid data to excel.

Thanks

daniel
Daniel
Telerik team
 answered on 22 Aug 2014
1 answer
86 views
Dear friends,

i had a issue of Report Viewer displaying blank page in IE10 and i solved using this code

Response.AppendHeader("X-UA-Compatible", "IE=edge");

in master page.

after using this code, i have issue of datepicker and time picker controls Cssclass have been changed badly.
if i remove this code,  telerik control looks fine. but report viewer showing blank page.

what to do to show telerik control to look good..
Marin Bratanov
Telerik team
 answered on 22 Aug 2014
6 answers
343 views
I'm getting the following error when trying to aggregate an AutoGenerated column: Column 'UnitPrice' does not belong to table. I've created a very simple app to reproduce the problem. I need to know if I'm coding things in the wrong places, or if this is a problem with the grid itself.

ASPX Page

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

 

<%

@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

head runat="server">

 

 

<title></title>

 

</

 

head>

 

<

 

body>

 

 

<form id="form1" runat="server">

 

 

<asp:ScriptManager ID="aspScript" runat="server">

 

 

</asp:ScriptManager>

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

 

 

SelectCommand="SELECT [ProductID], [ProductName], [SupplierID], [CategoryID], [UnitsInStock], [UnitPrice] FROM [Products]">

 

 

</asp:SqlDataSource>

 

 

<telerik:RadGrid ID="grdTemplate" runat="server" DataSourceID="SqlDataSource1"

 

 

AutoGenerateColumns="true" ShowGroupPanel="True" Skin="Office2007" Height="500" Width="100%"

 

 

OnColumnCreated="grdTemplate_ColumnCreated">

 

 

<ClientSettings AllowColumnsReorder="False" AllowDragToGroup="True">

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

 

<MasterTableView AutoGenerateColumns="true" TableLayout="Fixed" ShowFooter="true" ShowGroupFooter="true" />

 

 

</telerik:RadGrid>

 

 

</form>

 

</

 

body>

 

</

 

html>

Code Behind

 

using

 

System;

 

 

 

using

 

System.Collections.Generic;

 

 

 

using

 

System.Web;

 

 

 

using

 

System.Web.UI;

 

 

 

using

 

System.Web.UI.WebControls;

 

 

 

using

 

Telerik.Web.UI;

 

 

 

public

 

partial class _Default : System.Web.UI.Page

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

// Add the expression

 

 

 

 

grdTemplate.MasterTableView.GroupByExpressions.Add(

GridGroupByExpression.Parse("SupplierID Group By SupplierID"));

 

}

 

protected void grdTemplate_ColumnCreated(object sender, GridColumnCreatedEventArgs e)

 

{

 

// Determine the column type

 

 

 

 

 

if (e.Column is GridBoundColumn && e.Column.UniqueName == "UnitPrice")

 

{

 

// Set the column aggreagate

 

 

 

 

(e.Column

as GridBoundColumn).Aggregate = GridAggregateFunction.Sum;

 

}

}

}

Kostadin
Telerik team
 answered on 22 Aug 2014
3 answers
109 views
Hi,
I need to create a RadPivotGrid dynamically and export it.
I have an export scheduler that run in background and has to generate an excel of a PivotGrid an send it by email.
I have to do this within a Web Service but I don't know if it is possible.

Any suggestion?

Thanks a lot!
Kostadin
Telerik team
 answered on 22 Aug 2014
2 answers
200 views
Hello guys,

I am using the RadGrid component in order to display my data: ideally I would like to sort the item by the field "EventID" and I've used the following code in order to achieve that:

<SortExpressions>
        <telerik:GridSortExpression FieldName="EventID" SortOrder="Descending" />
 </SortExpressions>

Which works just fine.

In my scenario I am editing one of the grid item in a modal window and, when the item is submitted,  I want to refresh the parent page who contains the grid.  

In order to do that I am using the following code:

RadAjaxManager manager = RadAjaxManager.GetCurrent(this.Page);
manager.ResponseScripts.Add("CloseWindowReload('" + gridReloadCommand + "','" + ((itemID == null) ? "-1" : itemID.ToString()) + "');");

Which does refresh the parent page and the grid correctly, but the latter is not sorted by descending anymore . 

Do you have any advice for me?

Regards
Gavin


Gavin Pollock
Top achievements
Rank 1
 answered on 22 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?