Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
84 views
Is it possible to configure the radcombobox so it collapses when one clicks on the input area?
It opens when you click there, but won't close when you click there again. (As compared tot he regular asp combobox)

Cheers,
CJ
AnneArents
Top achievements
Rank 1
 asked on 20 Dec 2012
2 answers
65 views
Hi
i have a big problem with RadTreeView (version 2010.2.929.35).
The display of nodes is correct with Internet Explorer 8 and above but instead with Internet Explorer 7 when you hover the mouse over the node, the node it disappears!.
For testing i define OnClientMouseOver events:

<telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="True" TriStateCheckBoxes="false"
CheckChildNodes="true" Width="170px" style="white-space:normal;" OnClientMouseOver="onMouseOver">
                            <DataBindings>
                                <telerik:RadTreeNodeBinding Expanded="False" />
                            </DataBindings>
                    </telerik:RadTreeView>
 and

function onMouseOver(sender, e)
{
        var node = e.get_node(); 
        node.onmouseover = null;
}

the result is that in Internet Explorer 8 and above the hover is properly disabled but in Internet Explorer 7, the node continues to disappear.
Can someone help me? Thank you very much.
Marco
Marco
Top achievements
Rank 1
 answered on 20 Dec 2012
17 answers
403 views
I'm in the process of making my web application compatible with iPad (Safari).
The problem is a RadPane, with Scrolling set to both, but also a ContentUrl set, will not scroll on an iPad.
In cases were no CententUrl is set, scrolling works fine.
Also scrolling (with ContentUrl is set) works fine on PC browsers.
Is there a solution or workaround for this?
Phil
Top achievements
Rank 1
 answered on 20 Dec 2012
1 answer
59 views
Hi,
I have RadPane scrolling issues in Opera Mobile version 12.10.ADR on two Android mobile devices:

1-tablet with Android 4.0.3
2-phone with Android 2.3.4

on both, the content pane doesnt want to scroll. Here is a simplified version having the issue (im using the "Nested Splitters" demo code):

<telerik:RadSplitter ID="Radsplitter5" runat="server" Width="700" Height="300" Orientation="Horizontal">
    <telerik:RadPane ID="Radpane2" runat="server" Height="150">
        Left Pane
    </telerik:RadPane>
    <telerik:RadSplitBar ID="Radsplitbar5" runat="server" CollapseMode="Forward">
    </telerik:RadSplitBar>
    <telerik:RadPane ID="Radpane6" runat="server" Scrolling="None">
        <telerik:RadSplitter ID="Radsplitter6" runat="server">
            <telerik:RadPane ID="Radpane7" runat="server">
                Nested Splitter Top Pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="Radsplitbar6" runat="server" CollapseMode="Forward">
            </telerik:RadSplitBar>
            <telerik:RadPane ID="Radpane8" runat="server" ContentUrl="http://www.telerik.com">
 
            </telerik:RadPane>
        </telerik:RadSplitter>
    </telerik:RadPane>
</telerik:RadSplitter><br />

I tried using the iPad workaround CSS to the pane (below) without success
-webkit-overflow-scrolling: touch !important ;
 overflow-y: scroll !important;

Please help,

TIA

Martin
Dobromir
Telerik team
 answered on 20 Dec 2012
2 answers
64 views
Hello Team;
Let me first provide some info, before discussing my problem.

Previously I had used EF and "ObjectCondext" for my Model. Then for each ASP Page that I needed DataSource, I had used ObjectDataSource (ODS). In the ODS declaration, I had identified the "Update" method which takes two parameters. One the modified object and the second the Original object.
In the Update method first I would attach the Original object to my ObjectContext first and the call "ApplyCurrentValues" Method from ObjectContext and pass the modified object. This method would then compare the properties between the two objects and create the proper SQL update command to update only Modified properties.

Now, with this new project, I'm using CodeFirst and DbContext and unfortunately DBContext does not have "ApplyCurrentValues" Method to pass two objects (before & after). It only takes the modified object.

But I'm running into a serious problem with Telerik Grid in this situation. Let's say I have a customer object with 20 properties and three Foreign key properties. If I connect the Grid to ObjectDataSource and have only 5 properties as "Editable" in the grid, when I do an update, the grid returns me an object with all the properties, but all the other 15 properties that were not editable and bound to TextBox (with Bind), they all become Null, including all my Foreign key fields.
In most cases, I don't need to have all the properties shown, Especially the foreign key values.

How do I solve this problem, that the grid returns me the original values of those properties that were not changed? 
..Ben
Ben Hayat
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
194 views
I use pie chart of RadHtmlChart. In my graph i show legends. Now i want to click on legend and show some alert message 
Could it be possible.

Thanks,
Lokesh
Danail Vasilev
Telerik team
 answered on 20 Dec 2012
1 answer
86 views
Hi,

Does the html chart control supports legend click?. The requirement is to lauch a page on clicking of an item in the legend and pass the legend clicked. The control has "OnClientSeriesClicked" event for chart clicking. We are looking for something similar for legend click.


Thanks
Pavaman
Danail Vasilev
Telerik team
 answered on 20 Dec 2012
10 answers
163 views
I have a problem showing RadGrid buttons, they appear like in attached photos, the Slider as well, I tried all skins with no luck...

my Data is in Arabic Language (right to left)...

Clients.aspx

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <div dir="rtl">
        <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
 
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
 
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
 
                function gridCreated(sender, args) {
                    if (sender.get_editIndexes && sender.get_editIndexes().length > 0) {
                        document.getElementById("OutPut").innerHTML = sender.get_editIndexes().join();
                    }
                    else {
                        document.getElementById("OutPut").innerHTML = "";
                    }
                }
 
                function requestStart(sender, args) {
                    if (args.get_eventTarget().indexOf("DownloadPDF") > 0)
                        args.set_enableAjax(false);
                }
 
                var popUp;
                function PopUpShowing(sender, eventArgs) {
                    popUp = eventArgs.get_popUp();
                    var gridWidth = sender.get_element().offsetWidth;
                    var gridHeight = sender.get_element().offsetHeight;
                    var gridTop = sender.get_element().offsetTop;
                    var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
                    var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
                    popUp.style.left = ((gridWidth - popUpWidth) / 2 + sender.get_element().offsetLeft).toString() + "px";
                    popUp.style.top = gridTop + "px";
                    popUp.style.height = gridHeight + "px";
                }
            </script>
        </telerik:RadCodeBlock>
 
 
        <div class="module" style="height: 20px; width: 350px;">
            <span style="font-weight: bold;">قائمة العملاء: </span><span id="OutPut" style="font-weight: bold; color: navy;"></span>
        </div>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
 
        <asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="pnlupdate">
            <ContentTemplate>
                <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="50" AllowSorting="True" CellSpacing="0" DataSourceID="SqlDataSource1" OnItemDataBound="RadGrid1_ItemDataBound" Skin="Office2010Blue" OnNeedDataSource="RadGrid1_NeedDataSource" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" OnItemDeleted="RadGrid1_ItemDeleted" OnDataBound="RadGrid1_DataBound" OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated" OnInit="RadGrid1_Init" OnItemCreated="RadGrid1_ItemCreated" OnPreRender="RadGrid1_PreRender" OnItemCommand="RadGrid1_ItemCommand" AllowFilteringByColumn="True" GridLines="None">
                    <ClientSettings>
                        <ClientEvents OnGridCreated="gridCreated" OnRowDblClick="RowDblClick" />
                        <ClientEvents OnPopUpShowing="PopUpShowing" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
 
                    <MasterTableView DataSourceID="SqlDataSource1" HorizontalAlign="Center" AutoGenerateColumns="False" Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="ClientID, PriceLevel, ClientOnly" EditMode="PopUp" EditFormSettings-PopUpSettings-ScrollBars="Auto">
 
                        <CommandItemSettings ExportToPdfText="نقل إلى صيغة بي دي إف" ExportToExcelText="نقل لإكسيل" AddNewRecordText="إضافة عميل جديد" RefreshText="تجديد البيانات"></CommandItemSettings>
 
                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
 
                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
 
                        <Columns>
 
                            <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="EditCommandColumn" CancelText="تراجع" InsertText="إضافة عميل جديد" UpdateText="تحديث">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle CssClass="MyImageButton" Wrap="False"></ItemStyle>
                            </telerik:GridEditCommandColumn>
 
 
 
                            <telerik:GridBoundColumn DataField="ClientID" DataType="System.Int32" AllowFiltering="false" FilterControlAltText="Filter ClientID column" HeaderText="رقم العميل" SortExpression="ClientID" UniqueName="ClientID" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
 
                            <telerik:GridBoundColumn DataField="Name" DataType="System.String" FilterControlAltText="Filter Name column" HeaderText="إسم العميل" SortExpression="Name" UniqueName="Name">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn DataField="Phone" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter Phone column" HeaderText="هاتف" SortExpression="Phone" UniqueName="Phone">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn DataField="Mobile" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter Mobile column" HeaderText="موبايل" SortExpression="Mobile" UniqueName="Mobile">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn DataField="Fax" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter Fax column" HeaderText="فاكس" SortExpression="Fax" UniqueName="Fax">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn DataField="Address" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter Address column" HeaderText="العنوان" SortExpression="Address" UniqueName="Address">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn DataField="Email" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter Email column" HeaderText="الإيميل" SortExpression="Email" UniqueName="Email">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn DataField="WebSite" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter WebSite column" HeaderText="ويب" SortExpression="WebSite" UniqueName="WebSite">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridNumericColumn DataField="OldBalance" NumericType="Number" DataType="System.Single" AllowFiltering="false" FilterControlAltText="Filter OldBalance column" HeaderText="الرصيد السابق" SortExpression="OldBalance" UniqueName="OldBalance">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridNumericColumn>
 
                            <telerik:GridBoundColumn DataField="PriceLevel" DataType="System.Byte" AllowFiltering="false" FilterControlAltText="Filter PriceLevel column" SortExpression="PriceLevel" UniqueName="PriceLevel" Display="false" ReadOnly="true">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridDropDownColumn HeaderText="مستوى السعر" AllowFiltering="false" UniqueName="PL" SortExpression="PriceLevel" ColumnEditorID="GridDropDownColumnEditor1">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridDropDownColumn>
 
 
 
 
                            <telerik:GridBoundColumn DataField="ContactPerson" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter ContactPerson column" HeaderText="الشخص المسؤول" SortExpression="ContactPerson" UniqueName="ContactPerson">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ContactPersonPhone" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter ContactPersonPhone column" HeaderText="هاتف الشخص المسؤول" SortExpression="ContactPersonPhone" UniqueName="ContactPersonPhone">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridNumericColumn DataField="CreditLimit" NumericType="Number" DataType="System.Single" AllowFiltering="false" FilterControlAltText="Filter CreditLimit column" HeaderText="حد الدين" SortExpression="CreditLimit" UniqueName="CreditLimit">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridNumericColumn>
 
                            <telerik:GridBoundColumn DataField="ClientOnly" DataType="System.Byte" AllowFiltering="false" FilterControlAltText="Filter ClientOnly column" SortExpression="ClientOnly" UniqueName="ClientOnly" Display="false" ReadOnly="true">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
                            <telerik:GridDropDownColumn HeaderText="النوع" AllowFiltering="false" UniqueName="CO" SortExpression="ClientOnly" ColumnEditorID="GridDropDownColumnEditor1">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridDropDownColumn>
 
                            <telerik:GridDateTimeColumn DataField="CreationDate" DataType="System.DateTime" AllowFiltering="false" FilterControlAltText="Filter CreationDate column" HeaderText="تاريخ الإنشاء" SortExpression="CreationDate" UniqueName="CreationDate" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridDateTimeColumn>
                            <telerik:GridBoundColumn DataField="CreationUser" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter CreationUser column" HeaderText="المستخدم المنشيء" SortExpression="CreationUser" UniqueName="CreationUser" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn DataField="LastEditDate" DataType="System.DateTime" AllowFiltering="false" FilterControlAltText="Filter LastEditDate column" HeaderText="تاريخ اخر تعديل" SortExpression="LastEditDate" UniqueName="LastEditDate" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridDateTimeColumn>
                            <telerik:GridBoundColumn DataField="LastEditUser" DataType="System.String" AllowFiltering="false" FilterControlAltText="Filter LastEditUser column" HeaderText="اخر مستخدم معدل" SortExpression="LastEditUser" UniqueName="LastEditUser" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Active" DataType="System.Byte" AllowFiltering="false" FilterControlAltText="Filter Active column" HeaderText="Active" SortExpression="Active" UniqueName="Active" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Evaluation" DataType="System.Byte" AllowFiltering="false" FilterControlAltText="Filter Evaluation column" HeaderText="Evaluation" SortExpression="Evaluation" UniqueName="Evaluation" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Deleted" DataType="System.Byte" AllowFiltering="false" FilterControlAltText="Filter Deleted column" HeaderText="Deleted" SortExpression="Deleted" UniqueName="Deleted" Display="False" ReadOnly="True">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </telerik:GridBoundColumn>
 
 
                            <telerik:GridButtonColumn ConfirmText="هل انت متأكد من إلغاء هذا العميل ؟" ConfirmDialogType="RadWindow"
                                ConfirmTitle="إلـغــاء" ButtonType="PushButton" CommandName="Delete" Text=" إلغاء  "
                                UniqueName="DeleteColumn">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" Wrap="False"></ItemStyle>
                            </telerik:GridButtonColumn>
 
                        </Columns>
 
                        <EditFormSettings ColumnNumber="2" CaptionDataField="Name" CaptionFormatString="تعديل معلومات العميل {0}"
                            InsertCaption="عميل جديد">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3"
                                Width="100%"></FormMainTableStyle>
                            <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px"></FormTableStyle>
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="PushButton" InsertText="حفظ العميل الجديد" UpdateText="تعديل المعلومات"
                                UniqueName="EditCommandColumn1" CancelText="تراجع">
                            </EditColumn>
                            <FormTableButtonRowStyle CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                            <PopUpSettings ScrollBars="Auto" />
                        </EditFormSettings>
 
 
                    </MasterTableView>
 
                    <ClientSettings>
                        <ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="gridCreated"></ClientEvents>
                    </ClientSettings>
 
                    <HeaderStyle Wrap="False" />
 
                    <PagerStyle FirstPageText="الصفحة الأولى" FirstPageToolTip="الصفحة الأولى" LastPageText="الصفحة الأخيرة" LastPageToolTip="الصفحة الأخيرة" Mode="Slider" NextPagesToolTip="الصفحات التالية" NextPageText="الصفحة التالية" NextPageToolTip="الصفحة التالية" PagerTextFormat="Change page: {4} &nbsp;الصفحة <strong>{0}</strong> من إجمالي عدد الصفحات <strong>{1}</strong> <br/> العملاء من رقم  <strong>{2}</strong> إلى  <strong>{3}</strong> من إجمالي عدد العملاء  <strong>{5}</strong>" PageSizeLabelText="عدد العملاء في كل صفحة" PrevPagesToolTip="الصفحات السابقة" PrevPageText="الصفحة السابقة" PrevPageToolTip="الصفحة السابقة" />
 
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
 
                </telerik:RadGrid>
 
                <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" DropDownStyle-Width="90px">
                </telerik:GridDropDownListColumnEditor>
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                </telerik:RadWindowManager>
                <br />
 
 
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationDatabase %>"
                    SelectCommand="SELECT [ClientID], [Name], [Phone], [Mobile], [Fax], [Address], [Email], [WebSite], [OldBalance], [PriceLevel], [ContactPerson], [ContactPersonPhone], [CreditLimit], [ClientOnly] FROM [Clients] WHERE [Deleted] = '0'"
                    DeleteCommand="UPDATE [Clients] SET [Deleted] = '1' WHERE [ClientID] = @ClientID"
                    UpdateCommand="UPDATE [Clients] SET [Name] = @Name, [Phone] = @Phone, [Mobile] = @Mobile, [Fax] = @Fax, [Address] = @Address, [Email] = @Email, [WebSite] =  @WebSite, [OldBalance] = @OldBalance, [PriceLevel] = @PriceLevel, [ContactPerson] = @ContactPerson, [ContactPersonPhone] = @ContactPersonPhone, [CreditLimit] = @CreditLimit, [ClientOnly] = @ClientOnly, [LastEditDate] = @LastEditDate, [LastEditUser] = @LastEditUser WHERE [ClientID] = @ClientID"
                    InsertCommand="INSERT INTO [Clients] ([Name],[Phone],[Mobile],[Fax],[Address],[Email],[WebSite],[OldBalance],[PriceLevel],[ContactPerson],[ContactPersonPhone],[CreditLimit],[ClientOnly],[CreationDate],[CreationUser],[Active],[Evaluation],[Deleted]) VALUES (@Name,@Phone,@Mobile,@Fax,@Address,@Email,@WebSite,@OldBalance,@PriceLevel,@ContactPerson,@ContactPersonPhone,@CreditLimit,@ClientOnly,@CreationDate,@CreationUser,@Active,@Evaluation,@Deleted)" OnInserting="SqlDataSource1_Inserting" OnUpdating="SqlDataSource1_Updating">
 
                    <DeleteParameters>
                        <asp:Parameter Name="ClientID" Type="Int32"></asp:Parameter>
                    </DeleteParameters>
 
                    <UpdateParameters>
                        <asp:Parameter Name="ClientID" Type="Int32"></asp:Parameter>
                        <asp:Parameter Name="Name" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Phone" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Mobile" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Fax" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Address" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Email" Type="String"></asp:Parameter>
                        <asp:Parameter Name="WebSite" Type="String"></asp:Parameter>
                        <asp:Parameter Name="OldBalance" Type="Single"></asp:Parameter>
                        <asp:Parameter Name="PriceLevel" Type="Byte"></asp:Parameter>
                        <asp:Parameter Name="ContactPerson" Type="String"></asp:Parameter>
                        <asp:Parameter Name="ContactPersonPhone" Type="String"></asp:Parameter>
                        <asp:Parameter Name="CreditLimit" Type="Single"></asp:Parameter>
                        <asp:Parameter Name="ClientOnly" Type="Byte"></asp:Parameter>
                        <asp:Parameter Name="LastEditDate" Type="DateTime"></asp:Parameter>
                        <asp:Parameter Name="LastEditUser" Type="String"></asp:Parameter>
                    </UpdateParameters>
 
                    <InsertParameters>
                        <asp:Parameter Name="Name" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Phone" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Mobile" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Fax" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Address" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Email" Type="String"></asp:Parameter>
                        <asp:Parameter Name="WebSite" Type="String"></asp:Parameter>
                        <asp:Parameter Name="OldBalance" Type="Single"></asp:Parameter>
                        <asp:Parameter Name="PriceLevel" Type="Byte"></asp:Parameter>
                        <asp:Parameter Name="ContactPerson" Type="String"></asp:Parameter>
                        <asp:Parameter Name="ContactPersonPhone" Type="String"></asp:Parameter>
                        <asp:Parameter Name="CreditLimit" Type="Single"></asp:Parameter>
                        <asp:Parameter Name="ClientOnly" Type="Byte"></asp:Parameter>
                        <asp:Parameter Name="CreationDate" Type="DateTime"></asp:Parameter>
                        <asp:Parameter Name="CreationUser" Type="String"></asp:Parameter>
                        <asp:Parameter Name="LastEditDate" Type="DateTime"></asp:Parameter>
                        <asp:Parameter Name="LastEditUser" Type="String"></asp:Parameter>
                        <asp:Parameter Name="Active" Type="Byte" DefaultValue="1"></asp:Parameter>
                        <asp:Parameter Name="Evaluation" Type="Byte" DefaultValue="0"></asp:Parameter>
                        <asp:Parameter Name="Deleted" Type="Byte" DefaultValue="0"></asp:Parameter>
 
                    </InsertParameters>
 
                </asp:SqlDataSource>
 
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>

Clients.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using Telerik.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web.Security;
 
 
 
namespace alfaisal.Users
{
    public partial class Clients : System.Web.UI.Page
    {
        bool isPdfExport = false;
        protected void Page_Load(object sender, EventArgs e)
        {
            GridFilterMenu menu = RadGrid1.FilterMenu;
            foreach (RadMenuItem item in menu.Items)
            {    //change the text for the "StartsWith" menu item 
                if (item.Text == "NoFilter")
                {
                    item.Text = "عرض كافة العملاء";
                }
                if (item.Text == "Contains")
                {
                    item.Text = "يحتوي على";
                }
                if (item.Text == "EqualTo")
                {
                    item.Text = "مساوي لـِ";
                }
            }
        }
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {           
            if (e.Item is GridDataItem) // View Mode Only
            {
                 GridDataItem item = (GridDataItem)e.Item;
              
                item["PL"].Text = "المستوى " + item["PriceLevel"].Text;
 
                 switch (item["ClientOnly"].Text)
                 {
                     case "0":
                         {
                             item["CO"].Text = "عميل و تاجر محلي";
                             break;
                         }
                     case "1":
                         {
                             item["CO"].Text = "عميل فقط";
                             break;
                         }
                 }
            }
 
            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) // Edit/Insert Mode
            {
                string s = Application["PriceLevels"] as String;
                int j = Convert.ToInt32(s);
 
                string[] PriceLevelArray;
                PriceLevelArray = new string[j];
 
                for (int i = 0; i < j; i++)
                {
                    PriceLevelArray[i] = "المستوى " + (i + 1);
                }
 
                GridEditableItem editedItem = e.Item as GridEditableItem;
                GridEditManager editMan = editedItem.EditManager;
 
                 
                GridDropDownColumnEditor PriceLevelItem = editMan.GetColumnEditor("PL") as GridDropDownColumnEditor;
                PriceLevelItem.DataSource = PriceLevelArray;
                PriceLevelItem.DataBind();
 
                
                RadComboBox combo = (RadComboBox)editedItem["CO"].Controls[0];
                combo.Width = Unit.Pixel(200);
 
                if (!(e.Item is GridEditFormInsertItem || e.Item is GridDataInsertItem)) // not insert mode
                {
                    {
                        PriceLevelItem.SelectedText = "المستوى " + editedItem.GetDataKeyValue("PriceLevel").ToString();
                    }
                }
                 
                 
                GridDropDownColumnEditor ClientOnlyItem = editMan.GetColumnEditor("CO") as GridDropDownColumnEditor;
                ClientOnlyItem.DataSource = new string[2] { "عميل فقط", "عميل و تاجر محلي" };
                ClientOnlyItem.DataBind();
 
                if (!(e.Item is GridEditFormInsertItem || e.Item is GridDataInsertItem)) // not insert mode
                {
                    switch (editedItem.GetDataKeyValue("ClientOnly").ToString())
                    {
                        case "0":
                            {
                                ClientOnlyItem.SelectedText = "عميل و تاجر محلي";
                                break;
                            }
                        case "1":
                            {
                                ClientOnlyItem.SelectedText = "عميل فقط";
                                break;
                            }
                    }
                }
            }
        }
 
        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
 
        }
 
        protected void RadGrid1_ItemDeleted(object sender, GridDeletedEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
            String id = dataItem.GetDataKeyValue("ClientID").ToString();
 
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("العميل رقم  " + id + " لا يمكن حذفه و السبب  " + e.Exception.Message);
            }
            else
            {
                SetMessage("تم إلغاء العميل رقم  " + id + " بنجاح!");
            }
        }
        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_DataBound(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(gridMessage))
            {
                DisplayMessage(gridMessage);
            }
        }
 
        protected void RadGrid1_ItemInserted(object sender, GridInsertedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("لا يمكن تعريف عميل جديد و السبب : " + e.Exception.Message);
            }
            else
            {
                SetMessage("تم تعريف العميل الجديد بنجاح");
            }
        }
 
        protected void RadGrid1_ItemUpdated(object sender, GridUpdatedEventArgs e)
        {
            GridEditableItem item = (GridEditableItem)e.Item;
            String id = item.GetDataKeyValue("ClientID").ToString();
 
            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                SetMessage("لا يمكن تعديل معلومات العميل رقم  " + id + " و السبب : " + e.Exception.Message);
            }
            else
            {
                SetMessage("تم تعديل معلومات العميل  " + id + " بنجاح!");
            }
        }
 
        protected void RadGrid1_Init(object sender, EventArgs e)
        {
            GridFilterMenu menu = RadGrid1.FilterMenu;
            int i = 0;
            while (i < menu.Items.Count)
            {
                if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "EqualTo")
                {
                    i++;
                }
                else
                {
                    menu.Items.RemoveAt(i);
                }
            }
        }
 
        protected void SqlDataSource1_Inserting(object sender, SqlDataSourceCommandEventArgs e)
        {
             
            e.Command.Parameters["@CreationDate"].Value = DateTime.Now;
            e.Command.Parameters["@CreationUser"].Value = Session["UserID"];
 
            foreach (GridEditFormItem childeditItem in RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem))
            {
                if (childeditItem.IsInEditMode)
                {
                    GridEditableItem editedItem = childeditItem as GridEditableItem;
                    GridEditManager editMan = editedItem.EditManager;
 
                    GridDropDownColumnEditor PriceLevelItem = editMan.GetColumnEditor("PL") as GridDropDownColumnEditor;
                    e.Command.Parameters["@PriceLevel"].Value = PriceLevelItem.SelectedIndex + 1;
 
                    GridDropDownColumnEditor ClientOnlyItem = editMan.GetColumnEditor("CO") as GridDropDownColumnEditor;
                    switch (ClientOnlyItem.SelectedIndex)
                    {
                        case 0:
                            {
                                e.Command.Parameters["@ClientOnly"].Value = 1;
                                break;
                            }
                        case 1:
                            {
                                e.Command.Parameters["@ClientOnly"].Value = 0;
                                break;
                            }
                    }
                     
 
                }
            }
             
        }
 
        protected void SqlDataSource1_Updating(object sender, SqlDataSourceCommandEventArgs e)
        {
            e.Command.Parameters["@LastEditDate"].Value = DateTime.Now;
            e.Command.Parameters["@LastEditUser"].Value = Session["UserID"];
 
            foreach (GridEditFormItem childeditItem in RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem))
            {
                if (childeditItem.IsInEditMode)
                {
                    GridEditableItem editedItem = childeditItem as GridEditableItem;
                    GridEditManager editMan = editedItem.EditManager;
 
                    GridDropDownColumnEditor PriceLevelItem = editMan.GetColumnEditor("PL") as GridDropDownColumnEditor;
                    e.Command.Parameters["@PriceLevel"].Value = PriceLevelItem.SelectedIndex + 1;
 
                    GridDropDownColumnEditor ClientOnlyItem = editMan.GetColumnEditor("CO") as GridDropDownColumnEditor;
                    switch (ClientOnlyItem.SelectedIndex)
                    {
                        case 0:
                            {
                                e.Command.Parameters["@ClientOnly"].Value = 1;
                                break;
                            }
                        case 1:
                            {
                                e.Command.Parameters["@ClientOnly"].Value = 0;
                                break;
                            }
                    }
 
 
                }
            }
 
        }
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (isPdfExport) FormatGridItem(e.Item);
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
            {
                Application.Lock();                
                int dp = Convert.ToInt32(Application["DicimalPoint"] as String);
                Application.UnLock();
 
                GridEditFormItem editItem = (GridEditFormItem)e.Item;
                 
                RadNumericTextBox textbox1 = (RadNumericTextBox)editItem["OldBalance"].Controls[0];
                textbox1.NumberFormat.AllowRounding = false;
                textbox1.NumberFormat.DecimalDigits = dp;               
 
                RadNumericTextBox textbox2 = (RadNumericTextBox)editItem["CreditLimit"].Controls[0];
                textbox2.NumberFormat.AllowRounding = false;
                textbox2.NumberFormat.DecimalDigits = dp;
                 
            }
        }
 
        protected void FormatGridItem(GridItem item)
        {
            item.Style["color"] = "#eeeeee";
 
            if (item is GridDataItem)
            {
                item.Style["vertical-align"] = "middle";
                item.Style["text-align"] = "center";
            }
 
            switch (item.ItemType) //Mimic RadGrid appearance for the exported PDF file
            {
                case GridItemType.Item: item.Style["background-color"] = "#4F4F4F"; break;
                case GridItemType.AlternatingItem: item.Style["background-color"] = "#494949"; break;
                case GridItemType.Header: item.Style["background-color"] = "#2B2B2B"; break;
                case GridItemType.CommandItem: item.Style["background-color"] = "#000000"; break;
            }
 
            if (item is GridCommandItem)
            {
                item.PrepareItemStyle(); //needed to span the image over the CommandItem cells
            }
        }
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            Application.Lock();
            int dp = Convert.ToInt32(Application["DicimalPoint"].ToString());
            Application.UnLock();
            foreach (GridColumn column in RadGrid1.Columns)
            {
                if (column.UniqueName == "OldBalance" || column.UniqueName == "CreditLimit")
                {
                    (column as GridBoundColumn).ReadOnly = true;
                    (column as GridBoundColumn).DataFormatString = "{0:F" + dp + "}";                   
                }
            }
            RadGrid1.Rebind();
        }
 
        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExportToPdfCommandName)
                isPdfExport = true;
        }
 
    }
}

Angel Petrov
Telerik team
 answered on 20 Dec 2012
13 answers
238 views
Hello,

I am using Telerik Q3 2010 for Asp.net Ajax.
While opening ImageManager dialog of radeditor it is giving following javascript alert/error...
"Invalid Characters in Folder Name"

Here is how I pass the paths for imagemanager...

radEditor1.ImageManager.DeletePaths = "~/Upload/38920/"
radEditor1.ImageManager.UploadPaths = "~/Upload/38920/"
radEditor1.ImageManager.ViewPaths = "~/Upload/38920/"

Please reply how to get rid of this js alert/error.

Thanks in advance

Dobromir
Telerik team
 answered on 20 Dec 2012
1 answer
91 views
hi guys,
i've created a web page where there's one object panel asp and one RoundedCornersExtender .
Now when I run a code behind and part of the loadingpanel, at the end of the operation the asp panel no longer has round edges, as if there were no more or RoundedCornersExtender does not work, why?
this my code:
<form id="form1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Imgbtnrecupera">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server"
        DecoratedControls="All" Skin="Sunset" />
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"
        Skin="Simple" HorizontalAlign="Center" BorderColor="#D5842B"
        BorderStyle="Double" BorderWidth="1px" Width="420px">
    </telerik:RadAjaxLoadingPanel>
    <div style="font-family: Verdana; font-size: small; width: 420px; height: 240px; text-align:center; ">
        <div style="margin: 0px; border: 0px; padding-left: 0px; width: 420px; text-align: center">
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px"
                width="300px">
                <asp:Panel ID="Panel1" runat="server" BackColor="#F0F0F0" BorderColor="Silver"
                Width="420px" Height="240px">
                    <table style="width:100%;">
                        <tr>
                            <td  style="text-align: left; padding-left:9px" colspan="2" class="style1">
                                <asp:Label ID="Label1" runat="server" Text="Dati per la convalida (email)"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td  style="width: 400px; text-align: left; padding-left:9px" colspan="2">
                                <telerik:RadTextBox ID="Txtdati" Runat="server"
                            EmptyMessage="Inserire indirizzo email" LabelWidth="140px" Skin=""
                            Width="400px" ValidationGroup="Gropu">
                                    <EmptyMessageStyle ForeColor="#CCCCCC" />
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td  style="width: 400px; text-align: left; padding-left:9px" colspan="2">
                                <telerik:RadCaptcha ID="RadCaptcha1" Runat="server"
                            CaptchaLinkButtonText="Nuovo codice"
                            CaptchaTextBoxLabel="Inserire il codice dell'immagine"
                            EnableRefreshImage="True" ErrorMessage="Codice errato" Font-Names="Verdana"
                            Font-Size="Small" ValidationGroup="Group" Width="400px" Skin="">
                                </telerik:RadCaptcha>
                            </td>
                        </tr>
                        <tr>
                            <td  style="width: 400px; text-align: center; padding-top:5px">
                                <asp:ImageButton ID="Imgbtnrecupera" runat="server"
                            ImageUrl="~/Image/Recupera.png" />
                            </td>
                            <td  style="width: 400px; text-align: center; padding-top:5px">
                                 <asp:ImageButton ID="Imgbtnesci" runat="server" ImageUrl="~/Image/esci1.png"
                                 ValidationGroup="close" />
                            </td>
                        </tr>
                        <tr>
                            <td  style="width: 400px; text-align: center" colspan="2">
                                 </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:RoundedCornersExtender ID="Panel1_RoundedCornersExtender" runat="server"
                BorderColor="Silver" Enabled="True" Radius="4"
    TargetControlID="Panel1">
                </asp:RoundedCornersExtender>
            </telerik:RadAjaxPanel>
    <telerik:RadNotification ID="RadNotification1" runat="server" Height="100px"
        Skin="Simple" TitleIcon="~/Image/iconlogo.png" Width="400px"
        AutoCloseDelay="3500" Position="Center" Title="Recupero password">
    </telerik:RadNotification>
        <telerik:RadNotification ID="RadNotification2" runat="server" Height="100px"
        Skin="Simple" TitleIcon="~/Image/iconlogo.png" Width="300px"
        AutoCloseDelay="5000" Position="Center" Title="Recupero password">
    </telerik:RadNotification>
        </div>
    </div>
    </form>

also when I click the button imgbtnesci, the radwindow not close and there is a refresh of the radcaptcha
bye
Kevin
Top achievements
Rank 2
 answered on 20 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?