Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
163 views
Hi , 
I  have a parent page from which i need to open a rad window where i save/update data. On saving/closing the rad window i need the rad grid in parent to refresh . Grid does not refresh until i do a post back on the page .
Following is the code i am using , 

In Master Page :
  <telerik:RadAjaxManager ID="mgr" runat="server" EnableAJAX="true" OnAjaxRequest="mgr_AjaxRequest"> 
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Skin="Vista"
                BackgroundPosition="Center" EnableEmbeddedSkins="true" />
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
In Parent Page (.aspx)
 <script type="text/javascript">
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }
            function refreshGrid() {                
                    $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>").ajaxRequest("Rebind");  
                                      
            }      
</script>
In Parent Page (.cs)


 protected void Page_Load(object sender, EventArgs e)
    {
        #region AJAX Settings        
        RadAjaxManager mgr = RadAjaxManager.GetCurrent(Page);
        
        mgr.AjaxSettings.Clear();       
        mgr.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(mgr_AjaxRequest);
        mgr.AjaxSettings.AddAjaxSetting(btnSearch, pnlContent);
        mgr.AjaxSettings.AddAjaxSetting(btnSearch, rgcarrrier, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(rgcarrrier, pnlContent);
        //mgr.AjaxSettings.AddAjaxSetting(RadWindowManager1, rgcarrrier);
        mgr.AjaxSettings.AddAjaxSetting(btnDelete, pnlContent);
        mgr.AjaxSettings.AddAjaxSetting(btnDelete, rgcarrrier, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(rgcarrrier, rgcarrrier, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));        
        #endregion


}




  protected void mgr_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {         
                
                rgcarrrier.MasterTableView.SortExpressions.Clear();
                rgcarrrier.MasterTableView.GroupByExpressions.Clear();
                rgcarrrier.Rebind();                           
           
            
        }
        
    }


In Rad Window (.aspx)
<script type="text/javascript">       
      
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        function cancelAndClose() {
            var oWindow = GetRadWindow();
            oWindow.argument = null;
                        oWindow.close();
                        oWindow.BrowserWindow.refreshGrid();  
            return false;
        }    
          
    </script>

In Rad Window (.cs)
 protected void Page_Load(object sender, EventArgs e)
    {
        #region Ajax Settings
        RadAjaxManager mgr = RadAjaxManager.GetCurrent(Page);
        mgr.AjaxSettings.Clear();
        #endregion
}
 protected void btnClose_Click(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "cancelAndClose();", true);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
     (Page.IsValid)
        {
            //when save
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "cancelAndClose();", true);
}
//when Update
{
 ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "cancelAndClose();", true);
}
}


where did i go wrong ?
The grid does not refresh ..
mahesh
Top achievements
Rank 1
 answered on 27 Jul 2011
3 answers
404 views
I'm trying to figure out how to set the focus from outside of the grid to a particular radnumerictextbox editor cell in the grid (the whole radgrid is in edit mode) from client side using javascript. it says there is no method called focus() on the grid

<script type="text/javascript"
                    function gotoGrid() { 
                            var grid = $find('MainContent_GeneralControl_MyFormView_MyRadGrid'); 
                            if (grid != null) { 
                                grid.set_focus(); // this says there is no such method 
                            } 
                        } 
                </script> 
 

this code is being fired from an onblur event in a radnumerictextbox
Daniel Aquere
Top achievements
Rank 2
 answered on 27 Jul 2011
2 answers
181 views

I have a Radgrid with Radcombobox , radnumericbox and radtextbox  all have the same onfocus and onblur event assigned to it . I want to get the cellindex on the focus event  and  on eaech cellindex I want to do different processing ?

          if i click a column I can get it as below and display it in a textbox .

function ColumnClick(sender, eventArgs) {
        var text = "";
        text = eventArgs.get_gridColumn().get_element().cellIndex;
        document.getElementById("TextBox2").value = text;
    }

          I want the same for radnumeric control in template in the focus event .

Please kindly help us .

Daniel Aquere
Top achievements
Rank 2
 answered on 27 Jul 2011
6 answers
629 views
Hello,
          I put a text "attach files" for Localized-Select in RadAsyncUpload. The text is cut off on the button. Is there a way to increase the size of the button in RadAsyncUpload?

Thanks,
Bharani
Jonx
Top achievements
Rank 2
 answered on 27 Jul 2011
2 answers
93 views
Hi,

I need to customize the "Add" button of RadUpload by changing the text to "Attach Additional Files". After I set localization-add="Attach Additional Files", the button text is changed, but only partial text is shown because the button width is not changed. I searched documentation, and didn't find other settings needed when using localization-add. Do I miss anything?

The current code for RadUpload is:
<telerik:RadUpload ID="RadUpload1" runat="server" InitialFileInputsCount="3" localization-add="Attach Additional Files" MaxFileInputsCount="5" />

Thanks!
Ray
Top achievements
Rank 1
 answered on 26 Jul 2011
1 answer
97 views
In my ItemDataBound, I have code that uses EditFormItem[<UniqueName>] to retreive data from a parent grid column. But if the column is bound to empty data, EditFormItem returns "&nbsp;". I currently get around this by replacing the "&nbsp;" with an empty string, but I was just wondering why this would be the case? I understand HTML tables need something in the cell to render properly, but should this be returned by EditFormItem? Shouldn't it be possible to render it correctly without also returning it as the column value? Or is there some way to do this that I am missing?

Thanks

ROSCO
Daniel
Telerik team
 answered on 26 Jul 2011
0 answers
117 views
If I have a Grid with a CommandItem refresh button like this:
<rad:RadGrid ID="myRadGrid" runat="server">
    <MasterTableView CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="false">
    </MasterTableView>
</rad:RadGrid>

How do I change the behavior of that refresh button?
Calvin
Top achievements
Rank 1
 asked on 26 Jul 2011
7 answers
166 views
Hi,
I have a treelist within which I use a template column with a pencil icon that I assign an onclick event from the code behind.  The event simply calls a js function with the current row GUID.  This works well.

However with the recent release the OnItemClick client event can now be called and I use that to call a JS function that opens a popup page.

The issue that I have is that now both functions are called when the user clicks on the edit pencil so I get a details and an admin page being opened!  Is there a way to determine the column that was clicked from the OnItemClick event and thus exclude the column?

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 26 Jul 2011
2 answers
201 views
Is there a way to remove the border between the radpanel bars? (Please see attached). I am using Outlook skin on the radPanelBar, and was wondering if there is a way to remove the 1px line shows up right above the radpanelitem.

I tried to manipulate it by using the following css code, but wasn't successful.

.RadPanelBar .rpRootGroup .rpOut
{
    border: 0 !important;
    padding: 0 !important;
}

Thank you.
Jacob
Top achievements
Rank 1
 answered on 26 Jul 2011
0 answers
105 views
I have created a page that consumes an rss feed. I have six boxes that display the feeds, I have attached a screenshot, there are three at the top and three below.
I have used the following markup:
<div id="allNewsTop" class="allNews">
    <div id="newsDiv1" class="newsItem" runat="server">
        <asp:Image ID="Image1" runat="server" />
        <br />
        <asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink>
        <p id="desc1" runat="server"></p>
    </div>
    <div id="newsDiv2" class="newsItem" runat="server">
        <asp:Image ID="Image2" runat="server" />
        <br />
        <asp:HyperLink ID="HyperLink2" runat="server"></asp:HyperLink>
        <p id="desc2" runat="server"></p>
    </div>
    <div id="newsDiv3" class="newsItem" runat="server">
        <asp:Image ID="Image3" runat="server" />
        <br />
        <asp:HyperLink ID="HyperLink3" runat="server"></asp:HyperLink>
        <p id="desc3" runat="server"></p>
    </div>
</div>
<div id="allNewsBottom" class="allNews">
    <div id="newsDiv4" class="newsItem" runat="server">
        <asp:Image ID="Image4" runat="server" />
        <br />
        <asp:HyperLink ID="HyperLink4" runat="server"></asp:HyperLink>
        <p id="desc4" runat="server"></p>
    </div>
    <div id="newsDiv5" class="newsItem" runat="server">
        <asp:Image ID="Image5" runat="server" />
        <br />
        <asp:HyperLink ID="HyperLink5" runat="server"></asp:HyperLink>
        <p id="desc5" runat="server"></p>
    </div>
    <div id="newsDiv6" class="newsItem" runat="server">
        <asp:Image ID="Image6" runat="server" />
        <br />
        <asp:HyperLink ID="HyperLink6" runat="server"></asp:HyperLink>
        <p id="desc6" runat="server"></p>
    </div>
</div>
I have the following CSS:
.newsItem
{
    width:220px;
    height:225px;
    float:left;
    margin-left:5px;
    margin-top:5px;
    border: 1px solid white;
    padding-left:5px;
}
.allNews
{
    padding-left:8px;   
}
.searchLists
{
    width:689px;
    height:50px;
    margin-left:13px;
}
#sourceSearch
{
    width:335px;
    padding-left:5px;
    float:left;
    padding-top:2px;
}
#teamSearch
{
    width:335px;
    padding-left:5px;
    padding-top:2px;
    float:right;
}
.newsItem img
{
    padding-left:10px;
    padding-top:10px;
    padding-bottom:10px;
    width:130px;
    height:70px;
}
.newsItem a
{
    padding-bottom:10px;
    padding-right:5px;
}
.newsItem p
{
    padding-right:5px;
}


It then dawned on me to use a list view with paging so that i can display further feeds as at the moment the page can only display the first six feeds retrieved.

I have attempted using the radlistview but i dont know how to make the page have two rows of three boxes, the display always puts 6 boxes in a single row.

Do i need to use nested listviews? Not sure how that works.

Any help isappreciated.
Antony
Top achievements
Rank 1
 asked on 26 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?