Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
1.3K+ views
how to disable/enable telerik raddatepicker using javascript ????
Shinu
Top achievements
Rank 2
 answered on 03 Oct 2013
5 answers
363 views

I am getting the following error when I try to do an upload using only IE9-7, rest of the browsers work:

Server Error in '/' Application.

Could not find file 'F:\sitesroot\0\App_Data\RadUploadTemp\dof1fnv1.uib'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not find file 'F:\sitesroot\0\App_Data\RadUploadTemp\dof1fnv1.uib'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FileNotFoundException: Could not find file 'F:\sitesroot\0\App_Data\RadUploadTemp\dof1fnv1.uib'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +12893271
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +2481
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +229
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +102
   Telerik.Web.UI.AsyncUploadedFile.get_InputStream() +86
   WebRole1.UploadImage.RadAsyncUpload1_FileUploaded(Object sender, FileUploadedEventArgs e) +1434
   Telerik.Web.UI.RadAsyncUpload.RaisePostDataChangedEvent() +178
   System.Web.UI.Page.RaiseChangedEvents() +309
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3468


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272            


I have verified the following:

1. That the temporary file IS begin created in that directory
2. That the directory is correct
3. User permissions for the folder have read/write/modify access
4. Tried the fix using a customupload handler here but didnt change anything:

http://www.telerik.com/community/forums/aspnet-ajax/async-upload/known-issues-and-breaking-changes.aspx

5. It works correctly on our test site but not our production site. I tried giving permissions to every user I could think of but still no luck. How could it be able to write the file but not be able to find it?

Dawid
Top achievements
Rank 1
 answered on 03 Oct 2013
2 answers
180 views
Hi,

I'm building a search screen for customers against an existing database using an Entity Data Source as the DataSource. There are 100,000 records and the performance of the RadSearchBox doesn't seem to be built to scale.

If I select the option Filter="StartsWith" I would expect that the search predicate would be pushed through entity framework and result in a SQL LIKE clause being generated. Instead when I run SQL Profilers I see every search running against the database without a WHERE clause and the result is a scan of the 100,000 rows with every auto-complete request.

It seems the best I can do to improve the performance of this is put an index on the field I'm searching to act as a vertical partition, but this solution doesn't scale well as over 95% of the time is still taken up by the web server scanning the entire data set looking for matching results.

Is there a better way to use the RadSearchBox when searching a data set of this size?

Thanks,

Ashley
Rob Conley
Top achievements
Rank 1
 answered on 02 Oct 2013
6 answers
297 views
Hi,

I have a Rad Grid with grid-bound columns and auto-generated columns. Now I want to swap a particular grid-bound field to the end of auto-generated columns.
I have visited the telerik forum. Only code I have found out is this:

protected void RadGrid1_PreRender(object sender, System.EventArgs e)
    {
     RadGrid1.MasterTableView.SwapColumns("AutoGeneratedColumn", "PreDefinedColumn");
    }

As the auto-generated columns are dynamically taking data from database , it is not possible to give the name of the last auto-generated column name. Also to note,I have given the  name of an auto-generated column.But it is not working.

Please help.

Regards
Purojit
IT Invoices
Top achievements
Rank 1
 answered on 02 Oct 2013
2 answers
391 views
Hi Telerik,

I am going through performance tuning for my ASP.NET AJAX web project. After enabling RadCompression, using RadStyleSheetManager to compress my CSS, and RadScriptManager to compress my JavaScript, I still receive one 'warning':

  1. Enable gzip compression (1)
    1. Compressing the following resources with gzip could reduce their transfer size by about two thirds (~14.14KB):
      1. WebResource.axd could save ~14.14KB

Is this possible, or is it just complaining about the auto-generated...ness of the file?

EDIT: I guess while we're at it I might as well ask about the others --

There's a LOT of excess, runtime-generated CSS generated and I'm not sure if I can do anything about it..

  1. Remove unused CSS rules (465)
    1. 419.86KB (93%) of CSS is not used by the current page.
      1. Telerik.Web.UI.WebResource.axd: 354.79KB (92%) is not used by the current page.
      2. Dashboard.aspx: 65.07KB (100%) is not used by the current page.


Sean
dipak
Top achievements
Rank 1
 answered on 02 Oct 2013
5 answers
243 views
I'm using a nested RadGrid, which should only be populated when a particular row in the parent Rad Grid is expanded.  This is working fine for the first page of the parent grid, and only the parent's NeedDataSource is fired.  Also, the child nested grid's NeedDataSource is correctly only firing upon expanding a row.

However, when I page the parent grid to the second page, the NeedDataSource of the child RadGrid is firing for each row of the parent's RadGrid, even though none of the rows in the parent grid are expanded.

What can I do to fix this? TelerikRadGrid1 in my code below is the parent RadGrid, and TelerikRadGrid2 is the nested child RadGrid.  SOrry if the code below is a bit long.  I'm really stuck at this point.  Thanks for any help!

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="IgnoreButton">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="UnMatchedClientDBCustomers_TelerikRadGrid1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="MatchButton">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="UnMatchedClientDBCustomers_TelerikRadGrid1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="UnMatchedClientDBCustomers_TelerikRadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="UnMatchedClientDBCustomers_TelerikRadGrid1" />
                <telerik:AjaxUpdatedControl ControlID="PotentialMasterListDBMatches_TelerikRadGrid2" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadGrid ID="runat" UnMatchedClientDBCustomers_TelerikRadGrid1="server" AllowPaging="true"
    AllowSorting="true" AllowFilteringByColumn="True" AutoGenerateColumns="false"
    onneeddatasource="UnMatchedClientDBCustomers_TelerikRadGrid1_NeedDataSource"
    onitemcommand="UnMatchedClientDBCustomers_TelerikRadGrid1_ItemCommand" Width="80%" Style="min-height: 360px;">
     <ClientSettings>
         <Scrolling AllowScroll="false"/>
     </ClientSettings>
    <MasterTableView DataKeyNames="CustomerID, MemberID" TableLayout="Auto">
 
        <ColumnGroups>
            <telerik:GridColumnGroup Name="Name" HeaderText="Name"
                HeaderStyle-HorizontalAlign="Center" >
            </telerik:GridColumnGroup>
            <telerik:GridColumnGroup Name="Emails" HeaderText="Emails"
                HeaderStyle-HorizontalAlign="Center" >
            </telerik:GridColumnGroup>
            <telerik:GridColumnGroup Name="Match" HeaderText="Match Criteria"
                HeaderStyle-HorizontalAlign="Center" >
            </telerik:GridColumnGroup>
            <telerik:GridColumnGroup Name="Address" HeaderText="Address"
                HeaderStyle-HorizontalAlign="Center">
            </telerik:GridColumnGroup>
            <telerik:GridColumnGroup Name="Action" HeaderText="Action"
                HeaderStyle-HorizontalAlign="Center" >
            </telerik:GridColumnGroup>
        </ColumnGroups>
 
        <CommandItemSettings ExportToPdfText="Export to PDF" ShowExportToExcelButton="true"></CommandItemSettings>
 
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="Ignore" ColumnGroupName="Action" AllowFiltering="false"><HeaderStyle Width="50px" />
                <ItemTemplate>
                    <asp:LinkButton ID="IgnoreButton" runat="server" Text="Ignore" OnClientClick="IgnoreConfirm()" CommandName="IgnoreButtonClick" CommandArgument='<%#Eval("CustomerID")%>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" UniqueName="CustomerID" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MemberID" HeaderText="Member Number" UniqueName="MemberNumber" ColumnGroupName="Name" FilterControlWidth="50px"><HeaderStyle Width="50px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" UniqueName="LastName" ColumnGroupName="Name"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="First" ColumnGroupName="Name"><HeaderStyle Width="50px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email" ColumnGroupName="Emails" FilterControlWidth="130px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LoginID" HeaderText="Login ID" UniqueName="LoginID" ColumnGroupName="Emails" FilterControlWidth="130px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MemberNoMatch" HeaderText="Member Number Match" UniqueName="MemberNoMatch" ColumnGroupName="Match"><HeaderStyle Width="50px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LastNameMatch" HeaderText="Last Name Match" UniqueName="LastNameMatch" ColumnGroupName="Match" FilterControlWidth="130px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="EmailMatch" HeaderText="Email Match" UniqueName="EmailMatch" ColumnGroupName="Match" FilterControlWidth="130px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Company" HeaderText="Company" UniqueName="Company" ColumnGroupName="Address"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Address" HeaderText="Address" UniqueName="Address" ColumnGroupName="Address"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City" ColumnGroupName="Address" FilterControlWidth="50px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="State" HeaderText="State" UniqueName="State" ColumnGroupName="Address" FilterControlWidth="30px"><HeaderStyle Width="20px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PostalCode" HeaderText="Postal Code" UniqueName="PostalCode" ColumnGroupName="Address" FilterControlWidth="50px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone Number" UniqueName="Phone" ColumnGroupName="Address" FilterControlWidth="50px"><HeaderStyle Width="100px" /><ItemStyle Wrap="true" /></telerik:GridBoundColumn>
        </Columns>
        <NestedViewTemplate>
            <div>
                <telerik:RadGrid ID="PotentialMasterListDBMatches_TelerikRadGrid2" runat="server" OnNeedDataSource="PotentialMasterListDBMatches_TelerikRadGrid2_NeedDataSource" AutoGenerateColumns="false">
                    <MasterTableView>
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="Update" ColumnGroupName="Action" AllowFiltering="false"><HeaderStyle Width="40px" />
                                <ItemTemplate>
                                    <asp:LinkButton ID="MatchButton" runat="server" Text="Match" OnClientClick="MatchConfirm()" OnClick="MatchButton_Click" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="ClientDBCustomerID" HeaderText="CustomerID" UniqueName="ClientDBCustomerID" Display="false"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="MemberID" HeaderText="Member Number" UniqueName="SBMemberNumber" ColumnGroupName="Name"><HeaderStyle Width="50px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" UniqueName="Last" ColumnGroupName="Name"><HeaderStyle Width="100px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FullName" HeaderText="Full Name" UniqueName="Full" ColumnGroupName="Name"><HeaderStyle Width="200px" /><HeaderStyle Width="100px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AdmitDate" HeaderText="Admit Date" UniqueName="AdmitDate" ColumnGroupName="Name"><HeaderStyle Width="25px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status" ColumnGroupName="Name"><HeaderStyle Width="15px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PrivateEmail" HeaderText="Private Email" UniqueName="PrivateEmail" ColumnGroupName="Emails"><HeaderStyle Width="100px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PublicEmail" HeaderText="Public Email" UniqueName="PublicEmail" ColumnGroupName="Emails"><HeaderStyle Width="100px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FirmName" HeaderText="Firm Name" UniqueName="FirmName" ColumnGroupName="Address"><HeaderStyle Width="100px" /></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Address" HeaderText="Address" UniqueName="Address" ColumnGroupName="Address"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City" ColumnGroupName="Address"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="State" HeaderText="State" UniqueName="State" ColumnGroupName="Address"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Country" HeaderText="Country" UniqueName="Country" ColumnGroupName="Address"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ZipCode" HeaderText="Zip Code" UniqueName="ZipCode" ColumnGroupName="Address"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" UniqueName="Phone" ColumnGroupName="Address"></telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <%--<asp:LinkButton ID="CustomMatch" runat="server" Text="Custom Match"></asp:LinkButton>--%>
 
            </div>
        </NestedViewTemplate>
 
        <EditFormSettings>
        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
 
        <PagerStyle PageSizes="5,10" PagerTextFormat="{4}Currently we have <strong>{5}</strong> members matching your search criteria"
            PageSizeLabelText="Members per page:" />
    </MasterTableView>
 
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
 
    <FilterMenu EnableImageSprites="False"></FilterMenu>
    <ExportSettings SuppressColumnDataFormatStrings="false" IgnorePaging="true" HideStructureColumns="true" OpenInNewWindow="true" ExportOnlyData="true">
        <Excel Format="Biff"></Excel>
    </ExportSettings>
</telerik:RadGrid>


protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
 
    }
}
 
protected void UnMatchedClientDBCustomers_TelerikRadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    List<ClientDBUnmatchedDetail> ClientDBUnmatchedDetails_UnMatchedCustomers_BindToTelerikRadGrid;
 
    using (ClientDBEntities ClientDBContext = new ClientDBEntities())
    {
        ClientDBUnmatchedDetails_UnMatchedCustomers_BindToTelerikRadGrid = ClientDBContext.ClientDBUnmatchedDetails.ToList();
    }
    UnMatchedClientDBCustomers_TelerikRadGrid1.DataSource = ClientDBUnmatchedDetails_UnMatchedCustomers_BindToTelerikRadGrid;
}
 
protected void PotentialMasterListDBMatches_TelerikRadGrid2_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
 
    GridDataItem parentItem = ((sender as RadGrid).NamingContainer as GridNestedViewItem).ParentItem as GridDataItem;
 
    var MemberID = parentItem.GetDataKeyValue("MemberID").ToString();
    string CustomerID = parentItem.GetDataKeyValue("CustomerID").ToString();
 
    List<UnMatchedMasterListDBMembers> MasterListDBUnMatchedDetails_PotentialMasterListDBMatches_BindToTelerikRadGrid = null;
 
    // If there is match between member numbers
    if (parentItem["MemberNoMatch"].Text == bool.TrueString)
    {
        decimal dMemberID = Convert.ToDecimal(MemberID);
 
        using (appsEntities appsEntitiescontext = new appsEntities())
        {
            MasterListDBUnMatchedDetails_PotentialMasterListDBMatches_BindToTelerikRadGrid = appsEntitiescontext.membership_all
                .Where(x => x.MemNumber == dMemberID)
                .Select(y => new UnMatchedMasterListDBMembers()
                {
                    ClientDBCustomerID = CustomerID,
                    MemberDetails = y
                }).ToList();
        }
 
    }
 
    // If there is match between email addresses
    else if (parentItem["EmailMatch"].Text == bool.TrueString)
    {
        string email = (parentItem["Email"].Text).Trim().ToLower().ToString();
        using (var appsEntitiescontext = new appsEntities())
        {
            MasterListDBUnMatchedDetails_PotentialMasterListDBMatches_BindToTelerikRadGrid = appsEntitiescontext.membership_all
                .Where(x => x.PrivateEmail.Trim().ToLower().ToString() == email || x.PublicEmail.Trim().ToLower().ToString() == email)
                .Select(y => new UnMatchedMasterListDBMembers()
                {
                    ClientDBCustomerID = CustomerID,
                    MemberDetails = y
                }).ToList();
        }
    }
 
    // If there is match between Last Names, then get the corresponding MasterDB members
    else if (parentItem["LastNameMatch"].Text == bool.TrueString)
    {
        string lastName = (parentItem["LastName"].Text).Trim().ToLower().ToString();
         
        using (var context = new appsEntities())
        {
            MasterListDBUnMatchedDetails_PotentialMasterListDBMatches_BindToTelerikRadGrid = context.membership_all
                .Where(x => x.LastName.Trim().ToLower() == lastName)
                .Select(y => new UnMatchedMasterListDBMembers()
                {
                    ClientDBCustomerID = CustomerID,
                    MemberDetails = y
                }).ToList();
        }
    }
 
    (sender as RadGrid).DataSource = MasterListDBUnMatchedDetails_PotentialMasterListDBMatches_BindToTelerikRadGrid;
}
 
protected void UnMatchedClientDBCustomers_TelerikRadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == "ExpandCollapse" && e.Item is GridDataItem)
    {
        GridDataItem parentItem_ClientDBCustomer_TelerikRADGrid1Row = e.Item as GridDataItem;
 
        RadGrid childItem_potentialMasterListDBMemberMatches_TelerikRADGrid2 = parentItem_ClientDBCustomer_TelerikRADGrid1Row.ChildItem.FindControl("PotentialMasterListDBMatches_TelerikRadGrid2") as RadGrid;
        //rg.ItemCommand += new GridCommandEventHandler(UpdateButton_Click);
        childItem_potentialMasterListDBMemberMatches_TelerikRADGrid2.Rebind();
    }
    else if (e.CommandName == "IgnoreButtonClick" && e.Item is GridDataItem)
    {
        string confirmValue = Request.Form["ConfirmIgnore"];
 
        if (confirmValue == "Yes")
        {
            GridDataItem item = e.Item as GridDataItem;
            var MemberID = item.GetDataKeyValue("MemberID").ToString();
            var CustomerID = item.GetDataKeyValue("CustomerID").ToString();
 
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (ClientDBEntities ClientDBContext = new ClientDBEntities())
                    {
                        // Find the ClientDB customer who's being ignored in the ClientDBUnmatchedDetails db table
                        ClientDBUnmatchedDetail ClientDBUnMatchedDetails_CustomerToBeIgnored = ClientDBContext.ClientDBUnmatchedDetails.Where(x => x.CustomerID == CustomerID).FirstOrDefault();
 
                        //check if customer is already in the ClientDBIgnore table
                        bool CustomerAlreadyExistsIn_ClientDBIgnore = false;
                        CustomerAlreadyExistsIn_ClientDBIgnore = ClientDBContext.ClientDBIgnore.Any(x => x.CustomerID == CustomerID);
 
                        if (!CustomerAlreadyExistsIn_ClientDBIgnore)
                        {
                            //add the Ignored ClientDB Customer to the ClientDBIgnore db table
                            ClientDBContext.ClientDBIgnore.AddObject(
                                new ClientDBIgnore()
                                {
                                    CustomerID = CustomerID.ToString(),
                                    MemberID = MemberID,
                                    FirstName = ClientDBUnMatchedDetails_CustomerToBeIgnored.FirstName,
                                    LastName = ClientDBUnMatchedDetails_CustomerToBeIgnored.LastName,
                                    Email = ClientDBUnMatchedDetails_CustomerToBeIgnored.Email,
                                    LoginID = ClientDBUnMatchedDetails_CustomerToBeIgnored.LoginID,
                                    Company = ClientDBUnMatchedDetails_CustomerToBeIgnored.Company,
                                    Address = ClientDBUnMatchedDetails_CustomerToBeIgnored.Address,
                                    City = ClientDBUnMatchedDetails_CustomerToBeIgnored.City,
                                    State = ClientDBUnMatchedDetails_CustomerToBeIgnored.State,
                                    PostalCode = ClientDBUnMatchedDetails_CustomerToBeIgnored.PostalCode,
                                    MemberNoMatch = ClientDBUnMatchedDetails_CustomerToBeIgnored.MemberNoMatch,
                                    LastNameMatch = ClientDBUnMatchedDetails_CustomerToBeIgnored.LastNameMatch,
                                    EmailMatch = ClientDBUnMatchedDetails_CustomerToBeIgnored.EmailMatch
                                }
                             );
                        }
                        // No need to do anything to the associated courses/credits information because they will already be in the ClientDBUnMatchedCreditDetails db table
 
                        //delete the Ignored ClientDB Customer from the ClientDBUnmatchedDetails db table
                        ClientDBContext.ClientDBUnmatchedDetails.DeleteObject(ClientDBUnMatchedDetails_CustomerToBeIgnored);
 
                        // Save changes
                        ClientDBContext.SaveChanges();
                        //scope.Complete();
                    }
                    scope.Complete();
                }
                UnMatchedClientDBCustomers_TelerikRadGrid1.Rebind();
 
                // If Transaction successfull and complete, notify the user
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('ClientDB Customer Ignored')", true);
            }
            catch (Exception Ex)
            {
                // In case of failure, notify the user
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Error Ignoring the ClientDB Customer. Try doin it again or please call IT HelpDesk')", true);
            }
        }
    }
 
}
 
public void MatchButton_Click(object sender, EventArgs e)
{
    string confirmValue = Request.Form["ConfirmMatch"];
    if (confirmValue == "Yes")
    {
        GridDataItem ClientDBCustomer_TelerikRADGrid1Row = ((LinkButton)sender).Parent.Parent as GridDataItem;
        var MemberID = ClientDBCustomer_TelerikRADGrid1Row["MasterListDBMemberNumber"].Text;
        var CustomerID = ClientDBCustomer_TelerikRADGrid1Row["ClientDBCustomerID"].Text;
 
        try
        {
            using (TransactionScope scope = new TransactionScope())
            {
                using (ClientDBEntities ClientDBContext = new ClientDBEntities())
                {
                    //find the manually matched ClientDB customer in the ClientDBUnmatchedDetails table
                    ClientDBUnmatchedDetail deleteClientDBUnMatchedMemberObject = ClientDBContext.ClientDBUnmatchedDetails.Where(x => x.CustomerID == CustomerID).Single();
 
                    // check if customer is already in the ClientDBRules tables
                    bool CustomerAlreadyExistsIn_ClientDBRules = false;
                    CustomerAlreadyExistsIn_ClientDBRules = ClientDBContext.ClientDBRules.Any(x => x.CustomerID == CustomerID);
 
                    if (!CustomerAlreadyExistsIn_ClientDBRules)
                    {
                        //add the manually matched ClientDB Customer to the ClientDBRules db table
                        ClientDBContext.ClientDBRules.AddObject(
                            new ClientDBRule()
                            {
                                CustomerID = CustomerID,
                                MemberID = MemberID,
                                FirstName = deleteClientDBUnMatchedMemberObject.FirstName,
                                LastName = deleteClientDBUnMatchedMemberObject.LastName,
                                Email = deleteClientDBUnMatchedMemberObject.Email,
                                LoginID = deleteClientDBUnMatchedMemberObject.LoginID,
                                Company = deleteClientDBUnMatchedMemberObject.Company,
                                Address = deleteClientDBUnMatchedMemberObject.Address,
                                City = deleteClientDBUnMatchedMemberObject.City,
                                State = deleteClientDBUnMatchedMemberObject.State,
                                PostalCode = deleteClientDBUnMatchedMemberObject.PostalCode,
                                MemberNoMatch = deleteClientDBUnMatchedMemberObject.MemberNoMatch,
                                LastNameMatch = deleteClientDBUnMatchedMemberObject.LastNameMatch,
                                EmailMatch = deleteClientDBUnMatchedMemberObject.EmailMatch
                            }
                         );
                    }
 
                    //find all matching courses/credits (and which will be removed) from the ClientDBUnMatchedCreditDetails table for this ClientDB customer
                    IQueryable<ClientDBUnMatchedCreditDetails> deleteClientDBUnmatchedCreditDetailsObjects = ClientDBContext.ClientDBUnMatchedCreditDetails.Where(x => x.CustomerID == CustomerID);
 
                    //for each matching course in the ClientDBUnMatchedCreditDetails table
                    foreach (ClientDBUnMatchedCreditDetails deleteClientDBUnmatchedCreditDetailsObject in deleteClientDBUnmatchedCreditDetailsObjects)
                    {
                        //if course does not exist in ClientDBCreditDetails table, add that course to ClientDBCreditDetails
                        bool courseAlreadyExistsInClientDBCreditDetails = false;
                        //courseAlreadyExistsInClientDBCreditDetails = ClientDBContext.ClientDBCreditDetails.Where(x => x.RegistrationID == deleteClientDBUnmatchedCreditDetailsObject.RegistrationID).SingleOrDefault() != null;
                        courseAlreadyExistsInClientDBCreditDetails = ClientDBContext.ClientDBCreditDetails.Any(x => x.RegistrationID == deleteClientDBUnmatchedCreditDetailsObject.RegistrationID);
 
                        if (!courseAlreadyExistsInClientDBCreditDetails)
                        {
                            //add course to ClientDBCreditDetails
                            ClientDBContext.ClientDBCreditDetails.AddObject(
                                new ClientDBCreditDetail()
                                {
                                    RegistrationID = deleteClientDBUnmatchedCreditDetailsObject.RegistrationID,
                                    CustomerID = deleteClientDBUnmatchedCreditDetailsObject.CustomerID,
                                    MemberID = deleteClientDBUnmatchedCreditDetailsObject.MemberID,
                                    CreditType = deleteClientDBUnmatchedCreditDetailsObject.CreditType,
                                    TotalHours = deleteClientDBUnmatchedCreditDetailsObject.TotalHours,
                                    General = deleteClientDBUnmatchedCreditDetailsObject.General,
                                    Ethics = deleteClientDBUnmatchedCreditDetailsObject.Ethics,
                                    Bias = deleteClientDBUnmatchedCreditDetailsObject.Bias,
                                    SubstanceAbuse = deleteClientDBUnmatchedCreditDetailsObject.SubstanceAbuse,
                                    Other = deleteClientDBUnmatchedCreditDetailsObject.Other,
                                    ProductID = deleteClientDBUnmatchedCreditDetailsObject.ProductID,
                                    ProductTitle = deleteClientDBUnmatchedCreditDetailsObject.ProductTitle,
                                    CompletionDate = deleteClientDBUnmatchedCreditDetailsObject.CompletionDate,
                                }
                            );
                        }
                        // else
                        // do nothing
 
                        // and then delete that course from the ClientDBUnMatchedCreditDetails table
                        ClientDBContext.ClientDBUnMatchedCreditDetails.DeleteObject(deleteClientDBUnmatchedCreditDetailsObject);
                    }
 
                    //delete the manually matched ClientDB Customer from ClientDBUnmatchedDetails db table
                    ClientDBContext.ClientDBUnmatchedDetails.DeleteObject(deleteClientDBUnMatchedMemberObject);
 
                    //save changes to the db
                    ClientDBContext.SaveChanges();
                    //scope.Complete();
                }
                scope.Complete();
            }
 
            UnMatchedClientDBCustomers_TelerikRadGrid1.Rebind();
 
            // If Transaction successfull and complete, notify the user
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Match Successful')", true);
 
        }
        catch (Exception Ex)
        {
            // In case of failure, notify the user
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Error Executing the match rule. Try doing it again or please call IT HelpDesk')", true);
        }
    }
 
}



Tayyab
Top achievements
Rank 1
 answered on 02 Oct 2013
2 answers
80 views

I'm trying to get Knockout to work the treeview so I needed to get the "data-bind" attribute added to the checkbox that is generated.

I couldn't get it to work in the NodeDataBound when using e.Node.Attributes.Add("data-bind", "myBinding: myObservableArray")...This wasn't being added to the actual HTML which Knockout needs.

So I tried using the NodeTemplate to be able to customize the HTML checkboxes.  Anyway, Child elements are checked when it's parent is using NodeTemplates with "CheckChildNodes = true"

 

<NodeTemplate>

 <input type="checkbox" value="<%# DataBinder.Eval(Container, "Id") %>" data-bind="myBinding: myObservableArray" />

....

 

 

 

 

 

Boyan Dimitrov
Telerik team
 answered on 02 Oct 2013
3 answers
58 views

How to For Each in RadWebControl with page or master page .

I need  For Each  control in page.RadWebControl. and Add ID and text in RadListBox1

Example :

RadListBox1.Items.Add(New RadListBoxItem(control .ID))
RadListBox1.Items.Add(New RadListBoxItem(control .text))




Mohammed
Top achievements
Rank 1
 answered on 02 Oct 2013
1 answer
40 views
Hi ,
How can I localize the radGrid class in order to change the name of properties ? I thought about making a partial class.

for example, I have the following commands;

      grid.GroupPanel.Text = "גרור עמודה שתרצה לקבץ לפיה";
            grid.GroupPanel.ToolTip = "גרור עמודה שתרצה לקבץ לפיה";
            grid.SortingSettings.SortToolTip = "לחץ כאן כדי למיין לפי שדה זה";
            grid.SortingSettings.SortedAscToolTip = "מיין בסדר עולה";

I know there is also another way of using the culture and  a radGrid.he.resx file  (Hebrew) but it is not working either.

I will appreciate your help very much.

Thanks,
Tal

Angel Petrov
Telerik team
 answered on 02 Oct 2013
1 answer
56 views
Hi, I've got this code:

function OnClientFileOpen(oExplorer, args) {
        var isDirectory = args.get_item().isDirectory();

        if (!isDirectory) {
            var fileExt = args.get_item().get_extension();
                args.set_cancel(true);
                var itemPath = args.get_item().get_path();
                window.open(encodeURIComponent(itemPath));
        }
    }

When I try to open a file with a & in the path, locally it opens fine, however, if I try it on the server, it can't find the file.
I think it gives a 404 error.
So what can I do?
Vessy
Telerik team
 answered on 02 Oct 2013
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?