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

I have had to set the I have had to set the ImageStorageLocation attribute to session to allow the captcha image to be displayed when we deploy our application to the server.

Following on from this i had to change the following in the web.config and i would like to know if there are any known impacts to other telerik controls if changing this.

Changed From:
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />

Changed To:
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResourceSession" verb="*" validate="false" />

Kind Regards,
Jonathan
Pero
Telerik team
 answered on 03 Mar 2011
1 answer
200 views
I am doing an evaluation for our company's 3rd party tool set which is currently Intersoft. One of the biggest features that we use is their BatchUpdate which basically opens allows editing of every column within the Grid. Then, we use a button postback and the Grid has a collection of edited rows that we can use to update only the dirty row's data.

A few questions:

1) I noticed that batch update is possible if the "EditColumn" is hidden. However, the updated data can be lost if: 1) Sort/Filter/Page causing a postback 2) Edit button is clicked changing the row to Edit mode (This can be fixed if the entire grid is loaded in edit mode but #1 issue still exists)

2) Is there a way to tell which Grid.EditedItems are dirty? I noticed this thread (http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-multi-row-questions.aspx) which checks if a row is dirty but it's an iterative process of checking every single row's field before/after update? What about for items to be deleted/inserts? Can all of that be done on the client-side and then handled with one single update? Performing multiple ajax call backs is a performance concern for us.

3) Is there a way to implement #1 with using all of the edit modes: inline, form, and user control? Avoid postbacks until a single batch update?

4) Is there a way to bind the grid using client-side web services using WCF? I noticed a few examples using .NET 2.0 Web Services (ASMX)?

5) Is there a way to implement Google-Like searches in the DropDownList within the Grid's columns?

Thank you for the help.
Tsvetina
Telerik team
 answered on 03 Mar 2011
1 answer
106 views
Hi,
    i am working on radbutton control but we have only standard button..and standard button is not being displayed properly. could u plz help me..and how to get other buttons in my project...ex:imagebutton,togglebutton....
Pero
Telerik team
 answered on 03 Mar 2011
1 answer
199 views
Hi
We have use Radbutton inside asp panel but when we try to set the property/Method set_AutoPostBack(false) . It is giving JavaScript Error in IE 6.0 as show in attachment but in IE 8.0 it work fine . kindly help us how we can resolve this issue we have goLive very soon
Pero
Telerik team
 answered on 03 Mar 2011
1 answer
147 views
Hi
I have a radgrid and i am trying to use treeview under radgrid.
Similar to your demo example http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridwithtreeviewcomboboxeditors/defaultcs.aspx?product=grid

But I cant get it to work.
I want a empty grid in which onClick of 'Add New Record' I want toinsert into tblPettyCash.
I have a table tblExpCodes with fields

ExpType
Category
ExpCodeDesc only to display data.

I want to have tree view for these fields and only select them NOT to update anything on tblExpCodes table.
I use tblPettyCash to enter Claims.
The demo is slightly complicated 
I created a similar .aspx page but giving me error saying

These columns don't currently have unique values.


I have attached the code files.
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/CWCStaffnet.Master" CodeBehind="Petty.aspx.cs" Inherits="CWC.Staffnet.Forms.Finance.Petty" %>
  
<%@ MasterType VirtualPath="~/CWCStaffnet.Master" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Styles/Styles.css" rel="stylesheet" type="text/css" /> 
    <script type="text/javascript"  src="../JSValidation.js"></script>       
    <style type="text/css">
        .MyImageButton
        {
           cursor: hand;
        }
        .EditFormHeader td
        {
            font-size: 14px;
            padding: 4px !important;
            color: #0066cc;
        }
        </style>
  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Petty Cash Claim Form</h1>
      
    <asp:Panel ID="plForm" runat="server">
     <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" IsSticky="True" Style="position: absolute;  top: 0; left: 0; height: 100%; width: 100%;" >
        </telerik:RadAjaxLoadingPanel>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>
  
        </telerik:RadCodeBlock>
         <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
  
            //stop the event bubbling
            function StopPropagation(e) {
                if (!e) {
                    e = window.event;
                }
  
                e.cancelBubble = true;
            }
  
            //find the selected node in the treeview inside the combobox and scroll it into view
            function OnClientDropDownOpenedHandler(sender, eventArgs) {
                var tree = sender.get_items().getItem(0).findControl("RadTreeView1");
                var selectedNode = tree.get_selectedNode();
  
                if (selectedNode) {
                    selectedNode.scrollIntoView();
                }
            }
            //when tree node is clicked, set the text and value for the item in the combobox and commit the changes 
            function nodeClicking(sender, args) {
  
                //get the id of the employeesCombo in the edited row (passed from the server in the ItemDataBound event handler) 
                var comboBox = $find(window['comboId']);
                var node = args.get_node();
  
                comboBox.set_text(node.get_text());
  
                comboBox.trackChanges();
                comboBox.get_items().getItem(0).set_text(node.get_text());
                comboBox.get_items().getItem(0).set_value(node.get_value());
                comboBox.commitChanges();
  
                comboBox.hideDropDown();
                comboBox.attachDropDown();
            }
              
        </script>
    </telerik:RadScriptBlock>
  
 <asp:Label ID="Label1" runat="server" EnableViewState="false" Font-Bold="true" Text="Orders List" />
    <telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="false" PageSize="15" AllowPaging="true"
        AllowSorting="true" runat="server" DataSourceID="LinqPettyCash" AllowAutomaticUpdates="true"
        AllowAutomaticInserts="True" ShowStatusBar="true" OnItemCreated="RadGrid1_ItemCreated"
        OnUpdateCommand="RadGrid1_UpdateCommand" >
        <MasterTableView DataKeyNames="Id" EditMode="InPlace" CommandItemDisplay="TopAndBottom" DataSourceID="LinqPettyCash"
            TableLayout="Fixed">
            <Columns>
                <telerik:GridBoundColumn UniqueName="Id" DataField="Id" HeaderText="Id"
                    ReadOnly="true" />
                    <telerik:GridTemplateColumn UniqueName="Code" HeaderText="Code" SortExpression="Code"
                    ItemStyle-Width="400px">
                    <ItemTemplate>
                        <%#DataBinder.Eval(Container.DataItem, "ExpenditureCode")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <!-- Show employees in the treeview -->
                        <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="180px"
                            ShowToggleImage="True" Style="vertical-align: middle;" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
                            ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                            <ItemTemplate>
                                <div id="div1" onclick="StopPropagation(event);">
                                    <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking"
                                        Height="140px" DataTextField="ExpenditureCode" DataValueField="CodeDescription" DataFieldID="CodeDescription"
                                        DataFieldParentID="ExpType" DataSourceID="ExpDataSource" />
                                </div>
                            </ItemTemplate>
                            <Items>
                                <telerik:RadComboBoxItem Text="" />
                            </Items>
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                </Columns>
        </MasterTableView>
    </telerik:RadGrid>
     <asp:Label ID="lblMessage" runat="server" EnableViewState="false" Font-Bold="true" />
  
     <br />
                 <p><asp:Label ID="lbError" runat="server" CssClass="message" Visible="false"></asp:Label></p>
                 <asp:ValidationSummary runat="server" ID="validationSummary3" ValidationGroup="Fault" /> 
                   <asp:Button ID="btSubmit" runat="server" CausesValidation="true" 
                       OnClick="btSubmit_Click" Text="Submit" ValidationGroup="Fault" />
  
     <asp:SqlDataSource ID="ExpDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:cwc_staffnetConnectionString %>"
        SelectCommand="SELECT DISTINCT Category,Id,CodeDescription, ExpenditureCode,ExpCodeDesc,ExpType  FROM tblExpenditureCodes" 
         InsertCommand="INSERT INTO tblPettyCashes ([ExpenditureCode], [ExpType],[Id]) VALUES (@ExpenditureCode, @ExpType, @Id)"
  
        />
         <asp:LinqDataSource ID="LinqPettyCash" runat="server" 
            ContextTypeName="CWC.Staffnet.Forms.StaffnetDataContext" 
            TableName="tblPettyCashes" EnableDelete="True" 
            EnableUpdate="True" EnableInsert="true" >
        </asp:LinqDataSource>  
        </asp:Panel>
    <asp:Panel ID="plConfirm" runat="server" Visible="false">
    <table>  
  <tr>
    <td
        <p><b>Notification of Petty example Form.</b></p>
        <p>
            You have successfully completed the Petty cash Claim form. </p>            
        <p>       
            For any questions or comments regarding this form please contact 
            <a href="mailto:online.services@cwc.ac.uk"> Online services </a>
            Thank you.</p>
        </td>         
        </tr>
</table>
    </asp:Panel>
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="plfrm">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl LoadingPanelID="LoadingPanel1" ControlID="RadGrid1"/>
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                        <telerik:AjaxUpdatedControl LoadingPanelID="LoadingPanel1" ControlID="lstName" />
                        <telerik:AjaxUpdatedControl LoadingPanelID="LoadingPanel1" ControlID="lstFaculty" />   
                        <telerik:AjaxUpdatedControl LoadingPanelID="LoadingPanel1" ControlID="lstCentre" />   
                    </UpdatedControls>
                </telerik:AjaxSetting>
                 
            </AjaxSettings>
        </telerik:RadAjaxManager>
</asp:Content>
  
  
******************************************************************************************************************************
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using Telerik.Web.UI;
using config = CWC.Staffnet.Forms.Properties.Settings;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using System;
  
  
namespace CWC.Staffnet.Forms.Finance
{
    public partial class Petty : System.Web.UI.Page
    {
        private StaffnetDataContext dc;      
        protected void Page_Init(object sender, EventArgs e)
        {
            dc = new StaffnetDataContext();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
  
        }
        protected void btSubmit_Click(object sender, EventArgs e)
        {
            Page.Validate();
            if (Page.IsValid)
            {
                try
                {
                    AddRecord();
                    SendEmail();
                    plConfirm.Visible = true;
                    plForm.Visible = false;
                }
                catch (Exception ex)
                {
                    ShowErrorMessage(ex.ToString());
                }
            }
            else
            {
                string msg = string.Empty;
                foreach (IValidator validator in this.Validators)
                {
                    if (!validator.IsValid)
                    {
                        msg += String.Format("{0}<br/>", validator.ErrorMessage);
                        ShowErrorMessage(msg);
                    }
                }
            }
        }
        private void ShowErrorMessage(string ex)
        {
            lbError.Text = ex.ToString();
            lbError.Visible = true;
        }
        private void AddRecord()
        { }
        private void SendEmail()
        { }
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            //if a grid item is in edit mode, wire the ItemsRequested event of the customersCombo to filter the items in it based on the selection in the freight combo
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                RadComboBox freightCombo = (e.Item as GridEditableItem)["Code"].Controls[0] as RadComboBox;
  
                if (Page.IsCallback)
                {
                      
                }
            }
        }
  
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem)
            {              
  
                //set the selected value for the Employees combobox to match the value in the edited cell
                RadComboBox employeesCombo = (e.Item as GridEditableItem).FindControl("RadComboBox1") as RadComboBox;
                employeesCombo.Items[0].Text = DataBinder.Eval(e.Item.DataItem, "ExpenditureCode").ToString();
  
                //set the selection in the treeview inside the combobox to match the value in the edited cell
                RadTreeView employeesTreeView = employeesCombo.Items[0].FindControl("RadTreeView1") as RadTreeView;
                employeesTreeView.FindNodeByText(DataBinder.Eval(e.Item.DataItem, "ExpenditureCode").ToString()).Selected = true;
                //Expand all nodes to scroll the selected into view. Have in mind that load-on-demand is recommended with very large number of nodes in the treeview 
                employeesTreeView.ExpandAllNodes();
  
                //register script block which holds the client id of the employeesComboBox. Will be used to reference the client object of the combobox in the RadTreeView's OnClientNodeClicking event handler
                RadScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "employeesComboScript", "<script type='text/javascript'>window['comboId'] = '" + e.Item.FindControl("RadComboBox1").ClientID + "';</script>", false);
  
            }
             
        }
        protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            string empId = (((e.Item as GridEditableItem).FindControl("RadComboBox1") as RadComboBox).Items[0].FindControl("RadTreeView1") as RadTreeView).SelectedNode.Value;
  
            //if the EmployeeID value is empty, cancel the update operation
            if (empId == string.Empty)
            {
                e.Canceled = true;
                SetMessage("Order cannot be updated. You must select an employee from the provided list");
            }
            else
            {
                LinqPettyCash.UpdateParameters["Id"].DefaultValue = empId;
            }
        }
        public void SetMessage(string message)
        {
            lblMessage.Text = message;
        }
  
    }
}

If you could help me quickly.
Thankyou
Suchi



Pavlina
Telerik team
 answered on 03 Mar 2011
1 answer
328 views
I have a requirement that I need to dispay an image if the flag is false and should not display anything (the cell must be empty) if the flag is true. How to achieve this using GridImageColumn?

Thanks in advance..
Shinu
Top achievements
Rank 2
 answered on 03 Mar 2011
1 answer
79 views
Hi, I am trying to use RadToolTipManager to create on demand tooltip content which is dependant on the value of a particular column on mouse over.... as a starting point I am attempting to recreate as much of the example project - (http://demos.telerik.com/aspnet-ajax/tooltip/examples/loadondemand/defaultcs.aspx) in my own as possible. However I'm getting a ' Type 'ProductDetails' is not defined ' error in the following line of the code behind:

Dim details As ProductDetails = DirectCast(ctrl, ProductDetails)

I have tried putting the ascx file in my app_folder, the root, I'm pretty sure I've got all the relevant imports right and registrations at the top of the aspx file... am probably missing something obvious but can't figure out what...

Thanks in advance,

Rudie
Svetlina Anati
Telerik team
 answered on 03 Mar 2011
1 answer
158 views
Is there a way I can capture the click of the 'X' close button from within the RadWindow, so I can set a specific argument value to be passed back to the parent window? From what I've seen, the suggested solutions have been to check for a null argument on the parent side which would indicate the X close was used. I want to pass an argument back (such as 'updated' or 'notUpdated') so I know whether to refresh a main grid control based on the actions performed within the window. Thanks.
Shinu
Top achievements
Rank 2
 answered on 03 Mar 2011
1 answer
127 views
Hi Telerik,
I tried to integrate the latest assemblies to SharePoint 2010. I follows the steps by adding safe control in web.config,
<SafeControl Assembly="Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Charting" TypeName="*" Safe="True" SafeAgainstScript="False" />


I also add the httphandlers in web.config
<httpHandlers><br>      <add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" /><br>    </httpHandlers><br>


In my C# code, i also disabled the Session and set the temporary files where the web application have full permission to writes to that file(local administrator right).

After all done, when i tried to generate my chart, it throw exception as attached.

Kindly advise.

Regards.
Bartholomeo Rocca
Top achievements
Rank 1
 answered on 03 Mar 2011
6 answers
154 views
i have used raddatepicker in one of my page which should load on page-load. but when i open that page it take a lot of time for the open, in fact it does not open. i dont face this issue in any other browser (IE 7/8 or firefox). plz help on that.. 
ritu ritu
Top achievements
Rank 1
 answered on 03 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?