Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
Per this thread we realize there is assistance available to upgrade skins, is it possible for you to provide additional upgrade steps in the "Universal migrator" or can we send our two skins to you for upgrade?

http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/q2-breaks-my-custom-skins-help.aspx


Thank you,

Emil
Svetlina Anati
Telerik team
 answered on 13 Nov 2009
2 answers
132 views
I'm new to using Telerik ASP.net AJAX treeview control. The problem I'm facing is whenever I do a nodeEdit it does fires the code behind RadTreeView1_NodeEdit event but, when the page reappears it will have 2 treeview controls. One having the old data and the other having the new updated data. I'm updating the database table and repopulating the tree when the database write is complete.

Please let me know how to solve this issue.

Thanks
.aspx File
<%@ Page Language="C#"  AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">

   
 


    function OnClientContextMenuItemClicking(sender, eventArgs) {
        var item = eventArgs.get_menuItem();
        var node = eventArgs.get_node();
    //   alert(item.get_text());
       curr_item = node.get_text();
       var hiddenValue = curr_item;
     //  alert(hiddenValue);
       document.getElementById('Hidden1').value = hiddenValue;
     //  alert(curr_item);
        var w = 500;
        var h = 300;
        var winl = (screen.width - w) - 75;
        var wint = (screen.height - h) / 2;
        if (item.get_text() == "Add") {
       
       
      //  var curr_item = parent.frames.view.document.forms("main").curr_item.value;
            newupd = window.open('autoComplete_textBox.aspx?curr_item=' + curr_item,
         'add_org', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=' + w + ',height=' + h + ',top=' + wint + ',left=' + winl);
        }
    else if (item.get_text() == "Edit") {


            newupd = window.open('Add_Tree_Node.aspx?curr_item=' + curr_item,
         'add_org', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=' + w + ',height=' + h + ',top=' + wint + ',left=' + winl);
    }
    else if (item.get_text() == "Delete") {

        alert('Are You Sure You want to delete the menu Item');
    }
    
    }


    function ClientNodeClicked(sender, eventArgs) {
        var node = eventArgs.get_node();
        var x = node.get_text();
        //var hiddenValue = x;
        window.document.getElementById('Hidden1').value = x;

    }

    function onClicking(sender, eventArgs) {
        var item = eventArgs.get_item();
        var x = item.get_text();
        var hiddenValue = document.getElementById('Hidden1').value;
       // alert(hiddenValue);
        if (hiddenValue == '')
        {
            alert('Please choose a Node First');
            return;
        }
        var w = 500;
        var h = 300;
        var winl = (screen.width - w) - 75;
        var wint = (screen.height - h) / 2;
        if (x == 'Add') {

            // var curr_item = parent.frames.view.document.forms("main").curr_item.value;
            newupd = window.open('autoComplete_textBox.aspx?curr_item=' + x, 'add_org', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=' + w + ',height=' + h + ',top=' + wint + ',left=' + winl);
        }
        else if (x == 'Edit') {
        newupd = window.open('autoComplete_textBox.aspx?curr_item=' + x, 'add_org', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=' + w + ',height=' + h + ',top=' + wint + ',left=' + winl);
        }
        else if (x == 'Delete') {
        alert('Do you really want to Delete the Node?');
        }
    }





</script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
             <telerik:RadMenu ID="RadMenu1" runat="server" Style="float: none; " OnClientItemClicking="onClicking" >
            <Items>
            
                <telerik:RadMenuItem Text="Add" >
                   
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Edit"  >
                   
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Delete"  >
                    
                </telerik:RadMenuItem>
              </Items>
        </telerik:RadMenu>
         <asp:Panel ID="Panel1" runat="server">
     <telerik:RadTextBox runat="Server" ID="NodeTextBox" EmptyMessage="Enter node text"></telerik:RadTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Text is required"
Display="Dynamic" ControlToValidate="NodeTextBox" ValidationGroup="TextRequired" ></asp:RequiredFieldValidator>
               
                
<asp:Button  ID="AddButton" runat="server" OnClick="AddButton_Click"
ValidationGroup="TextRequired" Text="Add new node"></asp:Button>
    
    
    </asp:Panel>
      
        </div>
        <div style="text-align: left">
     
        <telerik:RadTreeView   ID="RadTreeView1" runat="server" Skin="Office2007"
            EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="True"
            OnClientNodeClicked="ClientNodeClicked"
            OnNodeDrop="RadTreeView1_HandleDrop"
            OnClientContextMenuItemClicking="OnClientContextMenuItemClicking"
            TabIndex="1" AccessKey="T" AllowNodeEditing="True"
                OnNodeEdit="RadTreeView1_NodeEdit" style="text-align: left"
          
         AppendDataBoundItems="false">
            <ContextMenus>
                <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenu1" runat="server" Skin="Sunset">
                <Items>
                <telerik:RadMenuItem runat="server" Text="Add"></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Edit" ></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Delete"></telerik:RadMenuItem>
                </Items>
                </telerik:RadTreeViewContextMenu>
                
            </ContextMenus>
            
            <Nodes>
            
            </Nodes>
        </telerik:RadTreeView>
     
            <input id="Hidden1" type="hidden" value="" />
           <br />
       </div>
    
    
       </form>
</body>
</html>

Code Behind File
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using dataAccess;
using Sybase.Data.AseClient;
using System.Data;
using System.Configuration;
using Telerik.Web.UI;

public partial class Default4 : System.Web.UI.Page
{

    //list of all nodes
    SortedList<int, Location> myLocations = new SortedList<int, Location>();
    //list of all created nodes
    SortedList<int, RadTreeNode> myCreatedNodes = new SortedList<int, RadTreeNode>();
    protected override void OnLoadComplete(EventArgs e)
    {
        base.OnLoadComplete(e);
       if (!(IsPostBack))
        {
            RadTreeView1.ExpandAllNodes();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            popTree();
        }

       
        
    }

   

    protected void RadTreeView1_NodeEdit(object sender, Telerik.Web.UI.RadTreeNodeEditEventArgs e)
    {
        RadTreeNode nodeEdited = e.Node;
        string newText = e.Text;

        IDBManager dbManager = new DBManager(DataProvider.Sybase);
        dbManager.ConnectionString = ConfigurationManager.ConnectionStrings["ASPNETDBConnectionString1"].ToString();
        try
        {
            dbManager.Open();
            dbManager.CreateParameters(2);
            dbManager.AddParameters(0, "@oldText", nodeEdited.Text);
            dbManager.AddParameters(1, "@newText", e.Text);
         
            //string cmdString = "Update u_department Set [dept_name] =" + @newText + " WHERE [dept_name] =" + @oldText + ";
            dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.cSharpUpdateDepName");
           // dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.vb_insert_org");
            dbManager.Close();
          //  dbManager.Dispose();

         //   popTree();
        }
        catch (Exception ex)
        {
            ex.Message.ToString();
        }
        finally
        {
            dbManager.Dispose();
        }

       
    }

   


    protected void RadTreeView1_HandleDrop(object sender, RadTreeNodeDragDropEventArgs e)
    {
      
         foreach (RadTreeNode node in e.DraggedNodes)
           {
               e.DestDragNode.Nodes.Add(node);
           }

        
         e.DestDragNode.Expanded = true;
        
    
    }

   
    protected void RadTreeView1_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e)
    {
        //get the collection that holds the node who owns the Menu
        RadTreeNodeCollection collection = e.Node.ParentNode.Nodes;
        //get the index of the node
        string ORGid = e.Node.ParentNode.Value;
        string nodeName = e.Node.Text;
        string nodeID = e.Node.Value;

      int  curIndex = (e.Node.Value).Length;
        switch (e.MenuItem.Text)
        {
            case "Add":
                {
                    string strScript = "<script type='text/javascript'>";
                    strScript += "window.open('Add_Tree_Node.aspx');";
                    strScript += "</script>";
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "myKey", strScript);
                   
                    break;
                }
            case "Edit":
                {

                    string strScript = "<script type='text/javascript'>";
                    strScript += "window.open('Add_Tree_Node.aspx');";
                    strScript += "</script>";
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "myKey", strScript);
                   
                }
                    break;
                    case "Delete":
                    {

                       
                        //ScriptManager.RegisterStartupScript(this.RadTreeView1, this.GetType, "myKey", strScript, false);
     
                        //remove the node
                        //collection.RemoveAt(curIndex);
                        RadTreeView1.SelectedNode.Remove();
                        break;
                    }
                }
        
    }

 
    public void popTree()
    {
        //Definging the Connection String
        string connectionstring = ConfigurationManager.ConnectionStrings["ASPNETDBConnectionString1"].ToString();
        //Initializing the Connection Object by passing the Connection String Info        
        AseConnection sybConnection = new AseConnection(connectionstring);
        try
        {
            //Open the Connection
            sybConnection.Open();
            // Creating the Command Object
            AseCommand sybCmd = sybConnection.CreateCommand();
            //Declaring the Command Type in our Case a Stored procedure
            sybCmd.CommandType = System.Data.CommandType.StoredProcedure;
            //Passing the Stored procedure Name as Command Text
            sybCmd.CommandText = "vb_build_org_chart";

            AseDataReader myReader = sybCmd.ExecuteReader();
            Location myLocation = null;
            while (myReader.Read())
            {
                myLocation = new Location();
                myLocation.orgName = Convert.ToString(myReader["org_name"]);
                myLocation.orgId = Convert.ToInt32(myReader["org_id"]);
                myLocation.parent = Convert.ToInt32(myReader["parent"]);
                myLocations.Add(myLocation.orgId, myLocation);
            }

         ///   TreeNode aNode = null;
            RadTreeNode aNode = null;
            foreach (int aKey in myLocations.Keys)
            {
                string code = myLocations[aKey].orgId.ToString();
                aNode = new RadTreeNode(myLocations[aKey].orgName, code);
                CreateNode(aNode);
            }

            // Closing the Database Connection
            sybConnection.Close();
            //Disposing the Database Connection object
            sybConnection.Dispose();

        }
        catch (Exception ex)
        {
            Response.Write("error<BR>" + ex.Message);
            Response.Write("Trace<BR>" + ex.StackTrace);
        }
        finally
        {
            sybConnection.Close();
            sybConnection.Dispose();
        }
    }

    public void CreateNode(RadTreeNode aNode)
    {
        //This list stores all the nodes id from the current node to the ultimate parent
        List<int> myPath = new List<int>();
        if (!myCreatedNodes.ContainsValue(aNode))//if the node was not alreazdy created
        {
            int nodeId = 1001;
            nodeId = Convert.ToInt32(aNode.Value);
            //Building the current node path untill the ultimate parent
            myPath.Add(nodeId);
            while (nodeId != 0)
            {
                if (nodeId != 0)
                {
                    nodeId = myLocations[nodeId].parent;
                    myPath.Add(nodeId);
                }
            }
        }

        //descending from Ultimate parent until the node
        //if the current node does not exists we create it and add it to created nodes collection.
        //if it has not a parent we add it to the treeview
        //if it has a parent,the parent was already created because we come from it, so we add the current node to the parent.
        RadTreeNode nodeToAdd = null, ParentNodeTofind = null;
        for (int j = myPath.Count - 1; j > -1; j--)
        {
            if (myPath[j] != 0)
            {
                //checking for each path if the nodes was already created
                if (!myCreatedNodes.Keys.Contains(myLocations[myPath[j]].orgId))
                {
                    //creating the node and adding it to the created nodes collection.
                    nodeToAdd = new RadTreeNode(myLocations[myPath[j]].orgName, myLocations[myPath[j]].orgId.ToString());
                    nodeToAdd.ToolTip = nodeToAdd.Text;
                    myCreatedNodes.Add(myLocations[myPath[j]].orgId, nodeToAdd);

                    int parentId = myLocations[myPath[j]].parent;
                    //checking if the node has a parent
                    if (parentId == 0)//this node has no parent we add it to the tree view
                    {
                        RadTreeView1.Nodes.Add(nodeToAdd);
                      
                      //  RadTreeView2.Nodes.Add(nodeToAdd);
                    }
                    else//this node has a parent
                    {
                        //rerieving parent node (sure to find it)
                        ParentNodeTofind = myCreatedNodes[myLocations[myPath[j]].parent];
                        //we add the node to its parent childNodes
                        ParentNodeTofind.Nodes.Add(nodeToAdd);
                        
                    }
                }
            }
        }
    }
    protected void AddButton_Click(object sender, EventArgs e)
    {
        Page.Validate("TextRequired");
        if (Page.IsValid)
        {
            IRadTreeNodeContainer target = RadTreeView1;
            if (RadTreeView1.SelectedNode != null)
            {
                RadTreeView1.SelectedNode.Expanded = true;
                target = RadTreeView1.SelectedNode;
                string id = RadTreeView1.SelectedNode.Value;
                string stext = RadTreeView1.SelectedNode.Text;
                string paren = RadTreeView1.SelectedNode.ParentNode.Value;
                string parenName = RadTreeView1.SelectedNode.ParentNode.Text;
            }


            RadTreeNode addedNode = new RadTreeNode(NodeTextBox.Text);
            addedNode.Selected = true;
            target.Nodes.Add(addedNode);
        }
    }

    

   

    
}


Veselin Vasilev
Telerik team
 answered on 13 Nov 2009
3 answers
92 views
Is there an easy way to get unformatted HTML content from the editor? I am saving to a database don't want any tabs or spaces in there. I am looking for a way to do this without using a content filter and was wondering if there is some property that can facilitate this.

~Tom
Rumen
Telerik team
 answered on 13 Nov 2009
5 answers
241 views
Hello,

I have a RadList populated by an SQLDatasource that looks like this:

<asp:SqlDataSource ID="dsObjectives" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        DeleteCommand="DELETE FROM [ObjAssignment] WHERE [ObjAssign_ID] = @ObjAssign_ID"   
        InsertCommand="INSERT INTO [ObjAssignment] ([Role_ID], [Topic_ID], [Objective_ID], [SortOrder]) VALUES (@Role_ID, @Topic_ID, @Objective_ID, @SortOrder)"   
        SelectCommand="SELECT ObjAssignment.ObjAssign_ID, ObjAssignment.Role_ID, ObjAssignment.Topic_ID, ObjAssignment.Objective_ID, ObjAssignment.SortOrder, Objectives.[Content], Categories.CategoryName, Topics.TopicName FROM ObjAssignment INNER JOIN Objectives ON ObjAssignment.Objective_ID = Objectives.Objective_ID INNER JOIN Topics ON ObjAssignment.Topic_ID = Topics.Topic_ID INNER JOIN Categories ON Objectives.Category_ID = Categories.Category_ID WHERE (ObjAssignment.Role_ID = @Role_ID) ORDER BY ObjAssignment.SortOrder"   
        UpdateCommand="UPDATE [ObjAssignment] SET [Role_ID] = @Role_ID, [Topic_ID] = @Topic_ID, [Objective_ID] = @Objective_ID, [SortOrder] = @SortOrder WHERE [ObjAssign_ID] = @ObjAssign_ID">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="comboRole" DefaultValue="2" Name="Role_ID"   
                PropertyName="SelectedValue" Type="Int32" /> 
            <asp:ControlParameter ControlID="comboTopics" DefaultValue="0" Name="Topic_ID"   
                PropertyName="SelectedValue" Type="Int32" /> 
        </SelectParameters> 
        <DeleteParameters> 
            <asp:Parameter Name="ObjAssign_ID" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="Role_ID" Type="Int32" /> 
            <asp:Parameter Name="Topic_ID" Type="Int32" /> 
            <asp:Parameter Name="Objective_ID" Type="Int32" /> 
            <asp:Parameter Name="SortOrder" Type="Int32" /> 
            <asp:Parameter Name="ObjAssign_ID" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="Role_ID" Type="Int32" /> 
            <asp:Parameter Name="Topic_ID" Type="Int32" /> 
            <asp:Parameter Name="Objective_ID" Type="Int32" /> 
            <asp:Parameter Name="SortOrder" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 

Here is the code for my RadListBox:

<telerik:RadListBox ID="listObjectives" runat="server"   
                                        AllowAutomaticUpdates="True" AllowReorder="True" AutoPostBackOnReorder="True"   
                                        DataKeyField="ObjAssign_ID" DataSortField="SortOrder"   
                                        DataSourceID="dsObjectives" DataTextField="Content"   
                                        DataValueField="ObjAssign_ID" EnableDragAndDrop="True" Skin="Office2007"   
                                        Width="100%" style="top: 0px; left: 0px" 
                                        onitemdatabound="listObjectives_ItemDataBound"   
                                        EmptyMessage="No Objectives Found" Height="375px"   
                                        onreordered="listObjectives_Reordered">  
                                        <ItemTemplate> 
                                        <table width="423" border="0" cellpadding="1" cellspacing="1">  
      <tr> 
        <td width="2%" align="center" valign="top"><img src="images/iconTopicItems.png" alt="" width="16" height="16" hspace="2" /></td>  
        <td width="98%" valign="top"><strong><%# DataBinder.Eval(Container, "Text")%></strong><br /> 
         <%# DataBinder.Eval(Container, "Attributes['Topic']")%>  - <%# DataBinder.Eval(Container, "Attributes['Category']")%></td>  
      </tr> 
    </table> 
                                        </ItemTemplate> 
                                        <EmptyMessageTemplate> 
                                            No Objectives Found  
                                        </EmptyMessageTemplate> 
                                    </telerik:RadListBox> 

When I try to run this, the Objective name shows up as it is supposed to, but the TopicName and CategoryName don't display in the list (it is empty in those areas).  I have this in my codebehind:

protected void listObjectives_ItemDataBound(object sender, Telerik.Web.UI.RadListBoxItemEventArgs e)  
        {  
            DataRowView dsObjectivesRow = (DataRowView)e.Item.DataItem;  
            e.Item.Attributes.Add("Topic", dsObjectivesRow["TopicName"].ToString());  
            e.Item.Attributes.Add("Category", dsObjectivesRow["CategoryName"].ToString());  
 
        } 

Can anyone tell me what I'm missing?  This is urgent, as it is for a project that is due very soon.  Help! :)

Veselin Vasilev
Telerik team
 answered on 13 Nov 2009
1 answer
170 views
I have the latest version of the rad grid and have it bound to the EntityDataSource control.  I have a field that I need to hide in all modes.  My trouble is that in insert mode because it is hidden my code to set the default value in the ItemCommand event is not working.  The dictionary is getting populated correctly however when I insert I am getting a foreign key contraint error due to the fact that the hidden field is not getting populated.  Is there a way around this?  I can even leave the field on the screen in edit mode as long as I can make it read only.  When I set the readonly property, the field was not visible but again the value I need was not set.

<

 

telerik:RadGrid runat="server" ID="RadGrid2" AllowPaging="True"

 

 

AllowSorting="True" Width="97%" DataSourceID="EntityDataSource1" AllowAutomaticInserts="True"

 

 

AllowAutomaticUpdates="True" AllowAutomaticDeletes="False" ShowStatusBar="True"

 

 

GridLines="None" AutoGenerateEditColumn="True"

 

 

AutoGenerateColumns="False" OnItemCommand="RadGrid2_ItemCommand">

 

 

<PagerStyle Mode="NumericPages" AlwaysVisible="true" />

 

 

<MasterTableView Width="100%" CommandItemDisplay="Top"

 

 

DataSourceID="EntityDataSource1"

 

 

DataKeyNames="VendorCrewId">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"

 

 

SortExpression="FirstName" UniqueName="FirstName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LastName" HeaderText="LastName" SortExpression="LastName"

 

 

UniqueName="LastName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Bio" HeaderText="Bio"

 

 

SortExpression="Bio" UniqueName="Bio" ItemStyle-Width="300px" ItemStyle-HorizontalAlign="NotSet">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean"

 

 

HeaderText="IsActive" SortExpression="IsActive" UniqueName="IsActive">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridBinaryImageColumn DataField="Image" HeaderText="Image" UniqueName="Upload" ImageAlign="NotSet"

 

 

ImageHeight="80px" ImageWidth="80px" ResizeMode="Fit"

 

 

DataAlternateTextFormatString="Image of {0}">

 

 

<HeaderStyle Width="10%" />

 

 

</telerik:GridBinaryImageColumn>

 

 

<telerik:GridBoundColumn DataField="VendorCrewId" DataType="System.Int32"

 

 

HeaderText="VendorCrewId" ReadOnly="True" Visible="False" SortExpression="VendorCrewId"

 

 

UniqueName="VendorCrewId">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CompanyEntities.CompanyEntityId"

 

 

DataType="System.Int32" HeaderText="Vendor Id"

 

 

SortExpression="CompanyEntities.CompanyEntityId"

 

 

Visible="False">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<EditFormSettings EditFormType="AutoGenerated">

 

 

<EditColumn ButtonType="ImageButton" />

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 



 

protected void RadGrid2_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked

 

{

e.Canceled =

true;

 

 

//Prepare an IDictionary with the predefined values

 

System.Collections.Specialized.

ListDictionary newValues = new System.Collections.Specialized.ListDictionary();

 

newValues[

"CompanyEntities.CompanyEntityId"] = Page.Request.QueryString["1"];

 

newValues[

"IsActive"] = true;

 

 

//Insert the item and rebind

 

e.Item.OwnerTableView.InsertItem(newValues);

}

}

Tsvetoslav
Telerik team
 answered on 13 Nov 2009
1 answer
121 views
Hello,

i'm using an radtooltipmanager with autotooltipfy=true to replace classic browser tooltip by radtooltip. It works fine except on an radgrid with grouping and sorting activated. The sort action is well tooltipified but not the grouping one.

With the following code for example, the link in the th is "overrided" by the th title.
<table class="mytable"> 
        <thead> 
            <tr> 
                <th title="TH TITLE" style="text-align: left; cursor: move;" scope="col" style="height: 30px;"> 
                    <a title="INNER LINK TITLE">test</a><a title="yyy">(2)</a> 
                </th> 
            </tr> 
        </thead> 
        <tbody> 
            <tr> 
                <td title="TD TITLE"> 
                    xxx 
                </td> 
            </tr> 
        </tbody> 
    </table> 

Do you have a solution for that case?


Svetlina Anati
Telerik team
 answered on 13 Nov 2009
1 answer
93 views
Hello,
I have a ComboBox with over 3,000 records which is bound to a generic list.  When the RequiredFieldValidator is used the page takes a long time to load when I remove the validator the page loads quickly.  Any way around this?  Why is this happening?
Thanks,
Dwayne
Veselin Vasilev
Telerik team
 answered on 13 Nov 2009
2 answers
104 views
Hi all,

I wan't to do the filtering on my radgrid manually, but do it by using the radgrid filtering controls. I grab the filter command in the OnItemCommand event, and doing afterwards the filtering on my datasource, but my radgrid also still sort on the datasource.

How can I set the radgrid not to do the sorting automatically. I believe that I have done something similar earlier by setting the MasterTableView.FilterExpressions = "", but it doesn't seems to work now (or at least I don't know where to set it, have tried in OnPreRender and OnNeedDataSource). I also found some forum threads telling that setting the EnableLinqExpressions to false should help, but seems not to help either.

What should I do?

EDIT: I'm using Telerik.Web.UI 2009.3.1103.35, maybe a bug in 2009 Q3?
Ahrensberg
Top achievements
Rank 1
 answered on 13 Nov 2009
3 answers
509 views
Rad Grid: Disable activity like insert, edit, update delete when a row is in edit mode.

Following are the scenarios i would like to describe for which the code errors out:
1) A newly added row is in edit mode. Now when the grid generated CommandItem for adding a new row is clicked, the page errors out.
Here the user shouldn't have been able to click the add new row link at all. This can be achieved by setting the display of the commandItem. Still the other permutation and combination exists where
2) Add new row link is clicked and a previously existing row is now clicked for edit. Here two rows are in edit mode. One is for adding a new row and other for editing a row. Now if we click on Insert button the page errors out. Here the user shouldn't have been able to click the edit button since already a row is in Insert mode.

Concluding, is there any way that we can control the activity for the links on Insert, Update, Edit where they cannot be clicked if any one activity is currently in progress?

KS
Yavor
Telerik team
 answered on 13 Nov 2009
1 answer
95 views

hello , I am getting exception,

 

"Parameter is not valid."

 

Description: An unhandled exception occurred during closing the main form of MDI.

 

Exception Details: System.ArgumentException: Parameter is not valid.

 

Stack Trace:

 

" at System.Drawing.Drawing2D.Matrix.Clone()\r\n   at Telerik.WinControls.RadElement.get_TotalTransformationMatrix()\r\n   at Telerik.WinControls.RadElement.get_ControlBoundingRectangle()\r\n   at Telerik.WinControls.RadControl.InvalidateElement(RadElement element)\r\n   at Telerik.WinControls.RadElement.PerformInvalidateElement(RadElement element)\r\n   at Telerik.WinControls.RadElement.OnDisplayPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.VisualElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadItem.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.UI.LightVisualElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridCellElement.OnPropertyChanged(RadPropertyChangedEventArgs e)\r\n   at Telerik.WinControls.RadObject.UpdateEffectiveValue(RadProperty dp, RadPropertyMetadata metadata, Boolean isCoerceValue, Boolean isOldValueValid, Object oldValue, ValueSource oldValueSource, Boolean oldValueIsDeferred, Boolean coerceWithDeferredReference)\r\n   at Telerik.WinControls.RadObject.NotifyOnPropertyChanged(RadProperty radProperty, Object oldValue)\r\n   at Telerik.WinControls.RadObject.UnregisterStylePropertySetting(IPropertySetting setting, Boolean notifyPropertyChange)\r\n   at Telerik.WinControls.PropertySetting.UnregisterValue(RadElement element)\r\n   at Telerik.WinControls.SelectorBase.Unregister(RadElement element, PropertySettingCollection propertySettings)\r\n   at Telerik.WinControls.StyleSheet.Unapply(RadElement radElement)\r\n   at Telerik.WinControls.RadElement.UnapplyParentStyle(RadElement parent)\r\n   at Telerik.WinControls.RadElement.UnapplyStyle()\r\n   at Telerik.WinControls.RadElement.SetParent(RadElement parent)\r\n   at Telerik.WinControls.RadElement.ChangeCollection(RadElement child, ItemsChangeOperation changeOperation)\r\n   at Telerik.WinControls.RadElementCollection.OnRemoveComplete(Int32 index, Object value)\r\n   at System.Collections.CollectionBase.RemoveAt(Int32 index)\r\n   at Telerik.WinControls.UI.GridRowElement.UpdateColumns(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridTableElement.UpdateColumns(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridViewTemplate.UpdateColumns(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridViewColumnCollection.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.UI.GridViewColumnCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.ClearItems()\r\n   at Telerik.WinControls.Data.ItemObservableCollection`1.ClearItems()\r\n   at Telerik.WinControls.UI.GridViewColumnCollection.ClearItems()\r\n   at Telerik.WinControls.Data.DataAccessComponent.Dispose(Boolean disposing)\r\n   at Telerik.WinControls.UI.GridViewTemplate.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Finalize()"

Thanks

Ved Prakash

Vlad
Telerik team
 answered on 13 Nov 2009
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?