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

I cut and past from my webpages.  Multipage, panelbar controls causes the background color to be picked up with the text.  How can make it so that when I copy text the text format picked up but the background color.  If I put the same html in the space where the radpanel is then the background background color is not picked up but the text format is.  However, as soon as I put text in the radpanel or multipage then the text format and the background is picked up.  I have set the radpanel as transparent.

Is this a css solution 




















Galin
Telerik team
 answered on 25 Jan 2013
6 answers
167 views
Code Sample 

<telerik:RadComboBox ID="RadComboBox1" runat="server" Filter="Contains" EnableVirtualScrolling="false"
            EmptyMessage="Please type Here" AllowCustomText="true" EnableLoadOnDemand="false"
            MarkFirstMatch="true">
            <Items>
                <telerik:RadComboBoxItem Text="1" />
                <telerik:RadComboBoxItem Text="2" />
                <telerik:RadComboBoxItem Text="3" />
                <telerik:RadComboBoxItem Text="8" />
                <telerik:RadComboBoxItem Text="9" />
                <telerik:RadComboBoxItem Text="18" />
                <telerik:RadComboBoxItem Text="19" />
                <telerik:RadComboBoxItem Text="38" />
                <telerik:RadComboBoxItem Text="39" />
                <telerik:RadComboBoxItem Text="ABCD-39" />
                <telerik:RadComboBoxItem Text="ABCD-40" />
            </Items>
        </telerik:RadComboBox>

Problem

When I type number 9 in the above ComboBox, filter is not working.I tried with Chrome, its working fine.
I hope the problem is with IE7.

Please help me to fix it.

Thanks and Regards,
Manoj Kumar


Hristo Valyavicharski
Telerik team
 answered on 25 Jan 2013
1 answer
163 views
Hi,

I have a RadGrid on my page that contains a NestedViewTemplate containing a RadPanelBar.  I have my HierarchyLoadMode set to ServerOnDemand.  What I would like to do is when the user clicks to expand a row, I want the RadPanelBar to list a set of sub-records of row I am clicking on.  I need the RadPanelBar to contain some aspet controls, so I am using the ContentTemplate.  What I have done is, in the DetailTableDataBind function, I am querying a database for my subrecords and binding the results to the RadPanelBar for that particular GridDataItem being passed into the function.  For each row of my sub-table, I am dynamically creating my ContentTemplate from a class I created based on another post on the Telerik site.  Below is the code for this.  In additional, in my Page_Load function I am looping through the RadGrid and creating the custom template again.  Everything I have done appears to work fine with one exception.  When I first open a detail row, the RadPanelBar in that row does not have the collapse/expand ability in the header.  If I open up a second row, the first row's collapse/expand then appears and everything looks great.  But of course the second row's collapse/expand isn't visible.  So I'm always one off from this working without issue :)  I've tried using the OnInit function to do what I am doing in the Page_Load, but whenever I do anything with the RadGrid in this function, opening the nestedview causes the entire grid to disappear from the page (almost looks like it lost it's data bindings).  I have a hunch that the 'OnDetailTableDataBind' is part of my issue, I am guessing I should be doing what I am doing there somewhere else since technically I don't need to even set the e.DetailTableView.DataSource for this to work.  Does anyone have any ideas where I might be off?  My two functions are below. 

Thanks for any suggestions!
Richard
protected void OnDetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            int customerid = Convert.ToInt32(dataItem.GetDataKeyValue("customerid"));
            RadPanelBar panelBar = (RadPanelBar)dataItem.ChildItem.FindControl("pbCustomerDetails");
            using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["LocalConnectionString"].ConnectionString))
            {
                using (SqlCommand myCommand = new SqlCommand("", conn))
                {
                    myCommand.CommandText = "Select DateOfBirth, WorkAddress from CustomerDetail where Active=1 and CustomerID=@CustomerID ";
                    myCommand.Parameters.Add("@CustomerID", SqlDbType.Int).Value = customerid;
                    using (SqlDataAdapter adapter = new SqlDataAdapter(myCommand))
                    {
                        DataTable table = new DataTable();
                        conn.Open();
                        adapter.Fill(table);
                        conn.Close();
                         
                        panelBar.DataSource = table;
                        panelBar.DataBind();
                        for (int i = 0; i < panelBar.Items.Count; i++)
                        {
                            panelBar.Items[i].ContentTemplate = new CustomerTemplate();
                            panelBar.Items[i].ContentTemplate.InstantiateIn(panelBar.Items[i]);
                            panelBar.Items[i].DataBind();
                            panelBar.Items[i].Expanded = true;
                        }
                         
                        panelBar.DataBind();
                        e.DetailTableView.DataSource = table;
                    }
                             
                }
            }
        }

protected void Page_Load(object sender, EventArgs e)
        {
            foreach (GridDataItem item in CustomerGrid.Items)
            {
                if (item.Expanded)
                {
                    RadPanelBar panelBar = (RadPanelBar)item.ChildItem.FindControl("pbCustomerDetails");
                    for (int i = 0; i < panelBar.Items.Count; i++)
                    {
                        panelBar.Items[i].ContentTemplate = new CustomerTemplate();
                        panelBar.Items[i].ContentTemplate.InstantiateIn(panelBar.Items[i]);
                        panelBar.Items[i].DataBind();
                    }
                    panelBar.DataBind();
                }
 
            }           
        }
Boyan Dimitrov
Telerik team
 answered on 25 Jan 2013
3 answers
104 views
I've added another button to the standard edit template, 'Update then edit next row'.  I need to create an event that will put the next row, if it exists, into edit mode.

protected void rgDemandForecast_OnItemCreated(object source, GridItemEventArgs e)
        {
            if (e.Item is Telerik.Web.UI.GridEditFormItem && e.Item.IsInEditMode)
            {
                LinkButton linkButton = new LinkButton();
                linkButton.Text = "Update And Edit Next Row";
                linkButton.CommandName = "Update";
  
                linkButton.Attributes["onclick"] = "some javascript";
                      //or
                linkButton.Click += updateAndEditNextRow_OnClick;
  
                
LinkButton update = e.Item.FindControl("UpdateButton") as LinkButton;
                update.Parent.Controls.Add(new LiteralControl(" "));
                update.Parent.Controls.Add(linkButton);
            }
  
  
        }

Can someone give me a general outline of which javascript methods i need to get the current row and then put the next row into edit mode?

I don't mind doing this in my updateAndEditNextRow_OnClick method, but would prefer to keep this client-side.
Danny
Top achievements
Rank 2
 answered on 25 Jan 2013
3 answers
86 views
Hi!

I am trying to overcome a limitation in RadGrid (which I think is still around, I am using version 2010.1.309.35):
If AllowMultiRowSelection = true, and the user selects multiple rows by holding down the Shift-key, there is no postback even if

EnablePostBackOnRowClick = true.


There is a workaround described here:
http://stackoverflow.com/questions/7424397/telerik-radgrid-onrowselected-events-all-done-event-for-multiple-selection/14381154#14381154

I have slightly modified the client code to look like this:
function IW_RowSelected(sender, eventArgs) {
    var e = eventArgs.get_domEvent();
    if (!sender.AllowMultiRowSelection || !e.shiftKey) {
        // Multiple row not enabled or shift not pressed, nothing to do
        return;
    }
      
    if (window.rowSelectedTimeout) {
        // If selecting multiple rows, clear the previous row's rowSelectedTimeout
        window.clearTimeout(window.rowSelectedTimeout);
    }
  
    rowSelectedTimeout = window.setTimeout(function() {
        window.rowSelectedTimeout = null;
        alert('rows selected'); // Should force a postback here
    }, 10);
}

And it works fine. There is just one piece missing: How do I force a postback when the "last" row has been selected? Right now, all I do is an "alert('rows selected')", but I need to force a postback so that my server-side code can detect which rows are currently selected.

If it matters, I use an ASP.NET UpdatePanel to get partial updates.

Thanks!
/Fredrik
Kostadin
Telerik team
 answered on 25 Jan 2013
1 answer
113 views
Hello!
In my project I use RadGrid with dynamic columns creation and configuration. Available columns is stored in database and columns set is depend on user group. User can resize, hide/show and reorder columns and configuration is persisted in db using REST ajax requests to service. Filtering and grouping also is enabled. Dynamically created at PageInit event Grid is wrapped by ASP.NET Update panel and binded at server side using NeedDataSource event. Grid.MasterTableView.EnableColumnsViewState = false (otherwise grid throws exception at postback request). All is OK untill user will not start columns reoredering. If user reorder columns, new order will be stored at db, but Ids of the links in column headers that responsible for invoking sort operation still the same... so at the next postback request (for example - rebind) we will get sorting not on the target column, but on the column that be place at that position before reordering. In you sample demo with client-side columns reordering sorting is disabled... Because of grid doesn't support sorting with enabled client-side reordering?
Angel Petrov
Telerik team
 answered on 25 Jan 2013
7 answers
369 views
I am working in asp.net and I need to disable whole page with ajax update panel. There is a button on usercontrol and on click this button I need to disable whole page. Please let me know how I can do this.

Kuldeep Dwivedi
Kuldeep
Top achievements
Rank 1
 answered on 25 Jan 2013
1 answer
121 views
Hi there,

I have a problem in using the radListView with AJAX.

As you can see in the enclosed image I want the user be able to download a file. (radlistview.png)
When I enable AJAX an error occurs (error.png).
I use the following code:

<
asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
       
    <telerik:RadAjaxManagerProxy ID="rampRequest" runat="server">
        <AjaxSettings>  
            <telerik:AjaxSetting AjaxControlID="paRequestListView">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="paRequestListView" LoadingPanelID="raLoadingPanel"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
       
    <asp:Panel ID="paRequestListView" runat="server">
         <NMHG:RequestListView id="RequestListView" runat="server"></NMHG:RequestListView>
    </asp:Panel>
     
</asp:Content>

protected void rlvRequest_ItemCommand(object source, RadListViewCommandEventArgs e)
        {
            //Download file
            if (e.CommandName == "Download")
            {
                //show save as dialog
                System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
                response.ClearContent();
                response.Clear();
                response.ContentType = "text/plain";
                response.AddHeader("Content-Disposition", "attachment; filename=" + RequestDownloadFileName + ";");
                response.TransmitFile(ConfigurationManager.AppSettings.Get("Download directory") + RequestDownloadFileName);
                response.End();
            }
        }


When I remove the <telerik:RadAjaxManagerProxy> tag from the code above i am able to download the file.
Any idea why my download not works when AJAX is enabled?

I also noticed the LoadingPanel for my RadListView is never shown. AJAX functions normal in my RadListView.
I use the same code for my RadGrids were the LoadingPanel is shown.


Regards,

Marcel

Maria Ilieva
Telerik team
 answered on 25 Jan 2013
4 answers
222 views
Hi,
I know we can export grid to excel/pdf (opens the save/open dialog box on IE).  However, my client needs a "email as Excel / pdf"  functionality.  Is it possible to get a byte[] of the exported content, so we can attach it to an email.

Thanks,
Anand
Mike
Top achievements
Rank 1
 answered on 25 Jan 2013
4 answers
184 views
I am using RadGrid.Net2 dll having 5.1.6.0 version

strangely on staging and local environment i have my Page Size combo box enabled showing default 10,15,20 and 50 as value in it.

But on Production this combobox is readonly and disabled. why so ? there is not code i have writtent to disabled it.

following is my control declaration
<rad:RadGrid ID="rgUserList" runat="server" Width="100%" AutoGenerateColumns="false"
AllowPaging="true" PageSize="10" PagerStyle-Mode="NextPrevAndNumeric" EnableTheming="true"
GridLines="Vertical" OnItemDataBound="rgUserList_ItemDataBound" AllowSorting="true"
AllowFilteringByColumn="false" OnNeedDataSource="rgUserList_NeedDataSource"
Maria Ilieva
Telerik team
 answered on 25 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?