Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
98 views

Hi,

 I would like to save the filter expressions and the sort expressions of my detail tables in my RadGrid so I could reload them when I come back to the page.

 I use SqlDataSource and this :
 http://www.telerik.com/help/aspnet/grid/grdsavingsettingsonperuserbasis.html

It's working for my MasterTableView but when I'm looking for my detailTables :
gridInstance.MasterTableView.DetailTables(0).FilterExpression it has no value (but the filtering of the detailTables is working)

I would like to know where the can I get the filter expression of my DetailTables so I can save it.

Thanks
Francis
Francis
Top achievements
Rank 1
 answered on 19 Sep 2008
2 answers
111 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
237 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
134 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
178 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
219 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
202 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
281 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
129 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
204 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?