Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
469 views
I have an application and when the user hit a button I want to clear the selected nodes in the treeview.  I have tried SelectedNodes.Clear() but the selects remain.
Vessy
Telerik team
 answered on 04 Sep 2020
1 answer
336 views

Hello,

 

I would like my tooltip not to show the x an y coordinates on my ScatterSeries, but another string (ProjectName). ProjectName is a column in my datatable that I'm using as the source.

 

Can you please tell me what's wrong  with the following code? It shows undefined when I hover over a plot item.

 scatterSeries.TooltipsAppearance.ClientTemplate = "#=dataItem.projectname#";

 

Thank you

Vessy
Telerik team
 answered on 04 Sep 2020
5 answers
503 views

Hi All,

I have a templated combobox like so:

<telerik:RadComboBox id="ddlProgressiveInterventionBehaviour" Width="450px" Skin="Bootstrap" runat="server"
                                                DataTextField="Description" Height="400" DataValueField="ID" AutoPostBack="true" HighlightTemplatedItems="true">
                                            <HeaderTemplate>
                                                <table  >
                                                    <tr>
                                                        <td style="width: 200px;">
                                                            Policy For Success</td>
                                                        <td style="width: 80px;">
                                                            Risk Level</td>
                                                        <td style="width:300px;">
                                                            Behaviour</td>
                                                        <td style="width: 40px;">
                                                            Points</td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <table  >
                                                    <tr>
                                                        <td style="width: 200px;">
                                                            <%# DataBinder.Eval(Container.DataItem, "PolicyForSuccessName")%>
                                                        </td>
                                                        <td style="width: 80px;">
                                                            <%# DataBinder.Eval(Container.DataItem, "InitialRiskLevelName")%>
                                                        </td>
                                                        <td style="width: 300px;">
                                                            <%# DataBinder.Eval(Container.DataItem, "Name")%>
                                                        </td>
                                                        <td style="width: 40px;">
                                                            <%# DataBinder.Eval(Container.DataItem, "RiskLevelPointsEachInstance")%>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </telerik:RadComboBox>

 

The radcombo is databound to a generic list of objects that have the attributes listed.  I can easily add a cssclass name attrbute to each object int the list or a hexcolor attribute etc.  When rendered it looks like the attached file.  My question is assuming I have a cssclass called .makered {..}  how do I apply it to items that have a level of 3 on the risklevel column for ONLY the risk level column in the template,  ie, for specific columns and specific items.  Applying the class to the whole row would work fine too.  Items are databound...not added in the markup.  Also any help lining up the columns would be helpful.

Thanks!

 

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 03 Sep 2020
2 answers
123 views

I am trying to open the context menu of a DetailTable in the MasterTableView. There is only 1 table and it has the columns that we want the users to select columns. Honestly, this should be something out of coding, like as header option. RIght clicking is not something the user would know, unless told. A button is perfectly normal. So i tried a button and it doesnt open the Context Menu of the GridTableView nested in the MasterTableView

 

 

 

 

<telerik:RadButton runat="server" AutoPostBack="false" OnClientClicked="ShowMenu" Text="Column Chooser" RenderMode="Lightweight" />
 
<telerik:RadGrid runat="server" ID="RadGridMembers"...

    <MasterTableView runat="server".... 

       <DetailTables>

           <telerik:GridTableView Name="MemberDetailTable"....

</telerik:GridTableView>

</DetailTables>
</MasterTableView>
</telerik:RadGrid>

 

 

 

 

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 03 Sep 2020
9 answers
226 views
<rade:radeditor> control is not rendered properly in Firefox where it's working fine in IE and Chrome. Observed one thing by comparison with other browsers is that the functions which are in radEditor.js are hitting fine for other browsers but not Firefox. In Firefox we can see it's only hitting starting point in js file after that it's not hitting functions like RadEditorInitilaize() etc..Please respond as soon as possible.
Manaswi
Top achievements
Rank 1
 answered on 03 Sep 2020
16 answers
4.4K+ views

Failed to create designer 'Telerik.Web.UI.RadMonthYearPicker, Telerik.web.UI, Version=2018.1.117.45

and other Control example "Failed to create designer 'Telerik.Web.UI.RadMonthYearPicker, Telerik.web.UI, Version=2018.1.117.45"

How can I do in this Queation?

Vessy
Telerik team
 answered on 03 Sep 2020
11 answers
242 views
I want to hide the tab area ussing css.  After upgrading to the new controls the tab area now displays at full height with no text.  Before is was only a few pixels high with no tab text.
Vessy
Telerik team
 answered on 03 Sep 2020
4 answers
211 views

Receiving the following error:

JavaScript runtime error: Sys.ArgumentException: Cannot deserialize empty string

Parameter name: data

The custom save javascript does the following:

var fileName = imageEditor.get_serverImageUrl();

imageEditor.saveImageOnServer(fileName, true);

The server-side code is as follows:


If e.FileName <> "" Then

   Dim img As ImageEditor.EditableImage = e.Image.Clone()

   Dim strFilePath As String = Server.MapPath(e.FileName)

   e.OverwriteFile = True

   img.Image.Save(strFilePath)







   e.Cancel = True

End If






Josh
Top achievements
Rank 1
Veteran
 answered on 02 Sep 2020
9 answers
1.1K+ views
Hi all,

I am trying to create an Ajax Telerik grid in Razor that has an updateable foreign key column that shows a dropdown list. I've copied my page pretty much like the example, and everything works. I can add new records, delete them and edit them. The only thing that doesn't work is that I get a textfield with the integer when I update a record in my grid, instead of a dropdown list with all the possibilities of the foreign key table.

Anyone have any ideas on how I could fix this? See code below.

Telerik grid:
@(Html.Telerik().Grid<EditableAccount>()
    .Name("Grid")
    .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" }))
    .DataBinding(dataBinding => dataBinding.Ajax()
        .Insert("InsertAccount", "Administration")
        .Update("SaveAccount", "Administration")
        .Delete("DeleteAccount", "Administration"))
    .DataKeys(keys => { keys.Add(a => a.AccountId); })
    .Columns(columns =>
    {
        columns.ForeignKey(b => b.BankId, (IEnumerable)ViewData["Banks"], "ID", "Name").Width(50);
        columns.Bound(a => a.AccountNumber).Width(110);
        columns.Command(commands =>
        {
            commands.Edit().ButtonType(GridButtonType.Image);
            commands.Delete().ButtonType(GridButtonType.Image);
        }).Width(16);
    })
    .Editable(editing => editing.Mode(GridEditMode.InLine))
    .Pageable()
    .Scrollable()
    .Sortable()
)

Controller:
[GridAction]
public ActionResult Accounts()
{
    ViewData["Banks"] = db.Banks.Select(b => new { Id = b.BankId, Name = b.Name });
    return View(new GridModel(accountRepository.All()));
}
 
[AcceptVerbs(HttpVerbs.Post)]
[GridAction]
public ActionResult InsertAccount()
{
    //Create a new instance of the EditableProduct class.
    EditableAccount account = new EditableAccount();
 
    //Perform model binding (fill the product properties and validate it).
    if (TryUpdateModel(account))
    {
        //The model is valid - insert the product.
        accountRepository.Insert(account);
    }
 
    //Rebind the grid
    return View(new GridModel(accountRepository.All()));
}
 
[AcceptVerbs(HttpVerbs.Post)]
[GridAction]
public ActionResult SaveAccount(int id, int bankId)
{
    EditableAccount account = new EditableAccount
    {
        AccountId = id,
        Bank = db.Banks
                   .Where(b => b.BankId == bankId)
                   .Select(b => b.Name).SingleOrDefault(),
        BankId = bankId
    };
 
    TryUpdateModel(account);
 
    accountRepository.Update(account);
 
    return View(new GridModel(accountRepository.All()));
}
 
[AcceptVerbs(HttpVerbs.Post)]
[GridAction]
public ActionResult DeleteAccount(int id)
{
    //Find a customer with ProductID equal to the id action parameter
    EditableAccount account = accountRepository.One(a => a.AccountId == id);
 
    if (account != null)
    {
        //Delete the record
        accountRepository.Delete(account);
    }
 
    //Rebind the grid
    return View(new GridModel(accountRepository.All()));
}

Model:
public class EditableAccount
{
    [ScaffoldColumn(false)]
    public int AccountId { get; set; }
 
    [Required]
    [UIHint("GridForeignKey")]
    [DisplayName("Bank")]
    public int BankId { get; set; }
    public string Bank { get; set; }
 
    [Required]
    [DisplayName("AccountNumber")]
    public int AccountNumber { get; set; }
}


Repository:

public IList<EditableAccount> All()
{
    IList<EditableAccount> result =
            (from account in db.Accounts
             select new EditableAccount
             {
                 AccountId = account.AccountId,
                 Bank = account.Bank.Name,
                 BankId = account.BankId,
                 AccountNumber = account.AccountNr
             }).ToList();
 
    return result;
}
 
/// <summary>
/// Ones the specified predicate.
/// </summary>
/// <param name="predicate">The predicate.</param>
/// <returns></returns>
public EditableAccount One(Func<EditableAccount, bool> predicate)
{
    return All().Where(predicate).FirstOrDefault();
}
 
/// <summary>
/// Inserts the specified account.
/// </summary>
/// <param name="account">The account.</param>
public void Insert(EditableAccount insertedAccount)
{
    Account account = new Account();
    account.BankId = insertedAccount.BankId;
    account.AccountNr = insertedAccount.AccountNumber;
    db.Accounts.InsertOnSubmit(account);
    db.SubmitChanges();
}
 
/// <summary>
/// Updates the specified account.
/// </summary>
/// <param name="account">The account.</param>
public void Update(EditableAccount updatedAccount)
{
    Account account = db.Accounts.SingleOrDefault(a => a.AccountId == updatedAccount.AccountId);
    account.BankId = updatedAccount.BankId;
    account.AccountNr = updatedAccount.AccountNumber;
    db.SubmitChanges();
}
 
/// <summary>
/// Deletes the specified account.
/// </summary>
/// <param name="account">The account.</param>
public void Delete(EditableAccount deletedAccount)
{
    Account account = db.Accounts.SingleOrDefault(a => a.AccountId == deletedAccount.AccountId);
    db.Accounts.DeleteOnSubmit(account);
    db.SubmitChanges();
}
Raja Patukuri
Top achievements
Rank 1
 answered on 02 Sep 2020
28 answers
763 views
Hello, I just updated to the Q3 release and I now can't seem to save my edited image with the RadImageEditor. After I crop an image and use the SaveEditableImage (server side) I can only save the original image. I have also tried getting the editable image first using GetEditableImage() but it too returns the original image.

Thanks,
Vessy
Telerik team
 answered on 02 Sep 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?