This is a migrated thread and some comments may be shown as answers.

[Solved] Declarative client data binding, custom argument

1 Answer 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 19 May 2009, 07:04 AM
Hi,
    I am trying to use the declarative client binding method to bind radgrid using webservice. I am having trouble passing the custom argument. When i use the standard 4 arguments everything works. Once i add my custom argument it stops working. i don't get any error, grid doesn't even call the webservice.

    Here is what i have in ASPX...

<telerik:RadGrid ID="RadGrid1" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true" 
            AutoGenerateColumns="false" runat="server">  
            <MasterTableView > 
                <Columns> 
                    <telerik:GridBoundColumn DataField="DocID" HeaderText="DocID" /> 
                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" /> 
                </Columns> 
            </MasterTableView> 
            <PagerStyle Mode="NumericPages" /> 
            <ClientSettings> 
                <DataBinding Location="http://localhost/iProWS/GetGridData.asmx" 
                    SelectMethod="GetDataAndCount" EnableCaching="true"  /> 
                    <ClientEvents OnDataBinding="RadGrid1_DataBinding" /> 
            </ClientSettings> 
        </telerik:RadGrid> 

Here is the java script
function RadGrid1_DataBinding(sender, args)  
        {  
             var methodArguments = args.get_methodArguments();  
                
             methodArguments.WhereCond = "myValue";  
             args.set_methodArguments(methodArguments);  
       }  
 
i tried to use as listed in the demo, but no luck
function RadGrid1_DataBinding(sender, args)  
        {  
            var myMethodArguments = new Object();  
            myMethodArguments.WhereCond = "myValue";  
            args.set_methodArguments(myMethodArguments);  
       }  
 
             

Here is the Webservice
 <WebMethod(EnableSession:=True)> _  
Public Function GetDataAndCount(ByVal startRowIndex As IntegerByVal maximumRows As IntegerByVal sortExpression As List(Of GridSortExpression), ByVal filterExpression As List(Of GridFilterExpression), ByVal WhereCond As StringAs Dictionary(Of StringObject)  
        Dim data As New Dictionary(Of StringObject)()  
 
        data.Add("Data", GetData(startRowIndex, maximumRows, sortExpression, filterExpression, WhereCond))  
        data.Add("Count"DirectCast(Session("Count"), Integer))  
 
        Return data  
    End Function 

I greatly appreciate if someone can figure out what i am doing wrong.  I looked this post which shows the same as demo but for some reason it's not working for me.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 22 May 2009, 06:41 AM
Hi Raj,

The question set forth has been addressed in the support ticket, which you have opened on the matter. To avoid duplicate posts, we can continue our communication there.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Raj
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or