Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
105 views
i followed the link 
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/automatic-datasource-operations to created RadGrid control. i would like to add hyperlink to all the columns so that it will open up a page or a small popup with the row.
I have managed the popup with RadWindowManager. Now the only thing left out is adding hyperlink to the cells of a databound Grid.
 the below code does not work for me please help


protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        HyperLink link = new HyperLink();
        link.Attributes["href"] = "javascript:void(0);";
        link.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);
        //link.NavigateUrl = "Page.aspx";//for navigating to new page
        //link.CssClass = "class1";//for showing underline in hyperlink
        link.Text = item.GetDataKeyValue("ID").ToString();
        item["ID"].Controls.Add(link);
    }
}
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{


    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        HyperLink link = new HyperLink();
        link.Attributes["href"] = "javascript:void(0);";
        link.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);
        item["ID"].Controls.Add(link);
    }


}

please see the code 
Aspx of Default

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

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head id="Head1" runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
      <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
      <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
        <script type="text/javascript">
            function ShowEditForm(id, rowIndex) {
                var grid = $find("<%= RadGrid1.ClientID %>");

                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);

                window.radopen("EditForm_csharp.aspx?ID=" + id, "UserListDialog");
                return false;
            }
//            function ShowInsertForm() {
//                window.radopen("EditForm_csharp.aspx");
//                return false;
//            }
            function refreshGrid(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
                else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
            }
            function RowDblClick(sender, eventArgs) {
                window.radopen("EditForm_csharp.aspx?EmployeeID=" + eventArgs.getDataKeyValue("EmployeeID"), "UserListDialog");
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadFormDecorator runat="server" DecorationZoneID="demo" EnableRoundedCorners="false"DecoratedControls="All" />
    <div id="demo" class="demo-container no-bg">
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource2"
            AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
            AllowAutomaticDeletes="True" OnItemCreated="RadGrid1_ItemCreated"
            OnItemInserted="RadGrid1_ItemInserted" OnPreRender="RadGrid1_PreRender"
            OnInsertCommand="RadGrid1_InsertCommand" GroupPanelPosition="Top"
            ResolvedRenderMode="Classic"
            EnableViewState="False" ShowGroupPanel="True" AllowMultiRowEdit="True"
            AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <ClientSettings AllowDragToGroup="True">
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
            <MasterTableView DataSourceID="SqlDataSource2"
            AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="ID" >
                <Columns>

                    <telerik:GridBoundColumn DataField="Self_development"
                        HeaderText="Self_development" SortExpression="Self_development"
                        UniqueName="Self_development"
                        FilterControlAltText="Filter Self_development column" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Technical_Development"
                        HeaderText="Technical_Development" SortExpression="Technical_Development"
                        UniqueName="Technical_Development"
                        FilterControlAltText="Filter Technical_Development column" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Project_Management"
                        HeaderText="Project_Management" SortExpression="Project_Management"
                        UniqueName="Project_Management"
                        FilterControlAltText="Filter Project_Management column" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Safety"
                        HeaderText="Safety" SortExpression="Safety"
                        UniqueName="Safety"
                        FilterControlAltText="Filter Safety column" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Client_Relationship"
                        HeaderText="Client_Relationship" SortExpression="Client_Relationship"
                        UniqueName="Client_Relationship" FilterControlAltText="Filter Client_Relationship column"
                        >
                    </telerik:GridBoundColumn>
                    <%--<telerik:GridHyperLinkColumn DataTextFormatString="Search Google for '{0}'"DataNavigateUrlFields="Client_Relationship"
                    UniqueName="Client_Relationship"DataNavigateUrlFormatString="http://www.google.com/search?hl=en&;q={0}&btnG=Google+Search"
                    DataTextField="Client_Relationship">
                    </telerik:GridHyperLinkColumn>--%>
                <telerik:GridBoundColumn DataField="Leadership_Development"
                        FilterControlAltText="Filter Leadership_Development column"
                        HeaderText="Leadership_Development"
                        SortExpression="Leadership_Development"UniqueName="Leadership_Development"></telerik:GridBoundColumn><telerik:GridBoundColumn
                        DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column"
                        HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID"></telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                    <ItemTemplate>
                        <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                        </Columns>
                    <%--     <CommandItemTemplate>
                <a href="#" onclick="return ShowInsertForm();">Add New Record</a>
            </CommandItemTemplate>--%>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
<EditColumn ButtonType="ImageButton"></EditColumn>
                </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    <%--<asp:EntityDataSource ID="EntityDataSourceCustomers" runat="server"ConnectionString="name=NorthwindReadWriteEntities"
        DefaultContainerName="NorthwindReadWriteEntities" EntitySetName="Customers" OrderBy="it.[ContactName]"
        EntityTypeFilter="Customer" EnableDelete="True" EnableFlattening="False" EnableInsert="True"EnableUpdate="True">
    </asp:EntityDataSource>--%>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server"
        ConnectionString="name=LMSDBEntities3" DefaultContainerName="LMSDBEntities3"
        EntitySetName="Course_mainPage"
        OrderBy="it.[Self_development]"


        EnableDelete="True" EnableInsert="True" EnableUpdate="True" >
    </asp:EntityDataSource>



 <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:LMSDBConnectionString %>"
   SelectCommand="SELECT [Self_development] ,[Technical_Development] ,[Project_Management] ,[Safety] ,[Client_Relationship] ,[Leadership_Development] ,[ID] FROM [LMSDB].[dbo].[Course_mainPage]"
   DeleteCommand="DELETE FROM Course_mainPage WHERE (ID = @ID)"
   InsertCommand="INSERT INTO Course_mainPage(Self_development, Technical_Development, Project_Management, Safety, Client_Relationship, Leadership_Development) VALUES (@Self_development,@Technical_Development,@Project_Management,@Safety,@Client_Relationship,@Leadership_Development)"



        UpdateCommand="UPDATE Course_mainPage SET Self_development = @Self_development, Technical_Development = @Technical_Development, Project_Management = @Project_Management, Safety = @Safety, Client_Relationship = @Client_Relationship, Leadership_Development = @Leadership_Development WHERE (ID = @ID)">
   <DeleteParameters>
       <asp:Parameter Name="ID" Type="Int32" />
   </DeleteParameters>
    <InsertParameters>
       <asp:Parameter Name="Self_development" />
       <asp:Parameter Name="Technical_Development" />
       <asp:Parameter Name="Project_Management" />
       <asp:Parameter Name="Safety" />
       <asp:Parameter Name="Client_Relationship" />
       <asp:Parameter Name="Leadership_Development" />
   </InsertParameters>

    <UpdateParameters>
      <asp:Parameter Name="Self_development" />
       <asp:Parameter Name="Technical_Development" />
       <asp:Parameter Name="Project_Management" />
       <asp:Parameter Name="Safety" />
       <asp:Parameter Name="Client_Relationship" />
       <asp:Parameter Name="Leadership_Development" />
        <asp:Parameter Name="ID" />
    </UpdateParameters>
 </asp:SqlDataSource>


   <%--
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LMSDBConnectionString %>"
   SelectCommand="SELECT [Self_development] ,[Technical_Development] ,[Project_Management] ,[Safety] ,[Client_Relationship] ,[Leadership_Development] ,[ID] FROM [LMSDB].[dbo].[Course_mainPage]"
   DeleteCommand="DELETE FROM Course_mainPage WHERE (ID = @ID)"
   InsertCommand="INSERT INTO Course_mainPage(Self_development, Technical_Development, Project_Management, Safety, Client_Relationship, Leadership_Development) VALUES (@Self_development,@Technical_Development,@Project_Management,@Safety,@Client_Relationship,@Leadership_Development)"

        UpdateCommand="UPDATE Course_mainPage SET Self_development =@Self_development, Technical_Development =@Technical_Development, Project_Management =@Project_Management, Safety =@Safety, Client_Relationship =@Client_Relationship, Leadership_Development =@Leadership_Development where [ID] = @ID">
   <DeleteParameters>
       <asp:Parameter Name="ID" Type="Int32" />
   </DeleteParameters>
    <InsertParameters>
       <asp:Parameter Name="@Self_development" Type="String" />
       <asp:Parameter Name="@Technical_Development" Type="String" />
       <asp:Parameter Name="@Project_Management" Type="String" />
       <asp:Parameter Name="@Safety" Type="String" />
       <asp:Parameter Name="@Client_Relationship" Type="String" />
       <asp:Parameter Name="@Leadership_Development" Type="String" />
   </InsertParameters>

    <UpdateParameters>
      <asp:Parameter Name="@Self_development" Type="String" />
       <asp:Parameter Name="@Technical_Development" Type="String" />
       <asp:Parameter Name="@Project_Management" Type="String" />
       <asp:Parameter Name="@Safety" Type="String" />
       <asp:Parameter Name="@Client_Relationship" Type="String" />
       <asp:Parameter Name="@Leadership_Development" Type="String" />
       <asp:Parameter Name="@ID" Type="Int32" />
    </UpdateParameters>
 </asp:SqlDataSource>
  --%>

   <%-- Select="it.[Self_development], it.[Technical_Development], it.[Project_Management], it.[Client_Relationship], it.[Safety], it.[Leadership_Development], it.[ID]" --%>
    </form>
</body>
</html>

C# of default


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Telerik.Web.UI;
using System.Collections;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    //protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    //{
    //    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    //    {
    //        if (!(e.Item is GridEditFormInsertItem))
    //        {
    //            GridEditableItem item = e.Item as GridEditableItem;
    //            GridEditManager manager = item.EditManager;
    //            GridTextBoxColumnEditor editor = manager.GetColumnEditor("ID") as GridTextBoxColumnEditor;
    //            editor.TextBoxControl.Enabled = false;
    //        }
    //    }     
    //}
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        //if (e.Item is GridDataItem)
        //{
        //    HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
        //editLink.Attributes["href"] = "javascript:void(0);";
        //editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);
        //}



        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            HyperLink link = new HyperLink();
            link.Attributes["href"] = "javascript:void(0);";
            link.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);
            //link.NavigateUrl = "Page.aspx";//for navigating to new page
            //link.CssClass = "class1";//for showing underline in hyperlink
            link.Text = item.GetDataKeyValue("ID").ToString();
            item["ID"].Controls.Add(link);
        }
    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {


        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            HyperLink link = new HyperLink();
            link.NavigateUrl = "Page.aspx";//for navigating to new page
            link.CssClass = "class1";//for showing underline in hyperlink
            link.Text = item.GetDataKeyValue("ID").ToString();
            item["ID"].Controls.Add(link);
        }


    }
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.Rebind();
        }
        else if (e.Argument == "RebindAndNavigate")
        {
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            RadGrid1.Rebind();
        }
    }

    protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
    {
        if (e.Exception != null)
        {

            e.ExceptionHandled = true;
            SetMessage("Record cannot be inserted. Reason: " + e.Exception.Message);

        }
        else
        {
            SetMessage("New Record is inserted!");
        }
    }
    private void DisplayMessage(string text)
    {
        RadGrid1.Controls.Add(new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));
    }

    private void SetMessage(string message)
    {
        gridMessage = message;
    }

    private string gridMessage = null;

    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(gridMessage))
        {
            DisplayMessage(gridMessage);
        }
    }

    protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
    {
        if (e.Item is GridEditableItem)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            //here editedItem.SavedOldValues will be the dictionary which holds the
            //predefined values
            //Prepare new dictionary object
            Hashtable newValues = new Hashtable();
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
            //the newValues instance is the new collection of key -> value pairs
            //with the updated ny the user data
        }
    }
}
aspx of Editform_csharp.

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

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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 id="Head1" runat="server">
    <title>Edit dialog</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <script type="text/javascript">
            function CloseAndRebind(args) {
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
            }

            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

                return oWindow;
            }

            function CancelEdit() {
                GetRadWindow().close();
            }
        </script>
        <asp:ScriptManager ID="ScriptManager2" runat="server" />
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Vista" DecoratedControls="All"/>
        <br />
        <br />
        <asp:DetailsView ID="DetailsView1" DataKeyNames="ID" runat="server" AutoGenerateRows="False"
            DataSourceID="SqlDataSource2" Height="50px" Width="125px"OnItemCommand="DetailsView1_ItemCommand"
            BorderWidth="0px" CellPadding="0" CellSpacing="7" GridLines="None"
            OnItemUpdating="DetailsView1_ItemUpdating"
            onpageindexchanging="DetailsView1_PageIndexChanging" AllowPaging="True"
            EnableModelValidation="True">
            <Fields>
                <asp:BoundField DataField="Self_development" HeaderText="Self_development"SortExpression="Self_development" />
                <asp:BoundField DataField="Technical_Development" HeaderText="Technical_Development"SortExpression="Technical_Development" />
                <asp:BoundField DataField="Project_Management" HeaderText="Project_Management"SortExpression="Project_Management" />
<asp:BoundField DataField="Safety" HeaderText="Safety" SortExpression="Safety"></asp:BoundField>
                <asp:BoundField DataField="Client_Relationship"
                    HeaderText="Client_Relationship" SortExpression="Client_Relationship" />
                <asp:BoundField DataField="Leadership_Development"
                    HeaderText="Leadership_Development" SortExpression="Leadership_Development" />
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID"
                    InsertVisible="False" ReadOnly="True" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
                    ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>


       <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:LMSDBConnectionString %>"
       SelectCommand="SELECT [Self_development] ,[Technical_Development] ,[Project_Management] ,[Safety] ,[Client_Relationship] ,[Leadership_Development] ,[ID] FROM [LMSDB].[dbo].[Course_mainPage]"
       DeleteCommand="DELETE FROM Course_mainPage WHERE (ID = @ID)"
       InsertCommand="INSERT INTO Course_mainPage(Self_development, Technical_Development, Project_Management, Safety, Client_Relationship, Leadership_Development) VALUES (@Self_development,@Technical_Development,@Project_Management,@Safety,@Client_Relationship,@Leadership_Development)"



       UpdateCommand="UPDATE Course_mainPage SET Self_development = @Self_development, Technical_Development = @Technical_Development, Project_Management = @Project_Management, Safety = @Safety, Client_Relationship = @Client_Relationship, Leadership_Development = @Leadership_Development WHERE (ID = @ID)">
       <DeleteParameters>
       <asp:Parameter Name="ID" Type="Int32" />
       </DeleteParameters>
       <InsertParameters>
           <asp:Parameter Name="Self_development" />
           <asp:Parameter Name="Technical_Development" />
           <asp:Parameter Name="Project_Management" />
           <asp:Parameter Name="Safety" />
           <asp:Parameter Name="Client_Relationship" />
           <asp:Parameter Name="Leadership_Development" />
       </InsertParameters>

        <UpdateParameters>
          <asp:Parameter Name="Self_development" />
           <asp:Parameter Name="Technical_Development" />
           <asp:Parameter Name="Project_Management" />
           <asp:Parameter Name="Safety" />
           <asp:Parameter Name="Client_Relationship" />
           <asp:Parameter Name="Leadership_Development" />
            <asp:Parameter Name="ID" />
        </UpdateParameters>
     </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>

C# of Editform_csharp.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Editform_csharp : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (Request.QueryString["ID"] == null)
        {
            DetailsView1.DefaultMode = DetailsViewMode.Insert;
        }
        else
        {
            DetailsView1.DefaultMode = DetailsViewMode.Edit;
        }
        this.Page.Title = "ID";
    }

    protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        if (e.CommandName == "Update")
        {
            ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);
        }
        else if (e.CommandName == "Insert")
        {
            ClientScript.RegisterStartupScript(Page.GetType(), "mykey","CloseAndRebind('navigateToInserted');", true);
        }
        else
        {
            ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CancelEdit();", true);
        }
    }

    protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        //logic to truncate long string to prevent SQL error
        for (int i = 1; i < 4; i++)
        {
            string val = e.NewValues[i - 1].ToString();
            int maxLength = i * 10;
            if (val.Length > maxLength) e.NewValues[i - 1] = val.Substring(0, maxLength);
        }
    }

    protected void DetailsView1_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
    {

    }
}
Eyup
Telerik team
 answered on 24 Jul 2015
1 answer
116 views

Hi Team,

Can we display dynamic fields in the UI layout? Can you help us how to achieve it.

Like initially I have 3 field naming First Name, Last Name, Mobile Number to enter, I would like to inset another  filed i.e Email Id. Can it be done? How to achieve it.

 

Thanks,

M Harika.

Eyup
Telerik team
 answered on 24 Jul 2015
6 answers
713 views
hi,

I have raddropdowntree , it works well ,
it has a checkbox  to check all nodes ,

what i  want is to know if this checkbox is checked or not (if all nodes are checked) from itemCommand event from server side ..

how to achieve that ,
HoHo
Top achievements
Rank 1
 answered on 23 Jul 2015
1 answer
92 views

I am able to put grid into edit mode by using one of the following code snippets. However, i need to edit only some of columns and leave others non editable.

How can i achieve that?

 Thank you

 

For Each item As GridItem In grdContingentDevelopment.MasterTableView.Items
            If item.GetType().ToString() = "Telerik.Web.UI.GridDataItem" Then
                Dim editableItem As GridEditableItem = DirectCast(item, GridDataItem)
                editableItem.Edit = True
            End If
 Next

 

  For i As Integer = 0 To grdContingentDevelopment.PageSize - 1
                grdContingentDevelopment.EditIndexes.Add(i)
  Next

Pavlina
Telerik team
 answered on 23 Jul 2015
1 answer
41 views

Hello,

Does Searchbox search thru pdfs, Microsoft office document, images names?

 

Jess

Ivan Danchev
Telerik team
 answered on 23 Jul 2015
3 answers
103 views

Why does the GridDropDownColumn display larger than the count of items?


Check the RadComboBox Columns example.  You see 5 records in the combo, but the combo drop down extends another 4 or 5 records further of empty white space.

How do I fix this?
Pavlina
Telerik team
 answered on 23 Jul 2015
8 answers
146 views
Follow up to other post
Drag and drop wont' work on one of two web applications using same page

Turns out that the AsyncFileUpload Drag and Drop feature does not work in the first browser the page opens in but it does work in each subsequent browser.  It doesn't matter whether Firefox, Internet Explorer, or Chrome is opened first, the control does not work as expected, however when you copy and past the url to the webform in the other two browsers the AsyncFileUpload Control works as expected.

See attached images which show that all three browsers are running the exact same page!!
It doesn't matter which browser you choose to run the application in first; IE10, Chrome, or Firefox the AsyncFileUpload Control Drag and Drop feature does not work.  Another odd behavior is that the file select control does not show any mapped network drives to choose files from.  You can choose files from the Network neighborhood but the mapped drives do not show-up.

The second and third browsers (doesn't matter which you choose, IE, Chrome, or Firefox) the control works as expected. I'm using the ASP.NET development server rather than IIS.  This is on the .NET 4.0 framework.  Again, here are the relevant webconfig, markup, and code-behind files.

Any help is much appreciated. Mark-up of aspx page.
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="RadUpload.aspx.vb" Inherits="AgencyHome.UI.RadUpload" %>
<%@ 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">
 
<head runat="server">
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
    <link href="/App_Themes/Upload/AsyncUpload.Metro.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <table style="font-family: Arial, Helvetica, sans-serif;" cellpadding="10">
            <tr>
                <td>
                    <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" AllowedFileExtensions="jpg,png,pdf,xls,xlsx,doc,docx" DropZones="#DropZone1,#DropZone2" >
                        <FileFilters>
                            <telerik:FileFilter Description="Documents" Extensions="pdf,xls,xlsx,doc,docx,jpg,png" />
                        </FileFilters>
                    </telerik:RadAsyncUpload>
                </td>
                <td>
                    <div id="DropZone1">
                        <p>Send to ASUREA</p>
                        <p>Drop Applications Here</p>
                    </div>
                </td>
                <td>
                <asp:Panel ID="DropZone2" runat="server">
                    <p>Using Panel</p>
                    <p>Drop Files Here</p>
                </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                     <asp:Button ID="uploadButton" runat="server" Text="Upload" />
                </td>
            </tr>
        </table>
    </div>
    </form>
    <script type="text/javascript">
    //<![CDATA[
        var $ = $telerik.$;
        function pageLoad() {
            if (!Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable()) {
                $(".qsf-demo-canvas").html("<strong>Your browser does not support Drag and Drop. Please take a look at the info box for additional information.</strong>");
            }
            else {
                $(document).bind({ "drop": function (e) { e.stopPropagation(); e.preventDefault(); } });
                var dropZone1 = $(document).find("#DropZone1");
                dropZone1.bind({ "dragenter": function (e) { dragEnterHandler(e, dropZone1); } })
                                    .bind({ "dragleave": function (e) { dragLeaveHandler(e, dropZone1); } })
                                    .bind({ "drop": function (e) { dropHandler(e, dropZone1); } });
                var dropZone2 = $(document).find("#DropZone2");
                dropZone2.bind({ "dragenter": function (e) { dragEnterHandler(e, dropZone2); } })
                                    .bind({ "dragleave": function (e) { dragLeaveHandler(e, dropZone2); } })
                                    .bind({ "drop": function (e) { dropHandler(e, dropZone2); } });
            }
        }
 
        function dropHandler(e, dropZone) {
            dropZone[0].style.backgroundColor = "#357A2B";
        }
 
        function dragEnterHandler(e, dropZone) {
            var dt = e.originalEvent.dataTransfer;
            var isFile = (dt.types !== null && (dt.types.indexOf ? dt.types.indexOf('Files') != -1 : dt.types.contains('application/x-moz-file')));
            if (isFile || $telerik.isSafari5 || $telerik.isIE10Mode || $telerik.isOpera)
                dropZone[0].style.backgroundColor = "#000000";
        }
 
        function dragLeaveHandler(e, dropZone) {
            if (!$telerik.isMouseOverElement(dropZone[0], e.originalEvent))
                dropZone[0].style.backgroundColor = "#357A2B";
        }
    //]]>
    </script>
</body>
</html>
#Region "Imports statements"
 
Option Strict On
Imports System
Imports System.Data
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
 
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports BaseClasses
Imports BaseClasses.Utils
Imports BaseClasses.Utils.StringUtils
Imports BaseClasses.Data
Imports BaseClasses.Data.SqlProvider
Imports BaseClasses.Data.OrderByItem.OrderDir
Imports BaseClasses.Data.BaseFilter
Imports BaseClasses.Data.BaseFilter.ComparisonOperator
Imports BaseClasses.Web.UI.WebControls
 
Imports AgencyHome.Business
Imports AgencyHome.Data
Imports Telerik
Imports Telerik.Web.UI
 
#End Region
Namespace AgencyHome.UI
 
 
    Public Class RadUpload
        Inherits System.Web.UI.Page
        '        Public WithEvents RadAsyncUpload1 As Telerik.Web.UI.RadAsyncUpload
        '        Public WithEvents uploadButton As System.Web.UI.WebControls.Button
 
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        End Sub
 
        Protected Sub uploadButton_Click(sender As Object, e As EventArgs) Handles uploadButton.Click
            'If RadAsyncUpload1.UploadedFiles.Count > 0 Then
            'System.Threading.Thread.Sleep(3000)
            'End If
        End Sub
 
        Protected Sub RadAsyncUpload1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded
            MsgBox("File Uploaded and named " + e.File.FileName + " Also known as " + e.File.GetName() + " And is this long " + e.File.ContentLength.ToString)
        End Sub
 
        Protected Sub RadAsyncUpload1_PreRender(sender As Object, e As EventArgs) Handles RadAsyncUpload1.PreRender
            Me.RadAsyncUpload1.AllowedFileExtensions = "jpg,png,pdf,xls,xlsx,doc,docx,tif,tiff,xps".Split(CChar(","))
            Me.RadAsyncUpload1.MaxFileSize = 20971520
            Me.RadAsyncUpload1.InputSize = 50
            Me.RadAsyncUpload1.EnableEmbeddedSkins = False
            Me.RadAsyncUpload1.Skin = ""
            Me.RadAsyncUpload1.HideFileInput = True
            Me.RadAsyncUpload1.MultipleFileSelection = AsyncUpload.MultipleFileSelection.Automatic
            Me.RadAsyncUpload1.TargetFolder = "~/Documents/Permanent"
            Me.RadAsyncUpload1.TemporaryFolder = "~/Documents/Temp"
        End Sub
    End Class
 
End Namespace

WEB.CONFIG
<?xml version="1.0"?>
<!--  EDITING THIS FILE
 
      You should edit the copy of this Web.config file in the [application name] directory.
 
-->
<configuration>
  <configSections>
    <section name="DataAccessLayerWhereClause" type="BaseClasses" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
  <connectionStrings>
    <add name="DatabaseAgentCenter" connectionString="Data Source=IWI01AS14;Database=AgentCenter;Trusted_Connection=yes;User Id=INSWHL\AgencyWorksDW;Password=p@ssw0rd"
      providerName="System.Data.SqlClient" />
    <add name="DatabaseASUREALeads" connectionString="Data Source=CORELLIA;Database=ASUREALeads;Trusted_Connection=yes;User Id=INSWHL\mhansen;Password=winter9529"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.net>
    <mailSettings>
      <smtp from="mhansen@asurea.com">
        <network host="ASUREAEX01" port="25" userName="mhansen" password="winter9529" defaultCredentials="false" />
      </smtp>
    </mailSettings>
  </system.net>
  <appSettings>
    <!--  EVENT LOGGING
          Set LogEvents value="false" to disable all logging to the system event log.
           
          DATABASE COMMAND LOGGING
          Set LogDatabaseCommands value="true" to log all database SQL commands to the
          system the event log. Only works if LogEvents = "true".
          
          DATABASE ERROR LOGGING
          Set LogDatabaseExceptions value="all" to log all database exceptions to the
          system the event log.  Set to "default" to only log exceptions that are unlikely
          to be caused by normal user interaction.  Only works if LogEvents = "true"
 
          Set LogCommitExceptions value="all" to log all database transaction commit exceptions
          to the system the event log.  Set to "default" to only log exceptions that are unlikely
          to be caused by normal user interaction.  Only works if LogEvents = "true".
     
          TRACE LOGGING OUTPUT
          To get detailed page-level tracing, set the following to "true":
              TraceDatabaseCommands, TraceDataAccessMethods, TraceTransactionCache
          Also set trace enabled="true" and pageOutput="true" in the
          APPLICATION-LEVEL TRACE LOGGING section below.
    -->
    <!-- VIEWSTATE LOCATION
       The ViewStateLocation specifies where the view state for a page
       should be stored. 
       1. Page (default): Stored it in the page.  Increases page size.
          Always works, but slower to encrypt, decrypt and send.
       2. Session: Store it in the session on the server.
          Results in better performance, but may not always work because
          session data may be timed out, or flushed to make room for more.
       3. Cache: Stored in the cache.  Similar to Session, but has more
          timeout options.
       4. File: Stored in a temporary file.  Will always work, but slower.
       5. Database: Stored in the database.  Will always work, but slower.
       See online help for more information.
    -->
    <add key="LogEvents" value="false" />
    <add key="SPHost" value="http://spdev2010:3333/AppProc/" />
    <add key="NewBusList" value="Submission Documents" />
    <add key="SPNewBusListEmail" value="newbizsp@ASUREASPCORE01.inswhl.com" />
    <add key="LogDatabaseCommands" value="false" />
    <add key="LogDatabaseExceptions" value="default" />
    <add key="LogCommitExceptions" value="default" />
    <add key="TraceDatabaseCommands" value="false" />
    <add key="TraceDataAccessMethods" value="false" />
    <add key="TraceTransactionCache" value="false" />
    <add key="WebServer" value="http://localhost" />
    <add key="ApplicationName" value="AgencyHome" />
    <add key="FCKeditor:BasePath" value="~/FCKeditor/" />
    <add key="AuthenticationType" value="None" />
    <add key="RoleManagement" value="None" />
    <add key="CookieEncryptionKey" value="{DE98517F-CC5F-4E78-BD61-A477E237B740}" />
    <add key="URLEncryptionKey" value="{DE98517F-CC5F-4E78-BD61-A477E237B740}" />
    <add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=../Temp/;" />
    <add key="GoogleSignature" value="" />
    <add key="SecurityDisabled" value="False" />
    <add key="GoogleKey" value="" />
    <add key="GoogleClientID" value="" />
    <add key="DefaultDistanceUnit" value="miles" />
    <add key="DefaultLatitude" value="37.0902400" />
    <add key="DefaultLongitude" value="-95.7128910" />
    <add key="MobileUserAgents" value="android|iphone|ipod|iemobile|windows ce|windows mobile|windows phone os|blackberry|palm|skyfire|symbian|symbos" />
    <add key="aspnet:MaxHttpCollectionKeys" value="2000" />
    <add key="aspnet:MaxJsonDeserializerMembers" value="2000" />
    <add key="ViewStateLocation" value="Session" />
    <add key="MobileDefaultPageUrl" value="" />
    <add key="DefaultPageUrl" value="SUBMITBUS/Show-SUBMITBUS-Table.aspx" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" optimizeCompilations="true" tempDirectory="A:\ASP_NET_TempFiles\">
      <assemblies>
        <add assembly="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
 <!--       <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> -->
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
      <buildProviders>
        <remove extension=".lic" />
        <add extension=".lic" type="System.Web.Compilation.ForceCopyBuildProvider" />
      </buildProviders>
    </compilation>
    <roleManager enabled="false" cacheRolesInCookie="false" defaultProvider="AspNetSqlRoleProvider" />
    <siteMap defaultProvider="MenuElementsProvider">
      <providers>
        <add siteMapFile="~/Menu Panels/Menu.sitemap" securityTrimmingEnabled="true" name="MenuElementsProvider" type="AgencyHome.UI.MenuXmlSiteMapProvider" />
        <add siteMapFile="~/Menu Panels/MenuMobile.sitemap" securityTrimmingEnabled="true" name="MenuMobileElementsProvider" type="AgencyHome.UI.MenuXmlSiteMapProvider" />
      </providers>
    </siteMap>
    <httpHandlers>
<!--      <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" /> -->
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />     
      <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
    </httpModules>   
    <!-- ASMX is mapped to a new handler so that proxy JavaScripts can also be served. -->
    <pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" theme="Zinfandel">
      <namespaces>
        <clear />
        <add namespace="AgencyHome" />
        <add namespace="AgencyHome.UI" />
        <add namespace="AgencyHome.UI.Controls" />
        <add namespace="AgencyHome.Data" />
        <add namespace="AgencyHome.Business" />
        <add namespace="System" />
        <add namespace="System.Collections" />
        <add namespace="System.Collections.Specialized" />
        <add namespace="System.Configuration" />
        <add namespace="System.Text" />
        <add namespace="System.Text.RegularExpressions" />
        <add namespace="System.Web" />
        <add namespace="System.Web.Caching" />
        <add namespace="System.Web.SessionState" />
        <add namespace="System.Web.Security" />
        <add namespace="System.Web.Profile" />
        <add namespace="System.Web.UI" />
        <add namespace="System.Web.UI.WebControls" />
        <add namespace="System.Web.UI.WebControls.WebParts" />
        <add namespace="System.Web.UI.HtmlControls" />
        <add namespace="BaseClasses" />
        <add namespace="BaseClasses.Web.UI.WebControls" />
      </namespaces>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
    </pages>
    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
          Add <error> tags for each of the errors you want to handle.
    -->
    <customErrors mode="RemoteOnly" defaultRedirect="Shared/Internal_Server_Error.html">
      <error statusCode="404" redirect="Shared/Internal_Server_Error.html" />
      <error statusCode="500" redirect="Shared/Internal_Server_Error.html" />
    </customErrors>
    <!--  AUTHENTICATION
          This section sets the authentication policies of the application. Possible modes are "Windows",
          "Forms", "Passport" and "None"
    -->
    <authentication mode="Windows" />
    <!--  IDENTITY
          Set Impersonate="true" to enable IIS to run this application under the credentials of the current user.
        Set Impersonate="false" to enable Active Directory single sign-in. Note: "false" disables Active Directory authentication for localhost.
    -->
    <identity impersonate="true" password="winter9529" userName="INSWHL\mhansen" />
    <!--  AUTHORIZATION
          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
          (unauthenticated) users.
    -->
    <authorization>
      <allow users="*" />
      <!-- Allow all users -->
      <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>
    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every page within an application. Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
          trace information will be displayed at the bottom of each page.  Otherwise, you can view the application trace log by browsing the "trace.axd" page from your web application root.
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL.
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState mode="InProc" stateConnectionString="tcpip=127.1.0.1:42424" sqlConnectionString="data source=127.1.0.1;user id=sa;password=" cookieless="false" timeout="60" />
    <!--  GLOBALIZATION
          This section sets the globalization settings of the application.
          Set responseEncoding to an appropriate value to ensure emails sent from your application are correctly encoded and display your language’s complete character set.  For example, if your default language is French and you want
          French characters from the extended French character set to be correctly included and displayed in your emails, may set responseEncoding to “windows-1252”.  Remove the responseEncoding parameter to use the setting in your
          machine.config file or to use the encoding defaults in your computer's Regional Options locale setting.
    -->
    <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
    <!--  HTTP RUN TIME This section sets the run time settings of the application.
    -->
 <httpRuntime maxRequestLength="10240" requestValidationMode="2.0" />
  </system.web>
  <location path="DefaultWsdlHelpGenerator.aspx">
    <system.web>
      <pages styleSheetTheme="" />
    </system.web>
  </location>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule" />
    </modules>
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
      <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" />     
      <remove name="ChartImageHandler" />
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </handlers>
  </system.webServer>
  <!-- Following Section is used for data access layer where clauses and formulas
       Please modify this section using Batch Meister Wizard instead of directly
       making changes here.
  -->
  <DataAccessLayerWhereClause>
    <WhereClauses>
      <WhereClause Apply="false">
        <LHS>CompanyIDForMultiTenantApps1</LHS>
        <RHS>GetColumnValue("User",UserID(),"CompanyID")</RHS>
        <Operand>=</Operand>
      </WhereClause>
      <WhereClause Apply="false">
        <LHS>CompanyIDForMultiTenantApps2</LHS>
        <RHS>Session("CompanyID")</RHS>
        <Operand>=</Operand>
      </WhereClause>
    </WhereClauses>
    <Formulas>
      <Formula Apply="false">
        <ColumnName>CreatedBy</ColumnName>
        <Value>UserID()</Value>
        <Event>Initialize when inserting</Event>
      </Formula>
      <Formula Apply="false">
        <ColumnName>BirthDate</ColumnName>
        <Value>If(BirthDate > Today() , "Birthdate cannot be in the future" , "")</Value>
        <Event>Validate when inserting</Event>
      </Formula>
      <Formula Apply="false">
        <ColumnName>UpdatedOn</ColumnName>
        <Value>Today()</Value>
        <Event>Initialize when updating</Event>
      </Formula>
      <Formula Apply="false">
        <ColumnName>CreatedOn</ColumnName>
        <Value>Today()</Value>
        <Event>Initialize when inserting</Event>
      </Formula>
      <Formula Apply="false">
        <ColumnName>UpdatedBy</ColumnName>
        <Value>UserID()</Value>
        <Event>Initialize when updating</Event>
      </Formula>
    </Formulas>
  </DataAccessLayerWhereClause>
</configuration>

Aneliya Petkova
Telerik team
 answered on 23 Jul 2015
1 answer
86 views

Filters aren't working in latest build.

UI for ASP.NET AJAX Q2 2015 (version 2015.2.623)

This is demonstrated in demo:

http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/olap/defaultcs.aspx

Try filter on Year selecting only FY 2009, and it still shows all years.

Maria Ilieva
Telerik team
 answered on 23 Jul 2015
9 answers
258 views
is there a way i can attach the Enter Key event to
fire or invoke a click event for the rad filter on a page???
i understand the small code below is in the code behind - just for clarification -  & i would need to do this from javascript.
any help is appreciated.
thx
rik


 

 

protected void SearchExitedTrucksRadFilter_Apply(object sender, EventArgs e)

 

Konstantin Dikov
Telerik team
 answered on 23 Jul 2015
3 answers
373 views

I am using rad date picker and the dropdown calendar displays week numbers but they do not match ISO8601 standard. Eg. 2009 has 53 weeks according to the standard. How do I correct this.

My markup is....

<telerik:RadDatePicker ID="dp_ReportStartDate" runat="server" MinDate="2006-01-01" Width="100%" AutoPostBack="true">

</telerik:RadDatePicker>


 
Vasil
Telerik team
 answered on 23 Jul 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?