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

Hi,
With the help of the posts in  http://www.telerik.com/community/forums/aspnet/grid/72051-radgrid-print.aspx#1532370 I could print the entire contents of radgrid in Internet Explorer and mozilla .But  I am not able to print the radgrid of certain web pages of the application  in same version of   mozilla while able to do that in internet explorer.For those pages, the below function PrintRadGrid returns null for $find(radGridId).

For the non-working pages , if i put a alert  as the first line of the function PrintRadGrid , then it is working

Could any body please explain why this happens and  how to make it working ...

function getOuterHTML(obj) {
            if (typeof (obj.outerHTML) == "undefined") {
                var divWrapper = document.createElement("div");
                var copyOb = obj.cloneNode(true);
                divWrapper.appendChild(copyOb);
                return divWrapper.innerHTML
            }
            else
                return obj.outerHTML;
        }

        function PrintRadGrid(radGridId) {

            var radGrid = $find(radGridId);
            var previewWnd = window.open('about:blank', '', '', false);
            var sh = '<%# ClientScript.GetWebResourceUrl(grdName.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",grdName.Skin)) %>';
            var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
            var htmlcontent = styleStr + "<body>" + getOuterHTML(radGrid.get_element().parentNode) + "</body></html>";
            previewWnd.document.open();
            previewWnd.document.write(htmlcontent);
            previewWnd.document.close();
            previewWnd.print();
            previewWnd.close();

            radGrid.get_masterTableView().fireCommand("EnablePaging", "");
        } 

And in code behind

 RadPnl.ResponseScripts.Add("PrintRadGrid('" + grdNmae.ClientID + "')");

Thanks

 

 

Daniel
Telerik team
 answered on 04 Aug 2011
3 answers
43 views
Version: 2011.1.519.35

When you left click down and hold on the slider handle and move your mouse left or right the handle will not move. If you click in front or behind the handle on the slide scale the handle will move. This only happens in IE9.

Can you confirm replication of this issue? If so, when can we expect a fix?
Niko
Telerik team
 answered on 04 Aug 2011
2 answers
143 views
Hi, I have an hierarchical grid.  masterTableView and DetailTables.
DetailTables has a GridClientSelectColumn that allows to select rows (multiselection)

<telerik:RadGrid ID="RadGridResources" runat="server" Width="950px" ShowStatusBar="true"
            AutoGenerateColumns="False" PageSize="7" AllowSorting="True" AllowMultiRowSelection="True"
            AllowPaging="True">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView Width="100%" DataKeyNames="IDResource" AllowMultiColumnSorting="True" HierarchyDefaultExpanded="true">
                
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="IDSlot" Name="Slot" Width="100%">
                            <Columns>
 
                                 <telerik:GridClientSelectColumn HeaderStyle-Width="40px"
                                                                UniqueName="CheckboxSelectIDSlotColumn"                                                                
                                                                >
                                    <HeaderStyle Width="40px" />
                                </telerik:GridClientSelectColumn>
                                 
                                <telerik:GridBoundColumn SortExpression="IDSlot" HeaderText="IDSlot" HeaderButtonType="TextButton"
                                    DataField="IDSlot">
                                </telerik:GridBoundColumn>                             
 
                                <telerik:GridBoundColumn SortExpression="Code" HeaderText="Code" HeaderButtonType="TextButton"
                                    DataField="Code">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" HeaderButtonType="TextButton"
                                    DataField="Description">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                       
                <Columns>
                    <telerik:GridBoundColumn SortExpression="IDResource" HeaderText="IDResource" HeaderButtonType="TextButton"
                        DataField="IDResource">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Code" HeaderText="Code" HeaderButtonType="TextButton"
                        DataField="Code">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" HeaderButtonType="TextButton"
                        DataField="Description">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
 
            <ClientSettings enablePostBackOnRowClick="true">
                <ClientEvents  />
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>


any time a row is selected I would like to get all the selected rows collection. Think can use selectedIndexChanged...

Protected Sub RadGridResources_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGridResources.SelectedIndexChanged
        Try
 
            Dim selectedItems As New ArrayList
            Dim idSlot As Long
 
                For i = 0 To RadGridResources.SelectedItems.Count - 1
                    Dim dataItem As GridDataItem = RadGridResources.SelectedItems(i)
                    idSlot = dataItem("IDSlot").Text
                    selectedItems.Add(idSlot)
                  
 
                Next
 
              'TO DO
 
 
        Catch ex As Exception
 
        End Try
    End Sub

In the away here above I find all IDSlot (child) selected values but I don't know how to find their IDResource (parent)

Thank you
Jean-Marc
Top achievements
Rank 1
 answered on 04 Aug 2011
11 answers
507 views
Hi,
I have a rad combobox in Ajax update panel inside an ascx control. I need to show a confirm box every time the combo box is changed based on a condition. If the user chooses not to go with the change, I need to set the combo box value to the previous one.
I was able to use ScriptManager.RegisterStartupScript to show the confirm box from the SelectedIndexChanged event. But I'm not able to set the combo box value to previous one. I keep getting null for $find on the combo box. Please find the related code below. Any help is greatly helpful as I need to resolve this ASAP.

ASCX code:
<telerik:RadCodeBlock ID="rcbCodeBlock" runat="server">

    <script type="text/javascript">
        function ShowConfirmOrgCode(oldValue, combo) {
            if (!confirm('Do you want to continue...?')) {
                var orgcombo = $find(combo);
                if (orgcombo != null) {
                    alert(orgcombo.get_selectedIndex());
                    orgcombo .findItemByValue(oldValue).select();
                }
            }
        }
    </script>

</telerik:RadCodeBlock>

           <asp:UpdatePanel ID="updatePanelOrgCode" runat="server">
                <ContentTemplate>
                 <telerik:RadComboBox ID="ddlOrgCode" Width="300px" runat="server" AutoPostBack="true" Height="100px"
                DropDownWidth="570px" MarkFirstMatch="true" EnableLoadOnDemand="false" />
            <asp:RequiredFieldValidator ID="ddlOrgCodereqval" Enabled="true" runat="server" ControlToValidate="ddlOrgCode"
                Display="None" InitialValue="<<- Select Organization Code ->>" ErrorMessage="Organization code is required."
                ValidationGroup="Group1"></asp:RequiredFieldValidator>
            <asp:HiddenField ID="hiddenOrgCode" runat="server" />
            <asp:HiddenField ID="hiddenHasAccess" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>


Code Behind:

        protected void ddlOrgCode_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if (ddlOrgCode.SelectedIndex != -1)
            {
                OrganizationCodeCollection ogc = base.CurrentPDCreator.GetAssignedOrganizationCodes();
                int selectedOrgCode = Convert.ToInt32(ddlOrgCode.SelectedValue);
                string oldValue = hiddenOrgCode.Value;
                bool hasAccess = ogc.Contains(selectedOrgCode);
                string sorg = ddlOrgCode.ClientID;
                if (!hasAccess)
                {
                    hiddenHasAccess.Value = hasAccess.ToString();
                    string strScript = "setTimeout(ShowConfirmOrgCode('" + oldValue + "', '" + sorg + "'), 500);";
                    ScriptManager.RegisterStartupScript(updatePanelOrgCode, GetType(), "OrgCodePopup", strScript, true);
                }
                else
                {
                    hiddenOrgCode.Value = selectedOrgCode.ToString();
                }
            }
        }
Dimitar Terziev
Telerik team
 answered on 04 Aug 2011
2 answers
139 views
Hi,

I'm using the radbutton with the download icon to allow users to download files.

This works fine in most cases accept for mime types that the browser recognizes and opens directly
in the browser when the user would rather not open the file, but prefers to "Save As..." the file instead.

When I use a standard ASP.net hyperlink the user can either click to open or right click and select
"Save Target As..." and save it without opening it.

Is there any way to make the browsers work this way when using the radbutton as a download hyperlink?

Thank,
Scott
Slav
Telerik team
 answered on 04 Aug 2011
2 answers
173 views

I have a RadMenu in a SharePoint master page. The problem is,  when I select the site Actions dropdown it appears behind the RadMenu.  The Default z-index of the menu is 7000, I’ve set it to (z-index  3 !important) with no change to the issue.

How should I configure the RadMenu to appear below the SharePoint Site Actions Menu, But will still remain above the other Telerik controls.


Kate
Telerik team
 answered on 04 Aug 2011
3 answers
194 views

GridGroupHeaderItem groupHeader = dtgLeads.MasterTableView.GetItems(GridItemType.GroupHeader)[index] as GridGroupHeaderItem;
  
GridItem[] children = groupHeader.GetChildItems();
bool hasChild = groupHeader.HasChildItems;
children.Count() > 0
  
flag = true;
foreach (GridItem child in children)
{}

I got error on (GridItem child in children) line. If i use GridDataItem in place of GridItem again i got error, I ve done this on trila version now we have Paid 2011 Q2 Ajax control version, now its not running. even the code is copied and pasted from the project that was runing with trial version.

Thanks
Andrey
Telerik team
 answered on 04 Aug 2011
3 answers
114 views
Hi All,
Please view the attachment . I have just modified filtering style. Please let me can I achive a kind of filtering style as show in  the attachment  . I adding the filtering option as icon in the column header itself . And when I click on that icon I should be able to get the drop down list with filtering values.


Thanks ...

saravanakumar subramaniam
Top achievements
Rank 1
 answered on 04 Aug 2011
10 answers
299 views
Hi,

how to disable the Drag and drop feature for images in RadEditor. Currently , i can drag any image in my web page and drop this to Rad Editor. how to disable that ? but at the same time i want the copy/paste functionality for images in rad editor.
Rumen
Telerik team
 answered on 04 Aug 2011
1 answer
179 views
Greetings,

I have a page with a radGrid and a button that allow my user to download a file, now if I use the RadAjax Manger to configure
the button to an AJAX style postback this will confict with the file download  -- if you do this you get Parse Error, as you
are messing w/ the server response :)

This page also has a grid that shows the data that is being downloaded with a status column that displays if 'exported' process
has been completed. i.e..(the user downloaded the file)  

Here's my goal, user clicks to the get the download, and aspx server side code sub. rgRequests_NeedDataSource is  invoked causing the RadGrid to be updated 

I am using client side jQuery.to update the text lables on the page with out issue,

but I do not understand how to invoke a server side code (asp.net).


// this is wired up to a ASP:BUTTON -- onClick event

function upDatePAMLabel(label,grid) {
             $("#" + label).html("There are no User IDs waiting to be exported");
  
          // AJAX Call back here to refresh the grid
          //  $("#" + grid).ajax("PortalAdminManager.aspx", "", "rgRequests_NeedDataSource","");
          
        /*   does nothing!
          $.ajax({
              type: "POST",
              url: "PortalAdminManager.aspx/rgRequests_NeedDataSource",
              data: "{}",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (msg) {
                  alert(msg)
              }
          });
          */
          
        //  brute force method - to refresh the grid
         // force a reload so that Request Status is updated in the grid
          $(document).ready(function () {
              setTimeout(function () { window.location.href = "./PortalAdminManager.aspx"; }, 1000);
            });
        
 }


So if anyone has done this, please a post a solution  or a suggestion!

Thanks,

Dave Gilden MCSD / Ft. Worth, Tx




Radoslav
Telerik team
 answered on 04 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?