Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
82 views
Hello, is it possible to change the width of edit text field in GridBoundColumn under make a templatecolumn ?

Thx you
Princy
Top achievements
Rank 2
 answered on 06 Feb 2009
4 answers
173 views
hi

How do i set a default value on a textbox during an insert using in-form editing mode. Thanks
L
Top achievements
Rank 1
 answered on 06 Feb 2009
1 answer
136 views
Hello,  I'm following sample of treeview LoadOnDemand,  i want to fill a tree with categories-subcategories data, but when i expand a categories node, it fills subcategories but it duplicates them. 

Using   ASP.NET AJAX Q2 2008 , WXP,  VS2008, VB  the code is a follows...

UPDATE:  Debugging the project ,  i know  "RadTreeView1_NodeExpand"  is fired twice , why is this happening?  or what can i do to fire this event just one time?




    Sub FillTree()  
        Dim connection As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConStr2"))  
        Dim selectCommand As New SqlCommand("SELECT * FROM Categorias WHERE Codigo > 0", connection)  
        Dim adapter As New SqlDataAdapter(selectCommand)  
        Dim data As New DataTable()  
        adapter.Fill(data)  
        For Each row As DataRow In data.Rows  
            Dim node As New RadTreeNode()  
            node.Text = row("Descripcion")  
            node.Value = row("Codigo")  
            node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack  
            RadTreeView1.Nodes.Add(node)  
        Next  
    End Sub  
 
    Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs) Handles RadTreeView1.NodeExpand  
        Dim connection As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConStr2"))  
        Dim selectCommand As New SqlCommand("SELECT Children.Codigo as NodeId, Children.Descripcion AS NodeText, COUNT(Children.Codigo) AS ChildCount FROM Categorias LEFT JOIN Familias As Children ON Categorias.Codigo = Children.Categoria WHERE Children.Categoria = @parentId GROUP BY Children.Codigo, Children.Descripcion", connection)  
        selectCommand.Parameters.AddWithValue("parentId", e.Node.Value)  
        Dim adapter As New SqlDataAdapter(selectCommand)  
        Dim data As New DataTable()  
        adapter.Fill(data)  
        For Each row As DataRow In data.Rows  
            Dim node As New RadTreeNode()  
            node.Text = row("NodeText")  
            node.Value = row("NodeId")  
            If CInt(row("ChildCount")) > 0 Then  
                node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack  
            End If  
            e.Node.Nodes.Add(node)  
        Next  
        e.Node.Expanded = True 
    End Sub  
 

Thanks for any help. 

rayala25
Top achievements
Rank 1
 answered on 06 Feb 2009
4 answers
116 views
Hi Everyone!!

Well, I'm having a problem with the AjaxManager... =S
I have a table with 10 rows and in the page_load event I use the property Attributes and the Add event to inject a javascript to the onload  form event (I'm using a Mastertable and, obviously, a content page). This Javascript function hide (style.display = 'none';) all the rows of the table.
Now, I have a RadComboBox from which It's taken the value to show a sublist of a group of RadTextboxes.
The problem is that I Read that is not possible to ajaxify rows using ajaxManager!! =S
So using the SelectedIndexChanged event from the RadCmb it's not possible to unhide the rows =(
Someone knows how I can do this using Ajax? =(
Thx in advanced to Everyone!!!! ;-)
KlimUser
Top achievements
Rank 2
 answered on 06 Feb 2009
0 answers
118 views
I have a treeview using ServerSideCallBack as its expand mode. My child nodes are url's which reloads the page with the relevant content for that child node. On the reload of the page i want the treeview to expand the parent node of the selected child and select that child.

The problem I'm having is expanding the parent node properly on the reload of the page. I've read around the forums/documentation and see that it can only be achieved client-side so wrote a script based on some i'd seen on the telerik site. The child nodes are built and the script executes, however it doesn't seem to be able to find the treeview object, so obviously doesn't expand properly - the '+' button still appears instead of '-' but the child nodes appear making it 'look' like it has expanded but not having the expected funtionality when the user then clicks the button again. I think its a timing issue of the script executing before the object is created, or I'm doing somthing wrong of course, either way I haven't yet been able to resolve it. Any advice would be gratefully received, here's what i'm currently doing:


protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadRootNodes();
            if (this.SelectedChildNode > 0)
            {
                PreselectNode();
            }

        }
    }
    
private void LoadRootNodes()
    {
        List<MyRootObject> _rootNodes = this.MyRootNodesList;
        
        foreach (MyRootObject _rootNode in _rootNodes)
            {
                RadTreeNode _node = new RadTreeNode();
                node.Text = _rootNode.Title;
                node.Value = _rootNode.ID.ToString();
                node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                treeViewID.Nodes.Add(_node);
            }
        }
    }
    
private void AddChildNodes(RadTreeNodeCollection treeNodes, int parentNodeId)
    {
        List<MyRootObject> _rootNodes = this.MyRootNodes;
        
        foreach (MyRootObject _rootNode in _rootNodes)
        {
            if (_rootNodes.Exists(delegate(MyRootObject obj) { return obj.ID == parentNodeId; }))
            {
                List<MyChildObject> _childNodes = GetChildNodesList(parentNodeId);

                foreach (MyChildObject _childNode in _childNodes)
                {
                    RadTreeNode node = new RadTreeNode();
                    node.Text = _childNode.Title;
                    node.Value = _childNode.ID.ToString();
                    node.NavigateUrl = _childNode.Url;
                    treeNodes.Add(node);
                }
            }
        }
    }
    
private void PreselectNode()
    {
        int _parentNodeId = GetParentNodeId(this.SelectedChildNode);
        
        RadTreeNode _parentNode = treeViewID.Nodes.FindNodeByValue(_parentNodeId);
        AddChildNodes(_parentNode.Nodes, _parentNodeId);
        
        RadTreeNode _childNode = parentNode.Nodes.FindNodeByValue(this.SelectedChildNode);
        _childNode.Selected = true;
        
        string script = "var tree = $find('" + treeViewID.ClientID + "'); var expandNode = tree.get_nodes().getNode(1); expandNode.expand(); ";
        ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "ExpandScript", script, true);
    }
efter
Top achievements
Rank 1
 asked on 06 Feb 2009
2 answers
280 views
I have a page with multiple usercontrols. I am using RadAjaxManagerProxy to add controls in the user controls with one RadAjaxManager on the main page.

To update usercontrols from other usercontrols I am sending commands to the RadAjaxManager via javascript functions such as

function

ajaxMngrRequest(args){var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.ajaxRequest(args);
}

which then finds the controls and updates them. If I add the controls to be updated in the RadAjaxManagerProxy on the .ascx this all works fine.

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="ProdItemList" />
                <telerik:AjaxUpdatedControl ControlID="lblOrderItems" />
                <telerik:AjaxUpdatedControl ControlID="BtnSubmitItemOrder" />
            </UpdatedControls>
        </telerik:AjaxSetting>


RadAjaxManager1 is on the main page with the updated controls in the usercontrol.

The problem is I have one usercontrol with 2 placeholders containing datalists that are shown at different times, and not together, and if I add both to the update controls I get an error that it cannot find the one that is hidden.

What it seems I must do is only add the controls to the RadAjaxManagerProxy in the ascx.cs so that only the controls that are visible. But I cannot seem to get this to work. Here is what I have tried

AjaxManagerProxy1.AjaxSettings.AddAjaxSetting(ProdItemList, ProdItemList);

and 

AjaxSetting ajaxSetting = new Telerik.Web.UI.AjaxSetting("RadAjaxManager1");
ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl("ProdItemList", "RadAjaxLoadingPanel1"));
RadAjaxManagerProxy1.AjaxSettings.Add(ajaxSetting);

I have also tried adding it to the AjaxManager on the main page like

AjaxSetting ajaxSetting = new Telerik.Web.UI.AjaxSetting("RadAjaxManager1");
ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl("ProdItemList", "RadAjaxLoadingPanel1"));
RadAjaxManager.GetCurrent(Page).AjaxSettings.Add(ajaxSetting);

I tried just adding controls to the RadAjaxManagerProxy that are just in the usercontrol.

AjaxSetting ajaxSetting = new Telerik.Web.UI.AjaxSetting("ProdItemList");
ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl("ProdItemList", "RadAjaxLoadingPanel1"));
RadAjaxManagerProxy1.AjaxSettings.Add(ajaxSetting);

Is it possible to add controls to the RadAjaxManagerProxy in the code behind of a user control?

Thanks,
Dave

Paul Taormino
Top achievements
Rank 1
 answered on 06 Feb 2009
3 answers
183 views
In the RadGrid_itemDataBound event I add an image and CssClass to a column depending on the dataItem returned.   

However, when I export to Excel, Word, or PDF it throws an error (listed below). 

How can I show an image and css in my grid and allow it to export without blowing up on the image or cssClass?

Grid Code Behind in ItemDataBound
message.Text = Convert.ToString(dataItem["ERROR_MESSAGE"].Text);  
imageMessage.Text = Convert.ToString(dataItem["ERROR_MESSAGE"].Text);  
imageResults.Visible = true;  
message.ManualClose = true;  
refreshStatus.CssClass = "colorRed";  
imageResults.ImageUrl = "~/images/ResultError.gif"

Export Code
protected void ButtonExcel_Click(object sender, System.EventArgs e)  
    {  
        ConfigureExport();  
        RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.MasterTableView.ExportToExcel();  
    }  
public void ConfigureExport()  
    {  
        RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.ExportSettings.ExportOnlyData = true;  
        Grid1.ExportSettings.IgnorePaging = true;  
        Grid1.ExportSettings.OpenInNewWindow = true;  
    }        


Error!!!

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 134:                    if (!IsPostBack)
Line 135:                    message.Text = Convert.ToString(dataItem["ERROR_MESSAGE"].Text);
Line 136: imageMessage.Text = Convert.ToString(dataItem["ERROR_MESSAGE"].Text);Line 137:                    imageResults.Visible = true;
Line 138:                    message.ManualClose = true;
johnv
Top achievements
Rank 2
 answered on 05 Feb 2009
2 answers
140 views
Hi,

I'm using the RadGrid (Ajax version) in my DNN module module it's all working great. Except, I can't seem to get the export functinlaity working properly. Basically, when I add a scriptmanager to my page I receive "The PageRequestManager cannot be initialized more than once.".

Any ideas? If I remove the script manager then nothing happens when I do this .. RadGrid1.MasterTableView.ExportToExcel();

I've been struggling with this for ages so any help is much appreciated.

Thanks,

Marcus.

johnv
Top achievements
Rank 2
 answered on 05 Feb 2009
9 answers
226 views
Hello,

Does the RAD Window have some issues with IE7 when using the radconfirm / alert functionality?  On your examples website, the demo for these causes my browser to randomly lock up.

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx

For whatever reason if I click around enough eventually it will cause the browser to stick and when I look in task manager I see the browser sitting at a constant 50% CPU usage.

I didn't notice this though until I had integrated it into our application.  It is happening there as well which leads me to believe its not an issue with the demo but with the actual control.

Sometimes I won't get it until clicking through your demo for a minute or two but eventually it does show up and I have no other option then to ctl+alt+del.

Either my IE7 installation is broken (which I very much doubt) or your control is.
Craig
Top achievements
Rank 1
 answered on 05 Feb 2009
2 answers
266 views
We have a page with a number of DatePickers and a submit button.

The DatePickers must contain a valid date, or they can be blank.

When a user enters an invalid date into a DatePicker field, and then switches focus to another field the DatePicker displays its contents in red, and adds a little "!" icon.

If the user clicks on the submit button while a DatePicker fields contains an invalid date, how do I tell in the code-behind that a DatePicker field contains invalid data?  In this case, SelectedDate is null, but SelectedDate is null if the field is blank, so that's no help.

I need to be able to distinguish between whether a DateField is empty or whether it contains an invalid value, from the server side, and I can see no way of doing so.

Jeff
Top achievements
Rank 1
 answered on 05 Feb 2009
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?