Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
150 views
My project setup is as follows:

Master - content - code generated tab strip - code generated page view - user control page

The master page contains an Ajax manager with an Ajax proxy inside of the user control page

Inside my user control I have a button to open a rad Window defined in the master page, and a rad Grid.  Within the window is a rad upload, and for the post back event I have added functionality to do an insert into my database.

What I would like to do is refresh the grid after I have inserted into my DB.

I have been working with this example:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid

The problem I am having is that I am unable to use code based on the OnAjaxRequest event in the master page because my grid is located in the child control, and the proxy manager can't handle this event, so I'm unable to use the code in the child page.

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        if (e.Argument == "Rebind") 
        { 
            RadGrid1.MasterTableView.SortExpressions.Clear(); 
            RadGrid1.MasterTableView.GroupByExpressions.Clear(); 
            RadGrid1.Rebind(); 
        } 
        else if (e.Argument == "RebindAndNavigate") 
        { 
            RadGrid1.MasterTableView.SortExpressions.Clear(); 
            RadGrid1.MasterTableView.GroupByExpressions.Clear(); 
            RadGrid1RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1; 
            RadGrid1.Rebind(); 
        } 
    } 

Thanks for any help


Ryan
Top achievements
Rank 1
 answered on 28 Jun 2010
1 answer
114 views
Hello all,

I require to customize the RadGrid just like the lay out in the attached image , is that possible ? more over i require all the the normal operation that is default to the RadGrid ( Filter , Column selection , Sort ... )
thanks
-Prince.



Pavlina
Telerik team
 answered on 28 Jun 2010
1 answer
64 views
I am using the code posted on this forum for adding a custom print button to the RadWindow title bar.  The code seems to work, but I get an error on the page that seems to be related to issuing the "insertBefore" command.  The code is provided in this post below. 

The error message is:

    Message: Sys.ArgumentUndefinedException: Value cannot be undefined.
    Parameter name: handler
    Line: 2472
    Char: 16
    Code: 0

<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
    <script type="text/javascript">
        var radWnd;
        
        function <%=ClientID%>_OpenPrintWindow(url){
            radWnd = radopen(url, null);
            radWnd.set_title('Print Contract Form');
            radWnd.set_modal(true);
            radWnd.setSize(750,500);
            radWnd.center();
            radWnd.set_visibleStatusbar(false);
            radWnd.add_show(OnClientShow());
            radWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move +
                                 Telerik.Web.UI.WindowBehaviors.Close +
                                 Telerik.Web.UI.WindowBehaviors.Resize);
        }
        function OnClientShow()
        {
            var TitleBar = radWnd.GetTitlebar();
            var parent = TitleBar.parentNode;
            var oUL = parent.getElementsByTagName('UL')[0];
            if (!(oUL.firstChild.id == "customprintbuttonID")) // Check if the element is already added
            {
                // If not - create and add the custom button
                oUL.style.width = "192px";
                var oLI = document.createElement("LI");
                oLI.id = "customprintbuttonID"
                var aPrintBtn = document.createElement("A");
                oLI.appendChild(aPrintBtn);
                aPrintBtn.className = "customprintbutton";
                aPrintBtn.href = "javascript:void(0)";
                aPrintBtn.title = "Print Content";
                aPrintBtn.onmousedown = printWin;
                oUL.insertBefore(oLI, oUL.firstChild);
            }
        }

        function printWin(e)
        {
            var content = radWnd.GetContentFrame().contentWindow;
            var printDocument = content.document;
            if (document.all)
            {
                printDocument.execCommand("Print");
            }
            else
            {
                content.print();
            }
            //Cancel event!
            if (!e) e = window.event;

            return $telerik.cancelRawEvent(e);
        }
     </script>        
</telerik:RadScriptBlock>

Georgi Tunev
Telerik team
 answered on 28 Jun 2010
3 answers
279 views
I have a radgrid that is built dynamically based on fields a user drops into a panel on my page. Each time a user adds a new field to the radgrid a datalist above the grid is rebound and lists all of the fields that are currently in the grid. I don't want the users to be able to sort the radgrid columns by clicking headers, instead each field in the datalist has three corresponding linkbuttons: Sort Ascending, Sort Descending and Clear Sort.

For Example:
Invoice Date
Sort Ascending | Sort Descending | Clear Sort
Invoice Number
Sort Ascending | Sort Descending | Clear Sort

The logic all works fine, except that when a user clicks the "Clear Sort" button for any column the sorted class (.rgSorted) for that column is never removed. So even though the column is no longer sorted, it is still styled like it still is. I thought by simply removing that column from the GridSortExpressionCollection this would also remove the class, but that is obviously not the case.

How can I get rid of the class .rgSorted when a GridSortExpression is removed from the GridSortExpressionCollection?


Veli
Telerik team
 answered on 28 Jun 2010
3 answers
191 views
Hello,

I have gone through the demo's and manual in relation to the Scheduler Advanced Form but I just can't seem to get it working properly.

I am able to create my own custom fields on the form and have them displayed but I can't figure out how to do things such as populate a combo box in the form.  I have tried re-using the ResourceControl for the combo boxes but can't work out how to populate them with data.

Does anyone have any step by step instructions for a first time RadScheduler user?  I am able to easily get the Scheduler working and populated with data, just can't get the Advanced Form working.

Thanks.
Peter
Telerik team
 answered on 28 Jun 2010
1 answer
164 views
Hi gurus,

I'm experiencing a flicker behavior when integrating RadNumericTextbox in RadGridview. This happens when pressing tabs on the textboxes then clicking them randomly then minimized and maximized the window. Tried to trap it in the OnValueChanged client-event (I have a code in that event so I suspected that the problem is in there) but unluckily it did not run the alert method I added so the OnValueChanged event is clean.

Another instance is copying data from excel to the textbox.

Below is my code snippet:

<telerik:GridTemplateColumn HeaderText="Week Ending" UniqueName="WeekEnding" HeaderStyle-Width="100px" ItemStyle-Width="100px"  
                HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True"
                <HeaderTemplate> 
                    <span>Week Ending</span><br /> 
                    (<asp:Label ID="lblWeekEnding" runat="server" />
                </HeaderTemplate> 
                <ItemTemplate> 
                    <telerik:RadNumericTextBox ID="txtWeekEnding" Runat="server" Width="99%" style="text-align:center"  
                        ClientEvents-OnValueChanged="txt_OnValueChanged" IncrementSettings-InterceptArrowKeys="false"  
                        IncrementSettings-InterceptMouseWheel="false" ClientEvents-OnKeyPress="txt_OnKeyPress" TabIndex="1" /> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridTemplateColumn HeaderText="MTD" HeaderStyle-Width="100px" ItemStyle-Width="100px"  
                HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True"
                <HeaderTemplate> 
                    <span>MTD</span><br /> 
                    (<asp:Label ID="lblMTD" runat="server" />
                </HeaderTemplate> 
                <ItemTemplate> 
                    <telerik:RadNumericTextBox ID="txtMTD" Runat="server" Width="99%" style="text-align:center" IncrementSettings-InterceptArrowKeys="false"  
                        IncrementSettings-InterceptMouseWheel="false" ClientEvents-OnValueChanged="txt_OnValueChanged"  
                        ClientEvents-OnKeyPress="txt_OnKeyPress" TabIndex="2" /> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 

Hope to help me out in this problem.

Regards,

Jouie

Radoslav
Telerik team
 answered on 28 Jun 2010
3 answers
152 views
Here's a weird one. I've got a RadTreeView that works fine and has a few client-side EventHandlers hooked up.  However, when I reload the RadTreeView using a CallBack, suddenly no EventHandlers work.  As a matter of fact, nodes won't even expand/collapse, so it's not just that the custom EventHandlers I've added don't work, even the built-in ones are gone.

What's going on and how do I stop it?

                                                        <telerik:RadTreeView  
                                                            RunAt="server"  
                                                            ID="RadTreeView1"  
                                                            OnClientNodeClicking="nodeClicking" 
                                                            EnableDragAndDrop="true" 
                                                            OnNodeDrop="RadTreeView1_HandleDrop" 
                                                            EnableDragAndDropBetweenNodes="true"
                                                            <DataBindings> 
                                                                <telerik:RadTreeNodeBinding  
                                                                    TextField="listitemName" 
                                                                    ValueField="listitemID" 
                                                                    /> 
                                                                <telerik:RadTreeNodeBinding  
                                                                    Depth="0"  
                                                                    TextField="listitemName"  
                                                                    ValueField="listitemID" 
                                                                    Expanded="true" 
                                                                    CssClass="rootNode"  
                                                                    /> 
                                                            </DataBindings> 
                                                        </telerik:RadTreeView> 

Yana
Telerik team
 answered on 28 Jun 2010
1 answer
307 views
I have a worklist (RadGrid) inside a XmlHttpPanel on a page.  The grid gets refreshed every 30 seconds.  The data inside the grid is remaining the same but the size of the post body is growing with every interval.  I am using FF and Firebug to evaluate what is going out on the wire.  I can see that the __EVENTVALIDATION is increasing with each post...below is a sample of the javascript used to invoke the postback...any insight would be greatly appreciated.  Thanks Doug
 var wlCtrlGridID = null;
 var wlCtrlAutoRefreshRate = 10000;
 var wlIntervalId = 0;
function startWorklistRefresh() {
                if (wlIntervalId == 0) {
                    wlIntervalId = setInterval("reloadWorklist();", wlCtrlAutoRefreshRate);
                }
            }
            function reloadWorklist() {
                $find("<%= XmlGridPanel.ClientID %>").set_value("Reload");
            }
            function cancelWorklistRefresh() {
                clearInterval(wlIntervalId);
                wlIntervalId = 0;
            }
            function GridXmlPanel_OnResponseEnded(sender, args) {
                startWorklistRefresh();
            }

<asp:Panel ID="PnlGrid" runat="server" style="margin-top: -4px; margin-left: 3px;">
        <telerik:RadXmlHttpPanel ID="XmlGridPanel" runat="server" OnServiceRequest="GridXmlPanel_OnServiceRequest"
            OnClientResponseEnded="GridXmlPanel_OnResponseEnded" EnableClientScriptEvaluation="true">
            <telerik:RadGrid id="GridWorklist" runat="server" SkinID="main" GridLines="None" style="outline: none;"
                OnItemCreated="GridWorklist_ItemCreated" OnItemDataBound="GridWorklistt_ItemDataBound">.....


Pero
Telerik team
 answered on 28 Jun 2010
3 answers
133 views
I've basically got everything coded for my mini message system. However, I am trying to get so that when a user either adds a message or maintains a message. When going to these screens, and the Sticky check box is selected, it will move the whole row to the top of the grid, if they go back in the maintain section it will remove it and not pin it to the top. What event and code would I go about doing this?
Radoslav
Telerik team
 answered on 28 Jun 2010
1 answer
201 views
In my web application I'm using Entity Framework 4 and ObjectDataSources. It seems I cannot use Grid Automatic Sorting, I get the error:

The data source 'ObjectDataSourceAaa' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.

Is there some way to do this?
Rosen
Telerik team
 answered on 28 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?