I could not find any api on the client-side to add an entry to the RadDropdownTree. Is this possible and if yes, then what would be some sample code? AutoPostBack property of RadDropdownTree is false, so I need to use client-side code.
I did find a method on the client side, but not sure how to use it. The api I found on my own is as below, but not sure what parameter can I pass to it and whether it will end up updating the dropdown tree automatically.
dropDownTree.get_entries()._add
When checking an element that has many child elements (> 30.000) it takes a while until that element becomes checked.
Found that some Telerik's Javascript code is being executed for all 30.000 elements (even nothing is being done with them from our perspective).
Example: when Option11 checkbox is clicked, page becomes unresponsive and it takes approx. 30 seconds to become checked.
Can we get some feedback why this is happening?
Thx in advance
The DropDownTree doesn't have FitInInput functionality, so what would be the way to create this functionality?
I've tried things like updating the text using `OnClientEntryAdded` and `set_defaultMessage()` but once that function has run in my JavaScript, the original text items that were selected just show back up.
What do I need to do?
Hi,
My grid is in EditMode="Batch" and RadDropDownTree in GridTemplateColumn behaves funky.
Am i missing anything?
Thank you
David
I have telerik:RadDropDownTree with Product and child nodes level like this.
Please help me, when I check Product then All product checked.
So how can when I check Product then just check only all nodes first-level.
<telerik:RadDropDownTree runat="server" ID="rcbPro" Skin="Silk" Width="685px"
DefaultMessage="Select products" DefaultValue="0" ButtonSettings-ShowCheckAll="true" ButtonSettings-ShowClear="true"
DataTextField="Name" DataFieldID="Id" CheckBoxes="CheckChildNodes" DataValueField="Id" DataFieldParentID="Parent"
EnableFiltering="true" FilterSettings-Filter="Contains" FilterSettings-EmptyMessage="Input" FilterSettings-Highlight="Matches">
</telerik:RadDropDownTree>
I have a radgrid that binds an object stored in the ViewState (Case). When I click on the radgrid's "Add" button (firing the OnInsertCommand) I get the following error: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'LookupValue'.' The specific control I am having problems with is the RadDropDownTree, and only when its definition contains this "SelectedValue='<%# Bind("LookupValue.Code") %>'"
I do not understand why this is happening. What is so different now that my radgrid is binding to a object that contains a subobject?? What do I need to be doing differently?
Just as an fyi, I do not get this error when the OnUpdateCommand fires. Below is my code.
<telerik:RadGrid ID="gvAllegations" runat="server"
AllowAutomaticDeletes="false"
AllowAutomaticInserts="false"
AllowAutomaticUpdates="false"
AllowFilteringByColumn="false"
AllowMultiRowEdit="false"
AllowMultiRowSelection="false"
AllowPaging="false"
AllowSorting="false"
AutoGenerateColumns="false"
OnNeedDataSource="gvAllegations_NeedDataSource"
OnInsertCommand="gvAllegations_InsertCommand"
OnUpdateCommand="gvAllegations_UpdateCommand">
<ClientSettings Selecting-AllowRowSelect="true" />
<GroupingSettings CaseSensitive="false" />
<MasterTableView
CommandItemDisplay="Top"
DataKeyNames="CaseAllegationID"
ClientDataKeyNames="CaseAllegationID">
<Columns>
<telerik:GridBoundColumn UniqueName="AllegationType" DataField="Type" HeaderText="Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
<telerik:GridBoundColumn UniqueName="AllegationCodeDescription" DataField="LookupValue.CodeDescription" HeaderText="Allegation" />
</Columns>
<CommandItemTemplate>
<div class="CommandButtonDiv">
<asp:LinkButton ID="LinkButton2" runat="server"
CssClass="CommandButton"
CommandName="InitInsert"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/AddRecord.png"/> Add
</asp:LinkButton>
<asp:LinkButton ID="btnEditSelected" runat="server"
CssClass="CommandButton"
CommandName="EditSelected"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/Edit.png" /> Edit
</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server"
CssClass="CommandButton"
CommandName="DeleteSelected"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/Delete.png"/> Delete
</asp:LinkButton>
<asp:LinkButton ID="LinkButton4" runat="server"
CssClass="CommandButton"
CommandName="RebindGrid"
Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
<img src="Images/Refresh.png"/> Refresh
</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server"
CssClass="CommandButton"
CommandName="PerformInsert" Visible='<%# gvAllegations.MasterTableView.IsItemInserted %>'>
<img src="Images/Insert.gif"/> Save
</asp:LinkButton>
<asp:LinkButton ID="LinkButton5" runat="server"
CssClass="CommandButton"
CommandName="UpdateEdited" Visible='<%# gvAllegations.EditIndexes.Count > 0 %>'>
<img src="Images/Update.png"/> Update
</asp:LinkButton>
<asp:LinkButton ID="btnCancel" runat="server"
CssClass="CommandButton"
CommandName="CancelAll" Visible='<%# gvAllegations.MasterTableView.IsItemInserted || gvAllegations.EditIndexes.Count > 0 %>'>
<img src="Images/Cancel.png"/> Cancel
</asp:LinkButton>
</div>
</CommandItemTemplate>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table style="width: 100%">
<tr>
<td>Allegation</td>
<td>
<telerik:RadDropDownTree ID="ddtAllegation" runat="server"
AutoPostBack="False"
DataFieldId="Code"
DataFieldParentID="ParentCode"
DataValueField="Code"
DataSourceID="odsAllegationLookupValues"
DataTextField="CodeDescription"
EnableFiltering="True"
ExpandNodeOnSingleClick="True"
SelectedValue='<%# Bind("LookupValue.Code") %>'
Width="300px">
<DropDownSettings AutoWidth="Enabled" CloseDropDownOnSelection="true" />
<FilterSettings EmptyMessage="Search Allegation" Filter="Contains" Highlight="Matches" />
</telerik:RadDropDownTree>
</td>
</tr>
<tr>
<td>Major Allegation</td>
<td><telerik:RadCheckBox ID="chbMajorAllegation" runat="server"
AutoPostBack="False" Checked='<%# Bind("IsMajor") %>' /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<telerik:RadButton ID="btnInsert" runat="server"
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
Width="100px" />
<telerik:RadButton ID="btnCancel" runat="server"
Text="Cancel"
CommandName="Cancel"
Width="100px" />
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
[Serializable]
public class Case
{
public int ID { get; set; }
public List<Allegation> Allegations { get; set; }
}
[Serializable]
public class Allegation
{
public int CaseAllegationID { get; set; }
public bool IsMajor { get; set; }
public string Type
{
get
{
if (IsMajor)
return "Major";
else
return "Other";
}
}
public LookupValue LookupValue { get; set; }
}
[Serializable]
public class LookupValue
{
public string Code { get; set; }
public string Description { get; set; }
public string CodeDescription { get { return Code + " - " + Description; } }
public string ParentCode { get; set; }
public int DimID { get; set; }
public DateTime DimStartDate { get; set; }
public DateTime DimEndDate { get; set; }
public bool DimIsActive { get; set; }
}
protected void gvAllegations_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
gvAllegations.DataSource = ((Case)ViewState["rcaCase"]).Allegations;
}
protected void gvAllegations_InsertCommand(object sender, GridCommandEventArgs e)
{
}
Hello everyone!
I've got the below RadSiteMap being coded from codebehind (VB). I want to add small icons to the left of each submenu's text however I do not know how. The ImageUrl property apparently does not exist for the RadSiteMap and I cannot think of another way to insert my icons.
Check the attached screenshot to see how my menu looks like and where would I want to add icons. I basically want to add them into the titles and then a different icon to each submenu as well.
Note: My RadMenu is being populated entirely from a database (all of it, parent and childs). If you wish to see the code for a better understanding, I can also leave that in the comments.
Thanks a lot!
Private Function CreateSiteMap(ByVal container As Control, ByVal Id As String) As RadSiteMap
Try
System.Diagnostics.Debug.WriteLine("id: " &Id)
Dim acd As New SiteWeb.AccesDonnees
'On créer le controle de type RadSiteMap
Dim SiteMap1 As New RadSiteMap
'On le configure comme souhaité
SiteMap1.ID = "SiteMapMenu"
SiteMap1.DataTextField = "Libelle"
SiteMap1.DataFieldID = "Identifiant"
SiteMap1.DataFieldParentID = "Parent"
SiteMap1.DataValueField = "Libelle"
SiteMap1.DataNavigateUrlField = "Lienpage"
'This sql receives all the submenus under the current Parent menu
SiteMap1.DataSource =
acd.RetournerDataReader("SELECT RTRIM(Identifiant) as Identifiant,RTrim(Libelle) As Libelle,RTrim(Parent) as Parent,RTRIM(Lienpage) as Lienpage,RTRIM(ParentGlobal) As ParentGlobal FROM lobdjetBDD WHERE NomUser = '" & hf_fonction.Value & "' AND (Parent = '" & Id & "' OR ParentGlobal = '" & Id & "' OR Identifiant = '" & Id & "') Order By Libelle, ChapitreParentGlobal, ChapitreParent,ChapitreEnfant", "EU_BREST")
SiteMap1.DataBind()
[.....] I removed this part of the code to make my post smaller on the forums.
container.Controls.Add(SiteMap1)
Return SiteMap1
Catch ex As Exception
Return Nothing
Exit Function
End Try
End Function
Hi, I'm trying to put focus on filter input in DropdownTree control when dropdown is opened but I can't get it. I've tryed with some code like this but without success:
JS:
function SetFilterFocus(sender,argEvent){
sender.get_filterElement().focus();
}
ASP.NET
<telerik:RadDropDownTree CssClass="RadComboBox_Metro" Skin="Metro" runat="server" ID="ddt_centro" AutoPostBack="true" Width="90%" TabIndex="3" DataTextField="FMODES" DataFieldID="FMOFAM" TextMode="Default" DataFieldParentID="FMOZU1" OnClientEntryAdding="OnClientEntryAdding" ExpandNodeOnSingleClick="true" CheckNodeOnClick="true" EnableFiltering="true" OnClientDropDownOpened="SetFilterFocus">
<FilterSettings Filter="Contains" Highlight="Matches" MinFilterLength="3" />
<DropDownSettings CssClass="RadComboBox_Metro" Height="300px" CloseDropDownOnSelection="true" />
</telerik:RadDropDownTree>
Is it possible to do this?
Thanks
Hello,
I want to filter my RadDropDownTree using multiple strings delimited by a space.
I have modified a script but it isn't working quite right.
Note the pic below. I want to match on both "balances" and "sspro" or "ssedge" or "ss.com"
When I add a space and an "s" then nothing is retrieved:
However, when I type in "balances t" I get some results but actually should get all lines that have "balances" and "t". There should be a lot more results:
Here is the script I'm using:
var $T = Telerik.Web.UI;
Telerik.Web.UI.RadDropDownTree.Manager.prototype._filterNodes = function (text) {
var nodes = this._embeddedTree.get_allNodes(),
count = nodes.length,
regEx,
i;
var EnteredText = text.split(" ");
if (EnteredText[1] == null) {
EnteredText[1] = "";
}
if (this._filter == $T.DropDownTreeFilter.StartsWith)
/* regEx = new RegExp("^\\s*" + $T.RadDropDownTree.Manager._regExEscape(text), "im");*/
regEx = new RegExp("^\\s*(?=.*" + EnteredText[0] + ")(?=.* " + EnteredText[1] + ").*$", "im");
else
/* regEx = new RegExp($T.RadDropDownTree.Manager._regExEscape(text), "gim");*/
regEx = new RegExp("^(?=.*" + EnteredText[0] + ")(?=.* " + EnteredText[1] + ").*$", "gim");
/* alert(regEx);*/
for (i = 0; i < count; i++) {
var currentNode = nodes[i];
var matchIsFound;
if (currentNode.get_level() !== 2)
{
matchIsFound = false;
/*alert(currentNode.get_text());*/
}
else
{
matchIsFound = this._matchNode(currentNode, EnteredText, regEx);
// alert(currentNode.get_text());
}
if (matchIsFound)
{
this._handleVisibleParents(currentNode);
this._filteredVisibleNodes.push(currentNode);
}
else
{
this._handleHiddenNode(currentNode);
}
}
this._hideNodes(this._filteredHiddenNodes);
this._showNodes(this._filteredVisibleNodes);
this._filteredVisibleNodes = [];
this._filteredHiddenNodes = [];
}
Thanks!
--Clark
Hello,
I would like to display the filter results of only the 3rd level nodes of my radDropDownTree.
In the example below, I only want 3rd level nodes that have "web" in their text field displayed.
I've marked out what I don't want to see.
Thanks!
--Clark