Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
125 views
To populate a grid, I call an asmx web service and get back the following JSON string from the JavaScript deserializer:

[{"CustomerId":"ALFKI","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":"","PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"}]

This is grid which is consuming the data:

        <telerik:RadGrid ID="GridCustomers" 
                runat="server" 
                AllowFilteringByColumn="true" 
                GridLines="None" 
                AllowPaging="true" 
                AllowSorting="true">
            <ClientSettings>
                <DataBinding Location="http://localhost/Niit/CustomerServices.asmx" 
                    EnableCaching="true" 
                    SortParameterType="Linq" 
                    SelectMethod="GetCustomers" 
                    SelectCountMethod="GetCount">
                    <DataService TableName="Customers" />
                </DataBinding>
            </ClientSettings>                
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="CustomerId" DataField="CustomerId" HeaderText="Customer ID" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

At run time, I get an exception in the Telerik JavaScript file when this line of code is executed:

var x=this._dataSource[y][t];  // this line appears before "function U()"

This is the value of this._dataSource in the watch window:

this._dataSource = "[{"CustomerId":"ALFKI","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":"","PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"}"; 

Any ideas as to why I'm getting this exception?

Thanks in advance.


Nikolay Rusev
Telerik team
 answered on 08 Sep 2009
1 answer
835 views
Is it possible to do  a row span to  a column in radgrid item row(not header row)?
It should look as follows:


__________________________________________________________
|Description                                            |                   target                        |
|__________________________________________________________|
|Description  1                                          |                   2 | 3 |
|                                       |                4 | 5 |
|                                       |                   7 | 9 |
_____________________________________________________________
|Description  1                                          |                5    | 94 |
|                                          |             6       | 8 |
|                                        |               7     | 3 |
______________________________________________________________

I can send you the screen shot of the format I need if needed. I added the table this way , since there is no way to post image in the thread.

Thanks

Shiza
Princy
Top achievements
Rank 2
 answered on 08 Sep 2009
2 answers
237 views
Hi All,

When the RAdToolBar Button is clicked , i need to invoke the javascript function. I tried to do in the below method but javascript function is not getting called!! pls help
this is ascx(since I'm using an user ctrl)

<

 

script type="text/javascript">

 

 

function DateValid()

 

{

alert(

"End Date cannot be lesser than the Start Date");

 

}

and in ascx.cs, I have the below lines to call the js function.

 

 

if (obDoSchedule.DtStartDate >= obDoSchedule.DtEndDate)

 

{

ctlButtonBar.Attributes.Add(

"onClick", "return DateValid();");

 

}

Is this correct? I'm not getting the javascript alert msg even if DtStartDate >=DtEndDate.Pls help!!

Sameh
Top achievements
Rank 1
 answered on 08 Sep 2009
1 answer
52 views
Hi All,

I am working on a case which is copying the example 

Grid / Editing with external form


In which the grid is in a user control (ascx) and the external form is in the hosting page(aspx). However my .aspx  is using masterpage.

 I got reference error when try to access controls in the hosting page from the .ascx like:

 this.Page.FindControl("pnlExternalForm").Visible = true;//code in .ascx
pnlExternalForm is in the hosting .aspx page

The codes works fine if I put them into a case without masterpage.

I think the code is right, but just not work

Any idea?

TIA

Jerry


         
Yavor
Telerik team
 answered on 08 Sep 2009
4 answers
169 views
Hi,

If i try to select multiple rows in a grid by pressing Shift Key, OnSelectedIndexChanged event is not firing (However rows are getting selected). But this works properly with ctrl key. Can someone help me in this regard?

I am using "Telerik.Web.UI.dll" version: 2009.1.402.35

Regards,
Rajiv.
Yavor
Telerik team
 answered on 08 Sep 2009
1 answer
209 views
I'm having trouble with the controlparameter of a ListBox which points to same RadGrid where the Listbox is used.

I want to populate the Listbox depending on the selected value of the Grid, so I've set a controlparameter in the datasource of the ListBox which points to the selectedItem of the Grid. However, the controlparameter always gets the default value. If I set the controlparameter to another grid (not the grid which is the parent of the ListBox) it works fine.

<GRID id=g1 Datasource = DS1>  
    <VIEW> 
    <EDIT> 
        <LISTBOX Datasource=DS2></LISTBOX> 
      </EDIT> 
</GRID> 
 
<DS1> 
    ...  
</DS1> 
 
<DS2> 
    <selectparameters> 
        <asp:ControlParameter ControlID="g1" DefaultValue="0" Name="id" PropertyName="SelectedValue" Type="Int32" />   
    </selectparameters> 
</ds2> 


Yavor
Telerik team
 answered on 08 Sep 2009
11 answers
922 views
i have 2 comboboxes when an item selects on combo1 i want to disable few items on combobox2. like this

combobox1           combobox2
1                                7
2                                8
3                                9
4                                10
5                                11

so if item 1 is selected combobox 2 only allow user to select 7 or 8. if 2 is selected only 8 or 9 can be selected. thank you for your help.
Shinu
Top achievements
Rank 2
 answered on 08 Sep 2009
3 answers
124 views
Hi,

I'm having an usercontrol(.ascx) where I need to double click on a grid and it needs to open up another usercontrol.

I do the following: in .ascx

<

 

script type="text/javascript">

 

 

function RowDoubleClick(index)

 

{

__doPostBack(

"<%= this.UniqueID %>", "RowDblClicked:" + this.Rows[index].ItemIndex);

 

}
</script>
in client events I do,

 

 

<ClientEvents OnRowDblClick="RowDoubleClick"></ClientEvents>

 

 

 


and in ascx.cs file, I do this,

 

 

public partial class CPackageMainUserControl : BaseUserControl, IPostBackEventHandler
{

 

 

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)

 

{

 

string[] postBackEventArgumentData = eventArgument.Split(':');

 

 

switch (postBackEventArgumentData[0])

 

{

 

case "RowDblClicked":

 

m_ctlPackageGroupMultiView.SetActiveView(m_ctlPackageSetUpView);

m_ctlPackageSetupUserCtrl.LoadNonDocPredefinedReports();

 

break;

 

}

}
}

(because in my cause when i dbl click on a row in a radgrid , I need to setactiveview to openup another view).

But when i do all this and try to run , I get a javascript message :

Microsoft JScript runtime error: 'this.Rows' is null or not an object.

Pls help me and correct my code and let me know what to do .
Thanks,
ZR


Shinu
Top achievements
Rank 2
 answered on 08 Sep 2009
3 answers
107 views
Hi,

I have upgraded RADControls - RADTreeView from ASP.NET to ASP.NET AJAX v2009.1.527.35.

I get the error "controls collection cannot be modified" when the page loads.
The RADControl declaration and associated code is given below.

<telerik:RadTreeView id="AllControlsTree" Runat="server" Width="99%" OnContextMenuItemClick="Tree_ContextMenuItemClick" 
OnClientContextMenuItemClicking="BeforeClientContextHandler" Height="60%"></telerik:RadTreeView> 
<TABLE cellSpacing="2" cellPadding="0" width="260"
<TR> 
  <TD onclick="AddControlsPostBack(<%= AllControlsTree.ClientID %>);" >Cell xxx 
    Add Controls To Version 
  </TD> 
</TR> 
</TABLE> 
 

Already tried
<telerik:RadTreeView id="AllControlsTree" Runat="server" Width="99%" OnContextMenuItemClick="Tree_ContextMenuItemClick" 
OnClientContextMenuItemClicking="BeforeClientContextHandler" Height="60%"></telerik:RadTreeView> 
<TABLE cellSpacing="2" cellPadding="0" width="260"
<TR> 
  <TD onclick="AddControlsPostBack($find('<%= AllControlsTree.ClientID %>')" >Cell xxx 
    Add Controls To Version 
  </TD> 
</TR> 
</TABLE> 
 
which gives the same error..

Regards...
Atanas Korchev
Telerik team
 answered on 08 Sep 2009
5 answers
122 views
I need to find a control for an application for work.

List the countries
then state/provinces
then cities/region.

Three dropdownlist.

Vlad
Telerik team
 answered on 08 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?