Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
178 views
Hi,
I have a radgrid with checkbox(Template columns) column. By default the checkboxes are selected (written in Itemdatabound) and row is in green color. If the user deselects the checkbox then the row should be in default color.
I wrote the following javascript for checkbox click event.

function GridCheckboxChecked(obj1, rowid) {
                    
                    //ensure that the outer grid dataItem are generated
                    var grid = $find("<%= rgReceivers.ClientID %>");
                    grid.get_masterTableView().get_dataItems();

                    var griditem = $find(rowid);
                    griditem.set_selected(obj1.checked);
                    var girdrow = $('#' + rowid)[0];

                    if (obj1.checked) {
                       
                        $(girdrow).removeAttr("style");
                        $(girdrow).attr("style", "background-color:#C9F1C9");
                    }
                    else {
                        $(girdrow).removeAttr("style");
                    }
                }


It works fine. But if any other ajax request is performed in the screen, all the rows are coming back in Green color again.

I found that there is no method available to track the client side changes for radgrid.
So I reapplied the changes in the radgrid when ajax postback. For that I wrote the following in document.ready function

$(document).ready(function () {
                   
                    var grid = $find("<%= rgReceivers.ClientID %>");
                    console.log(grid);
                    
                    if (grid != null) {
                        var dataItems = grid.get_masterTableView().get_dataItems();

                        for (var i = 0; i < dataItems.length; i++) {
                           // re apply the changes
                        }
                    }
                });

When the page loaded first , it founds the grid object. But for the proceeding ajax calls, the grid object is showing as null.

Following are my ajax settings (applied on page load event)
    
      RadAjaxManager mgr = RadAjaxManager.GetCurrent(Page);
        mgr.AjaxSettings.Clear();
        mgr.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(mgr_AjaxRequest);
        mgr.AjaxSettings.AddAjaxSetting(mgr, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnsendbox, rgReceivers, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnsendbox, pnlContent);
        mgr.AjaxSettings.AddAjaxSetting(rgReceivers, pnlContent);
        mgr.AjaxSettings.AddAjaxSetting(rgReceivers, rgReceivers, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnClear, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnSave, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(chkCBN, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(cmbRecalNos, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(chkAll, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));


Why the grid object is showing as null for the ajax postbacks even though it is on the page. How to find the radgrid on ajax postbacks?
Konstantin Dikov
Telerik team
 answered on 07 Jan 2015
1 answer
152 views
I have a RadGrid control inside a RadAjaxPanel. In my jquery code, I make an ajax request to add a new record to RadGrid. It's added sucessfuly. However, it doesn't show up on the page even though I update RadAjaxPanel through the code below.

var panel = <%= ajaxPanel.ClientID %>; 
panel.ajaxRequest('<%= ajaxPanel.UniqueID %>','');

I see that RadAjaxPanel is updated but new record isn't there.I have to refresh the whole page to have the new record show up. Is there any way to do it without refresh?
Maria Ilieva
Telerik team
 answered on 07 Jan 2015
1 answer
66 views
Hi,

Is there any method to persist the client side changes after ajax like .trackChanges() and .commitChanges() for combobox?
Konstantin Dikov
Telerik team
 answered on 07 Jan 2015
6 answers
155 views
      As the form is in ContentPlaceHolder of ContentPlage I ikplement the logic like this........     


      ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
            RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1"); 


after this the result in radbutton1  is null as it doesnt find the control RadButton1....

please help me in this
Gopi
Top achievements
Rank 2
 answered on 07 Jan 2015
2 answers
69 views
Hi
I am new to using Scheduler with Group By resources. I have created the page with all the necessary data. But the Scheduler displays multiple entries for the resources. 

You can see my multiple appointments  for resource Mary, though there is only one entry in the database
My Server side code as follows:

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            'Dim ParamCol = New ParameterCollection
            'ParamCol.Add("Date", Now)
            Dim ds As DataSet = zDataFactory.GetAppointmentListAll()
            RadScheduler1.SelectedDate = Convert.ToDateTime(Now)
            RadScheduler1.SelectedView = SchedulerViewType.DayView
            RadScheduler1.TimelineView.NumberOfSlots = 10
            RadScheduler1.DataSource = ds
            RadScheduler1.DataKeyField = "AppointmentID"
            RadScheduler1.DataStartField = "FromTime"
            RadScheduler1.DataEndField = "ToTime"
            RadScheduler1.DataSubjectField = "ServiceDescription"
            RadScheduler1.GroupBy = "Consultant"
            RadScheduler1.GroupingDirection = GroupingDirection.Horizontal
            
            Dim rt As New ResourceType("Consultants")
            rt.ForeignKeyField = "ConsultantID"
            rt.KeyField = "ConsultantID"
            rt.TextField = "ConsultantName"
            rt.Name = "Consultant"
            rt.AllowMultipleValues = False
            rt.DataSource =zDataFactory.GetConsultantList()
            RadScheduler1.ResourceTypes.Add(rt)

         End If
    End Sub

The data this is returned by the zDataFactory.GetAppointmentListAll()

Where it is going wrong?

Shanmugam Narasimhan
Top achievements
Rank 1
 answered on 07 Jan 2015
2 answers
97 views
I am looking to place a radbutton which will open a radWindow from the marker tooltip. I cannot seem to get this to work.

I am setting the tooltip from the code behind which works great except for this one thing. The radbutton will not even show up. I can use a basic HTML <a href> tag and that will show up but no server controls.
 
 the following shows the code that I am using
TEMPLATE = TEMPLATE + "<button type=\"button\" onclick=\"function openRWdrillDown(){ alert('test test');}\" name=\"" + city + "\">View Details</button>";


                //<telerik:RadButton ID=\"btnDetails\" runat=\"server\" OnClientClicked=\"openRWdrillDown\" CommandArgument=\"" + city.Replace(' ', '@') + "\" Text=\"View Details\" ButtonType=\"LinkButton\" />
                mark.TooltipSettings.Content = TEMPLATE;

any guide as to how to get this to work either JavaScript or server side.

Danail Vasilev
Telerik team
 answered on 06 Jan 2015
2 answers
99 views
Hi,

I have a site using splitters and multiple radpanes. One of those radpane contains a graph reports. After a user logins, we have javascript that resizes the radpane that contains the report based on the actual size of the report (a multipage). The radpane in question is nested inside a splitter.
Now it all works most of the time but occasionally we get null when we try to get the radpane object. This is the code below:

var reportpane = $find("<%= RadPaneReporting.ClientID %>");

We noticed it happens on IE9. We have tried it on IE8, and IE11 and there seems to be no issue. FYI, we are using version 2011.3.1115.35 of the Telerik controls.

Hope you guys can shed some light on this strange issue.
Thanks.

Ricky.
Vessy
Telerik team
 answered on 06 Jan 2015
1 answer
87 views
I have a RadPanelBar.
I want to add RadPanelItem with Item template and into this Item template I want to add other controls (checkboxes and etc..)
This is my javascript function :

function AddRadPanelItem
{
      var panelBar = $find("<%= pbMain.ClientID %>");
      var panelItem = new Telerik.Web.UI.RadPanelItem();
      panelItem.set_text("FIRST PANEL ");

     //here I want to add Item template and my other controls in panelItem ?

      panelBar.trackChanges();
      panelBar.get_items().add(panelItem);
      panelBar.commitChanges();    

}


Ivan Danchev
Telerik team
 answered on 06 Jan 2015
6 answers
207 views
Hello

  I am using RadGrid in our application, i am having issue with the Pager Style it is not align to the Right, it is defaulting to the left. I am using the latest Telerik.Web.UI.dll.  Here is the code as bellow:

<PagerStyle HorizontalAlign="Right" Position="Bottom" VerticalAlign="Middle" Mode="NumericPages">

</PagerStyle>


Thank you

Murali
Pavlina
Telerik team
 answered on 06 Jan 2015
4 answers
123 views
I'm struggling with the inline EditType in the RadEditor.  I need all of the tools at the bottom of the RadEditor, mainly because if they're above the RadEditor, it goes off the top of the page.  If I set the DockingZone to Bottom, none of the controls show up at all.  (as a side note, if you set the EditMode to one type only, the tools disappear if the DockingZone is Bottom as well)  It doesn't matter if I try to form this on the ASPX or programmatically.

Is there a way I resolve this issue?

Thanks for any help you may have.
Ianko
Telerik team
 answered on 06 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?