Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
48 views
Hi all,

It looks like this server-side method attribute allows the server method to be controlled somehow through client scripting.

Is this correct? If so can a short example be provided please?

I tried just calling the function in script and got an 'Object was expected' null reference error.

Thanks :)
Brad
Top achievements
Rank 1
 asked on 18 Aug 2010
5 answers
746 views
Hello,

Im having an issue with the RadGrid and allowing Column Filtering. Basicly what has happened is that we had a grid. we had filtering on it and the filtering worked for awhile. we updated our controls to .1314, afterwards filtering started throwing an exception "no property or field 'username' exist in object". from my understanding this was an issue nearly a year ago and hotfix was applied.

to make things worse is that through searching the forums i found out setting the EnableLinqExpressions = false will allow the filtering to happen without throwing an exception, but when i set that property to false, the paging on the grid no longer works. the telerik pager, defaults to page 1, but when you click page 3, the pager is saying page 3 but the grid itself is still displaying records from page 1.

for awhile i believed it to be an ajax problem and i disabled all the ajax on the page and the problem still persist.

so, in a nutshell, if EnableLinqExpression is not set to False, we cannot use the Filtering provided in the control, if we do set EnableLineExpression to False, the pager does not work appropriately.

any help at all would be appreciated.

public partial class esAdmin_test : System.Web.UI.Page 
    public RadPane gridPane; 
    private UserBE.SelectionTypes _selectType = 0; 
    //public RadAjaxManager RadAjaxManager1; 
    //public RadAjaxLoadingPanel RadAjaxLoadingPanel1; 
 
    public UserBE.SelectionTypes SelectType 
    { 
        set { _selectType = value; } 
        get { return _selectType; } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        RadSplitter mpSplitter = (RadSplitter)Master.FindControl("NestedSplitter"); 
        if (mpSplitter != null
        { 
            ArrayList panes = mpSplitter.GetPanes(); 
            RadPane pane = (RadPane)panes[2]; 
            gridPane = (RadPane)panes[1]; 
            int paneIndex = pane.Index; 
            mpSplitter.Items.RemoveAt(paneIndex); 
        } 
 
        //RadAjaxManager1 = (RadAjaxManager)Master.FindControl("RadAjaxManager1"); 
        //RadAjaxLoadingPanel1 = (RadAjaxLoadingPanel)Master.FindControl("RadAjaxLoadingPanel1"); 
        //RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(this.RadAjaxManager1, this.RadGrid1, RadAjaxLoadingPanel1); 
        //RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(this.RadGrid1, this.RadGrid1, RadAjaxLoadingPanel1); 
       
    } 
 
    protected void RadGrid1_OnNeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        SessionManager _session = new SessionManager(); 
 
        ObjectContainerDataSource _datasource = new ObjectContainerDataSource(); 
        _datasource.DataObjectTypeName = "Peminic.Business.BusinessEntities.UserBE"
        _datasource.DataSource = UserBE.GetBySelectionType(UserBE.Context.AreoOfResponsibility, _session.UserID, SelectType); 
 
        RadGrid1.DataSource = _datasource; 
    } 
 
    protected void rdoSelectUser_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        SelectType = (UserBE.SelectionTypes)Convert.ToInt32(rdoSelectUser.SelectedValue); 
        RadGrid1.CurrentPageIndex = 0; 
        RadGrid1.Rebind(); 
    } 
 
    protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument) 
    { 
        //RadGrid1.Rebind(); 
 
        base.RaisePostBackEvent(sourceControl, eventArgument); 
 
        if (sourceControl is RadAjaxManager) 
        { 
            if (eventArgument == "Rebind"
            { 
                RadGrid1.MasterTableView.SortExpressions.Clear(); 
                RadGrid1.MasterTableView.GroupByExpressions.Clear(); 
                RadGrid1.Rebind(); 
            } 
 
            if (eventArgument == "ChangePageSize"
            { 
                Session["itemsCount"] = this.RadGrid1.Items.Count; 
 
                //Depending on the paticular scenario this value may vary. 
                int rows = (Int32.Parse(this.gridPane.Height.Value.ToString()) - 20) / 32; 
                if (rows >= 1) 
                { 
                    RadGrid1.PageSize = rows; 
 
                    // Check whether the CurrentPageIndex is correct. 
                    if (Session["itemsCount"] != null
                    { 
                        int itemsCount = (int)Session["itemsCount"]; 
                        int pageCount = (int)Math.Ceiling(((double)itemsCount / rows)); 
                        if (RadGrid1.MasterTableView.CurrentPageIndex > pageCount - 1) 
                        { 
                            RadGrid1.MasterTableView.CurrentPageIndex = pageCount - 1; 
                        } 
                    } 
                    RadGrid1.Rebind(); 
                } 
            } 
        } 
    } 

<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPlaceHolderRuleNav"
    <div class="qsfexHeaderMain">Test Group Filter</div> 
    <asp:RadioButtonList ID="rdoSelectUser" runat="server" AutoPostBack="True"  
        Font-Names="Verdana"   
        style="margin-right: 61px"  
        onselectedindexchanged="rdoSelectUser_SelectedIndexChanged"
        <asp:ListItem Selected="True" Value="0">All</asp:ListItem> 
        <asp:ListItem Value="1">Active</asp:ListItem> 
        <asp:ListItem Value="2">Disabled</asp:ListItem> 
        <asp:ListItem Value="3">Last 3 Months</asp:ListItem>          
        <asp:ListItem Value="4">Locked Out</asp:ListItem> 
</asp:RadioButtonList>                            
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server"
        <asp:Panel ID="Panel" runat="server"
            <telerik:RadGrid ID="RadGrid1" runat="server" PageSize="10" 
                 AllowPaging="True" GridLines="None" AutoGenerateColumns="False"  
                 AllowFilteringByColumn="true" EnableLinqExpressions="false" 
                 OnNeedDataSource="RadGrid1_OnNeedDataSource"
                <PagerStyle Mode="NextPrevNumericAndAdvanced"
                </PagerStyle> 
                <MasterTableView DataKeyNames="UserID" AllowMultiColumnSorting="True"
                    <GroupByExpressions> 
                    </GroupByExpressions> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="UserID" Visible="false" SortExpression="UserID"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="FirstName" SortExpression="FirstName" HeaderText="First Name"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Username" SortExpression="Username" HeaderText="User ID"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Email" SortExpression="Email" HeaderText="Email"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Status" SortExpression="Status" HeaderText="Status"
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
                <ClientSettings > 
                    <Selecting AllowRowSelect="True"></Selecting> 
                    <Scrolling AllowScroll="True"></Scrolling> 
                    <ClientMessages /> 
                </ClientSettings> 
            </telerik:RadGrid> 
        </asp:Panel> 
</asp:Content> 
 
Dany
Top achievements
Rank 1
 answered on 18 Aug 2010
2 answers
199 views
I have a RadListBox in an editable FormTemmplate inside a RadGrid.  The ListBoxItems have checkboxes, and their data values are populated with a SQL DataSourceId.  When I select a grid row to edit, and the form populates, the ListBoxItem that matches to the data record is highlighted (selected), but its checkbox is not checked as it should be.  I've looked for a property to control this without luck.  How can I bind the ListBox such that it will check 'on' the selected ListBoxItem(s)?

This is the html:
<telerik:RadGrid ID="rgTodos" runat="server" EnableAJAX="True" AllowAutomaticUpdates="False" OnItemCommand="rgTodos_ItemCommand">
  <MasterTableView CommandItemDisplay="Bottom">
     <EditFormSettings EditFormType="Template">
        <FormTemplate>
           <table style="width: 80%" align="center">
              <telerik:RadListBox ID="listWho" runat="server" DataSourceID="dsTodoWho"
                DataTextField="wholist" DataValueField="who" Height="100px" Width="169px"
                Skin="Vista" CheckBoxes="true"  SelectedValue='<%# Bind("who") %>' 
                SelectionMode="Multiple">
              </telerik:RadListBox>

Thanks,  Dan
Dan
Top achievements
Rank 2
 answered on 18 Aug 2010
1 answer
230 views
Hi,

Our application is hosted on IIS7 64-bit, It is working fine on IIS6 but from IIS7 we are facing some issues:

When trying to execute a code which has radconfirm we are getting following errors:

 

  •  ASP.NET Ajax client-side framework failed to load
  • 'Sys' is undefined
  • “Telerik.Web.UI” is undefined

 

I tried with all steps mentioned in http://www.telerik.com/help/aspnet-ajax/troubleshooting.html but of no use.

Please help.

Regards,
Sudhanva

Maria Ilieva
Telerik team
 answered on 18 Aug 2010
2 answers
182 views
Hi,
I am working on RadGrid. I have problem about MasterTableView and DetailTables.

In my scenario, My Parent grid have a checkbox and Child grid also have checkbox. When I check Master parent grid row then child grid checkbox row checked all the row automatically.  e.g.

1001 computer 1000 USD (checkbox)
1 mouse 500 USD (checkbox)
2 Key broad 500 USD (checkbox)


In above example 1001 row is my parent grid row and remaining are child  grid rows. When i checked the parent grid checkbox then child grid checkbox automatically checked. I hope you understand my logic. 

Regards
Mohsin JK
mohsinjk jk
Top achievements
Rank 1
 answered on 18 Aug 2010
1 answer
117 views

Hello!

 


I know that i can use this javascript code to iterate tru all itens of my grid
With pagination i have a problem ... I just can iterate in tru those wich are in
the page ...
How can i iterate in all the itens, it´s not possible ???

I would be happy if you can help me please  ..

Thanks

Ricardo.

My code:

for (var row = 0; row < masterTable.get_dataItems().length; row++) {
//iterate just tru the itens in the page

}


Tsvetina
Telerik team
 answered on 18 Aug 2010
1 answer
76 views
   function Fill(a, b) {
        var selectDates = new Array();
        var i = 0;
        //b.setDate(b.getDate() - 1);
        var selectDate = b;        
        while (i <= a) {
            var newTripplet = [selectDate.getFullYear(), selectDate.getMonth(), selectDate.getDate()];
           
            selectDates[i] = newTripplet;
            selectDate.setDate(selectDate.getDate() + 1);           
            i++;
        }
        alert(selectDates);

        calen = $find("<%=CalendarSearchRoom.ClientID %>");
        calen.unselectDates(calen.get_selectedDates());
        
        calen.selectDates(selectDates, true);

    }

if I click on particular date then all nights are selected but not selected which I click
Maria Ilieva
Telerik team
 answered on 18 Aug 2010
1 answer
118 views
Hi,

I am having a radgrid assosiated with a radajaxmanager and radajaxloadingpanel. I am using usercontrol insert and edit forms. I am having a button inside insert form (usercontrol). On click of that button i want to confirm with the user. So i wrote the script to call a radconfirm onclientclick of that button and if [OK] button is clicked in the confirm box, i am programatically calling the button click from javascript code using buttonObj.click();

My code works well in following cases,
                  1. if i use image button in place of asp:button (or)
                   2. if i remove the radajaxmanager and ajaxpanel from the the parent page.

But not with the normal asp:button. Can you please help me in sorting out the problem.

My script to call radconfirm,

<script type="text/javascript">
        var buttonObj;
        var confirmValue = false;
    
        function UpdateConfirm(btn) {
            if (!confirmValue) {
                buttonObj= btn;
                var confirmString = "Do you wish to update?.";
                radconfirm(confirmString, UpdateConfirmCallBackFn, 300, 120, "", "Confirm Update");
                return false;
            }
        }

    function

 

UpdateConfirmCallBackFn(arg) {

 

 

        if (arg) {

 

            confirmValue=

true;

 

            buttonObj.click();

 

        }

 

   }



My button inside the usercontrol insert form,

<asp:Button ID="btnUpdate" runat="server" Text="Update"
        ValidationGroup="grp" OnClick="btn_Click" OnClientClick="return UpdateConfirm(this);" />

My RadAjaxManager Code in the parent grid page,

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
            Loading...
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="grid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grid1" />
                                            </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

Regards,
Saravanan K
Maria Ilieva
Telerik team
 answered on 18 Aug 2010
1 answer
94 views
Hi,
I am looking for a slidedown feature like http://nettuts.s3.amazonaws.com/127_iNETTUTS/demo/index.html to open the edit/add form in raddoc similar to igoogle widget. 

Pl. refer below link for discussion.
http://demos.telerik.com/aspnet-ajax/dock/examples/edittitle/defaultcs.aspx


I would appreciate if someone can share sample code which demonstrate this feature.  Thanks in advance.

-ambuj.
Pero
Telerik team
 answered on 18 Aug 2010
3 answers
179 views
I'm testing the RadScheduler in an MVC app using a custom provider.  When setting resource types, I use the following code:

public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner) {
    List<ResourceType> resourceTypes = new List<ResourceType>();
    resourceTypes.Add(new ResourceType("Staff", false));
    resourceTypes.Add(new ResourceType("Client", true));
    return resourceTypes;
}

However, when adding/editing appointments in the Scheduler, both Client and Staff resource lists show up as a single-choice dropdown, rather than the multi-choice checkboxes expected for the Client type.

If I specify the ResourceTypes at design-time using the Resource Type Editor, the Client resources are displayed correctly with checkboxes.  This is a tolerable solution, but it defeats the purpose of specifying ResourceTypes from the provider, and seems to contradict the information in the help file saying that the Scheduler gets its information from the data provider.

I've also looked at the article telling how to create a provider that supports multiple resource values, but that article is out of date as the provider property 'SupportsMultipleResourceValues' is now listed as obsolete.

Is the Scheduler supposed to use ResourceTypes as specified by the provider, or is using the Resource Type Editor the only way to allow for multiple resource selection?

Thanks
Peter
Telerik team
 answered on 18 Aug 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?