Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
118 views
In a filter section the filter menu shows

No Filter
Contains
DoesNotContain
.
.
.
.
.
.
.
IsNull
IsNotNull

My question is how can i remove some entries on the filter menu..
for example..

the IsNull and IsNotNull filter expressions

thanks

Chamira
Top achievements
Rank 1
 answered on 19 Sep 2008
2 answers
239 views
Hello all,

I've looked through the site a bit and found some info, but nothing that was exactly my problem, so here goes.

I have two treeviews TreeViewStart and TreeViewEnd. TreeViewStart is used kind of like a source for children. I have built this to be Load On Demand, and that part works wonderfully. I have also built it so that I can drag and drop a node and all its children to TreeViewEnd. That also works fine.

My problem, is that after the user has selected how the treeview should be (TreeViewEnd) using nodes from TreeViewStart, I needed to get the xml of that tree. So when the user clicks a button at the bottom I run the .GetXml function and get back my string. The problem with this is that I only get back information on the already expanded nodes. I believe this problem to be due to the load on demand and the non-existance of child nodes. The .ExpandAll() doesnt seem to work for me probably for the same reason.

Is there a way to make it so that when the user clicks the "Complete" button, that it will Expand all nodes on TreeViewEnd so that the .GetXml return string is accurate without forcing the user to click through all the child nodes? Below are some snippets of code.

Thanks in advance.

    <table border="1" cellspacing="0" cellpadding="0" width="100%"><tr> 
        <!-- FROM --> 
        <td align="left" valign="middle" width="49%">  
            <rad:RadTreeView ID="TreeViewStart" EnableDragAndDrop="True" OnNodeDrop="RadTreeView1_HandleDrop" LoadingStatusPosition="BelowNodeText" OnNodeExpand="TreeViewStart_NodeExpand" OnNodeClick="TreeViewStart_NodeClick" runat="server">  
                <Nodes> 
                    <rad:RadTreeNode Text="Home" ExpandMode="ServerSideCallBack" Value="-1" /> 
                </Nodes> 
            </rad:RadTreeView> 
        </td> 
          
        <!-- SPACER --> 
        <td width="2%" /> 
          
        <!-- TO --> 
        <td align="left" valign="middle" width="49%">  
            <rad:RadTreeView ID="TreeViewEnd" EnableDragAndDrop="True" LoadingStatusPosition="BelowNodeText" OnNodeExpand="TreeViewEnd_NodeExpand" OnNodeClick="TreeViewStart_NodeClick" runat="server">  
                <Nodes> 
                    <rad:RadTreeNode Text="Home" ExpandMode="ServerSideCallBack" Value="-1" /> 
                </Nodes> 
            </rad:RadTreeView> 
        </td> 
    </tr></table>  
      
    <br /> 
    <br /> 
    <br /> 
    <asp:Button ID="btnGetXML" Text="Get XML String" OnClick="btnGetXML_Click" runat="server" /> 

    #region "Private Methods"  
    private void LoadChildNodes(usp_Selectappdata_Role_Recursive NodeRequest, ref RadTreeNodeEventArgs e)  
    {  
        Selectappdata_Role_RecursiveDS.usp_Selectappdata_Role_RecursiveDataTable ChildNodes = Vault<LookUpUtil>().RoleTreeViewSelect(NodeRequest);  
 
        foreach (Selectappdata_Role_RecursiveDS.usp_Selectappdata_Role_RecursiveRow row in ChildNodes)  
        {  
            RadTreeNode node = new RadTreeNode();  
            node.Text = row.RoleName;  
            node.Value = row.AppdataRoleId.ToString();  
            if (row.ChildCount > 0)  
            {  
                node.ExpandMode = TreeNodeExpandMode.ServerSide;  
            }  
            e.Node.Nodes.Add(node);  
        }  
        e.Node.Expanded = true;  
    }
    #endregion  
 
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
 
    protected void TreeViewStart_NodeExpand(object sender, RadTreeNodeEventArgs e)  
    {  
        usp_Selectappdata_Role_Recursive NodeRequest = new usp_Selectappdata_Role_Recursive();  
 
        if (e.Node.Value != "-1")  
        {  
                NodeRequest.Rolelevel = 1;  
                NodeRequest.RoleLevelCriteria = "=";  
                NodeRequest.AppdataRoleId = Convert.ToInt32(e.Node.Value);  
        }  
        else 
        {  
            {  
                NodeRequest.Rolelevel = 0;  
                NodeRequest.RoleLevelCriteria = "=";  
            }  
        }  
 
        LoadChildNodes(NodeRequest, ref e);  
    }  
 
    protected void TreeViewEnd_NodeExpand(object sender, RadTreeNodeEventArgs e)  
    {  
        usp_Selectappdata_Role_Recursive NodeRequest = new usp_Selectappdata_Role_Recursive();  
 
        if (e.Node.Value != "-1")  
        {  
            NodeRequest.Rolelevel = 1;  
            NodeRequest.RoleLevelCriteria = "=";  
            NodeRequest.AppdataRoleId = Convert.ToInt32(e.Node.Value);  
 
            LoadChildNodes(NodeRequest, ref e);  
        }  
    }  
 
    protected void TreeViewStart_NodeClick(object sender, RadTreeNodeEventArgs e)  
    {  
 
    }  
 
    protected void RadTreeView1_HandleDrop(object sender, RadTreeNodeDragDropEventArgs e)  
    {  
        RadTreeNode sourceNode = e.SourceDragNode;  
        RadTreeNode destNode = e.DestDragNode;  
        RadTreeViewDropPosition dropPosition = e.DropPosition;  
 
        string result = "";  
 
        if (destNode != null)//drag&drop is performed between trees  
        {  
            if (sourceNode.TreeView.SelectedNodes.Count <= 1)  
            {  
 
                if (!sourceNode.IsAncestorOf(destNode))  
                {  
                    //result += "<b>" + sourceNode.Text + "</b>" + ";";  
                    sourceNode.Owner.Nodes.Remove(sourceNode);  
                    destNode.Nodes.Add(sourceNode);  
                }  
            }  
            else if (sourceNode.TreeView.SelectedNodes.Count > 1)  
            {  
                foreach (RadTreeNode node in TreeViewStart.SelectedNodes)  
                {  
                    if (!node.IsAncestorOf(destNode))  
                    {  
                        //result += "<b>" + node.Text + "</b>" + ";";  
                        node.Owner.Nodes.Remove(node);  
                        destNode.Nodes.Add(node);  
                    }  
                }  
            }  
 
            destNode.Expanded = true;  
            //DragMessage.Text = "You dragged node(s)" + result + " onto node <b>" + destNode.Text + "</b>";  
            sourceNode.TreeView.ClearSelectedNodes();  
        }  
    }  
 
    protected void btnGetXML_Click(object sender, EventArgs e)  
    {  
        string preFix = TreeViewEnd.GetXml();  
        //preFix.Replace("<", "&lt;");  
        //preFix.Replace(">", "&gt;");  
        lblXMLString.Text = "Code: " + preFix;  
 
        System.IO.TextWriter asd = new System.IO.StreamWriter(@"C:\exper\test.txt");  
        asd.Write(preFix);  
        asd.Close();  
    } 
Esteban
Top achievements
Rank 1
 answered on 19 Sep 2008
2 answers
135 views
I am having problems creating a ItemTemplate for a user control.

The following code is what I have roughed out and can't get it to work. I am trying to create an anchor based on the the dataTable I have bound to the the RadRotator.


Here is my template code
Thanks in advance.

public class RotatorTemplate : ITemplate

{

private Control _container;

public void InstantiateIn(Control container)

{

_container = container;

Literal contents =

new Literal();

contents.DataBinding +=

new EventHandler(contents_DataBinding);

container.Controls.Add(contents);

}

private void contents_DataBinding(object sender, EventArgs e)

{

Literal contents = sender

as Literal;

contents.Text =

"<a href=&quot;<%# originalAttribute="href" originalPath="&quot;<%#" originalAttribute="href" originalPath="&quot;<%#" DataBinder.Eval(contents.BindingContainer, &quotDataItem.LinkUrl&quot;)%>&quot; target=&quot;_blank&quot;> <img src=&quotIMG/<%# originalAttribute="src" originalPath="&quotIMG/<%#" originalAttribute="src" originalPath="&quotIMG/<%#" DataBinder.Eval(contents.BindingContainer, &quot;DataItem.ImageUrl&quot;) %>&quot; alt=&quot;&quot; style=&quot;border:0px;&quot/></a>";

}

}

}

Mark Greve
Top achievements
Rank 2
 answered on 19 Sep 2008
2 answers
181 views
Hi,

I'm following your example on how to keep the persistant state of the radsplitter across pages and postbacks from here
http://demos.telerik.com/aspnet/prometheus/Splitter/Examples/SaveLoadStateOnServer/DefaultCS.aspx

The problem is  your samples shows you can set the expanded size in the example with the method SetSettings(), BUT THE 
SetExpandedSize is not a method in the RadPane class, I get a compile error when I do it saying that.  I am using RadControls 2008.2.723.20.  The persistant works perfect except the expanded size.  How can I set this if it isn't part of the class?

public
void SetSettings(RadPane pane)
            {
                pane.Width = this.Width;
                pane.Height = this.Height;
                pane.SetExpandedSize(this.ExpandedSize);
                pane.MinWidth = this.MinWidth;
                pane.MinHeight = this.MinHeight;
                pane.MaxWidth = this.MaxWidth;
                pane.MaxHeight = this.MaxHeight;
                pane.Collapsed = this.Collapsed;
                pane.Locked = this.Locked;
                pane.ContentUrl = this.ContentUrl;
            }

Tsvetie
Telerik team
 answered on 19 Sep 2008
3 answers
223 views
Hi,

I have a RadTabStrip in RadAjaxPanel. I write server-side code to handle the TabClick event. Most of tabs act Ajax-enable. Only one tab I want it can do a full post back. How to conditional disable the Ajax for this specific Tab?

Thanks

 

Atanas Korchev
Telerik team
 answered on 19 Sep 2008
0 answers
204 views
First, i have been looking a the examples on drag and drop and see how I can reorder the nodes. In my database I have an ORDER field that determines the order of records when displayed. How can I keep track of which nodes have been reorder so I can update my database?

Second, I have been trying to figure out how to disable dragging / dropping per node. Here is my structure:

Project
     Photo Set 1 (Disable Drag and drop and reorder)
          Photo 1 (Image with Thumbnail)
          Photo 2 (Image with Thumbnail)
     Photo Set 2 (Only Allow reordering of child nodes)
           Photo 3
           Photo 4

HEre is the treeview object on the ASPX page:

 

<

telerik:RadTreeView ID="rtvProjects" runat="server" EnableDragAndDropBetweenNodes="true" EnableDragAndDrop="true" OnNodeDrop="RadTreeView1_NodeDrop">

</telerik:RadTreeView>

I am creating the nodes problematically in the VB code behind. I tried setting the AllowDrop/AllowDrag per node, but it still lets be drag and drop between nodes and into the nodes.


I can give you all my code, if you need, but let me know if this makes sense.

Daniel

Daniel
Top achievements
Rank 1
 asked on 19 Sep 2008
3 answers
296 views
In my page, there are lots of textbox and for each textbox there is a radcolorpicker next to it. I want when use the colorpicker select a color, the color value will be displayed in the textbox.

Is there a simple way to do that?

(There are nearly 100 textbox and colorpicker pair, so it is not a good way to put 100 js function)
Sophy
Telerik team
 answered on 19 Sep 2008
1 answer
133 views
Hi,
I am using RadGrid control and in every Grid row i have  a DropDownList. Now  On selection of every action from DropDownList Pop will come , For that i am using RadWindowManager. But in DropdownList_SelectedIndexChanged
 i could not able to call Radwindow,
Please Help me..

Regards,
Sagar
Svetlina Anati
Telerik team
 answered on 19 Sep 2008
1 answer
205 views
I have successfully added the datepicker drop down as a filter for the grid. This is much better that typing in a date but I have some issues !

<telerik:GridDateTimeColumn DataFormatString="{0:d}" DataField="Date" HeaderText="Date" ReadOnly="True" SortExpression="Date" UniqueName="Date" DataType="System.DateTime" ></telerik:GridDateTimeColumn>

1. the BETWEEN filter is removed.  How can I get 2 datepickers to drop down to get a between filter ?

2.  I can not fully format the datepicker !  In codebehind I have added  in  

RadGrid1_ItemCreated 

event the following:

Dim datebox As RadDatePicker = CType(filteringItem("Date").Controls(0), RadDatePicker)

datebox.Width = Unit.Pixel(80)
datebox.Skin = Application(

"TelerikTheme")
datebox.Calendar.ShowColumnHeaders =
False
datebox.Calendar.ShowRowHeaders =
False
datebox.Calendar.ShowOtherMonthsDays =
False
datebox.Calendar.FastNavigationStep = 12

These 1st  2 above items in green work the size shrinks and a user's skin choice is applied , However the other 4 items compile, but have no affect on the look of the grid !

How can I modify the elements of the datepicker filter ?

Thank You !

Rosen
Telerik team
 answered on 19 Sep 2008
1 answer
153 views
Hello,

I am using radcontols for asp.NET and they enabled me to create nice application in quite short time (thanks!). But currently I'm faced one problem:

 I tryied to implement column hiding based on user selection (and store this selection for user into his custom profile). But when some column is initialy hidden and than I try to show it the headers of radgrid (CommandItemTemplate, groupHeader) do not use the space that appears after column showing.
 Is this a known behavior? - if no, I can send a small piece of code demonstrating it. And is there some work-around for it? (I was trying to put columns in a <div> in templates and then set style.display property, but this hide content of column, but column itself is still there (even if 1px wide, but it doesn't seem very nice)).

Thank you
Jan
Sebastian
Telerik team
 answered on 19 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?