Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
224 views
hi

I have 2 grids in one page. For example, Order Grid and Order Detail Grid

The Order Grid has paging enabled.

How do i pass the orderid on the Order Grid to Order Detail Grid and i page from page 1 to page 2 and so on? Thanks

So that when click page 2 on the Order Grid, it should reflect Order Detail of that OrderID on page 2. Thanks
Veli
Telerik team
 answered on 28 Dec 2009
1 answer
71 views
Hi,

I am using Radcontrols for asp.net ajax.

In a particular page, when i click on the button it gives the following error in a popup,

Sys.webforms.pagerequsetmanagerparserexception.

i have attached the screenshots also.

it dosen't give the error in the Internet Explorer. the error comes only in the Firefox.

How can i solve the problem?

Thanks,
Mano
Radoslav
Telerik team
 answered on 28 Dec 2009
1 answer
299 views

Embedding a RadMultiPage / RadTabStrip directly into a SharePoint web part works fine, but for code organization I would like to nest them into a separate control. Once I do this, the control re-creation doesn't work (at least, not the ways I have tried it :)). Specifically, when the RadMultiPage / RadTabStrip are part of the WebPartWithTelerik class (which inherits from System.Web.UI.WebControls.WebParts.WebPart), the RadGrid controls on each page allow editing correctly; however, when they are moved down into the WebPartPanel class, clicking Edit on the RadGrid on either page causes the entire page to re-load, and the controls are not in edit mode as their state has been lost.

Scenario:
* RadTabStrip / RadMultiPage combo with two RadPageView objects.
* Each RadPageView contains a single RadGrid which retrieves data via LinqToSql data sources.
* MOSS web site using VSEWSS 1.3 to build the web part in VS 2008.

I've tried a few iterations of this (attemping to serialize the container object, etc.) with no success. Here's hoping there's a simple fix out there.

Thanks,

William Cook

using System;  
using System.Runtime.InteropServices;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Serialization;  
 
using Microsoft.SharePoint;  
using Microsoft.SharePoint.WebControls;  
using Microsoft.SharePoint.WebPartPages;  
 
using Telerik.Web.UI;  
 
namespace WebPartWithTelerik  
{  
    [Guid("1d53c24d-161e-4fca-86b0-9a8f589e3ee9")]  
    public class WebPartWithTelerik : System.Web.UI.WebControls.WebParts.WebPart  
    {  
        private WebPartPanel Panel;  
        //{  
        //    get { return (WebPartPanel)ViewState["Panel"]; }  
        //    set { ViewState["Panel"] = value; }  
        //}  
 
        public WebPartWithTelerik()  
        {  
        }  
 
        protected override void CreateChildControls()  
        {  
            base.CreateChildControls();  
 
            // Add the controls to the page.  
            this.Panel = new WebPartPanel();  
            this.Controls.Add(this.Panel);  
        }  
    }  
 
    public class WebPartPanel : Panel  
    {  
        private Telerik.Web.UI.RadMultiPage MultiPage;  
        //{  
        //    get { return (RadMultiPage)ViewState["MultiPage"]; }  
        //    set { ViewState["MultiPage"] = value; }  
        //}  
        private Telerik.Web.UI.RadTabStrip TabStrip;  
        //{  
        //    get { return (RadTabStrip)ViewState["TabStrip"]; }  
        //    set { ViewState["TabStrip"] = value; }  
        //}  
 
        public WebPartPanel()  
        {  
            this.ID = "WebPartPanelID";  
        }  
 
 
        protected override void CreateChildControls()  
        {  
            base.CreateChildControls();  
 
            // Create a simple label to validate rendering of controls.  
            Label label = new Label();  
            label.Text = "Test web part for Telerik controls in a SharePoint web part.";  
            this.Controls.Add(label);  
 
            //this.ChildrenAsTriggers = true;  
            //this.UpdateMode = UpdatePanelUpdateMode.Conditional;  
 
            // Create two RadPageView objects.  
            RadPageView pageOne = new RadPageView();  
            pageOne.ID = "pageOne";  
            RadPageView pageTwo = new RadPageView();  
            pageTwo.ID = "pageTwo";  
 
            // Create the RadMultiPage object.  
            this.MultiPage = new RadMultiPage();  
            this.MultiPage.ID = "multiPage";  
            this.MultiPage.PageViewCreated += new RadMultiPageEventHandler(MultiPage_PageViewCreated);  
            this.MultiPage.PageViews.Add(pageOne);  
            this.MultiPage.PageViews.Add(pageTwo);  
 
            // Create the RadTab objects.  
            RadTab tabOne = new RadTab("One");  
            tabOne.PageViewID = pageOne.UniqueID;  
            RadTab tabTwo = new RadTab("Two");  
            tabTwo.PageViewID = pageTwo.UniqueID;  
 
            // Create the tabstrip.  
            this.TabStrip = new RadTabStrip();  
            this.TabStrip.ID = "tabStrip";  
            this.TabStrip.MultiPageID = this.MultiPage.UniqueID;  
            this.TabStrip.Tabs.Add(tabOne);  
            this.TabStrip.Tabs.Add(tabTwo);  
 
            // Add the controls to the page.  
            this.Controls.Add(this.TabStrip);  
            this.Controls.Add(this.MultiPage);  
        }  
 
        void MultiPage_PageViewCreated(object sender, RadMultiPageEventArgs e)  
        {  
            // Create a simple label to validate rendering of controls.  
            Label label = new Label();  
            label.Text = e.PageView.ID;  
            e.PageView.Controls.Add(label);  
 
            LinqDataSource dataSource = new LinqDataSource();  
            DataClassesDataContext context = new DataClassesDataContext();  
            dataSource.ContextTypeName = context.GetType().AssemblyQualifiedName; //"WebPartWithTelerik.DataClassesDataContext, WebPartWithTelerik, Version=1.0.0.0, Culture=neutral, PublicKeyToken=23df81aee7a34b62";  
            context.Dispose();  
            dataSource.EnableInsert = true;  
            dataSource.EnableUpdate = true;  
 
            // Create the grid for the page.  
            RadGrid grid = new RadGrid();  
            grid.AutoGenerateColumns = true;  
            grid.AutoGenerateEditColumn = true;  
            grid.AllowAutomaticInserts = true;  
            grid.AllowAutomaticUpdates = true;  
            grid.MasterTableView.DataKeyNames = new string[] { "TypeID" };  
            switch (e.PageView.ID)  
            {  
                case "pageOne":  
                    //dataSource.ID = "dataSourceOne";  
                    dataSource.TableName = "TableOnes";  
                    grid.ID = "gridOne";  
                    grid.NeedDataSource += new GridNeedDataSourceEventHandler(grid_NeedDataSourceOne);  
                    break;  
                case "pageTwo":  
                    //dataSource.ID = "dataSourceTwo";  
                    dataSource.TableName = "TableTwos";  
                    grid.ID = "gridTwo";  
                    grid.NeedDataSource += new GridNeedDataSourceEventHandler(grid_NeedDataSourceTwo);  
                    break;  
            }  
 
            // Bind the data source.  
            //dataSource.DataBind();  
            e.PageView.Controls.Add(dataSource);  
 
            // Add the grid to the PageView.  
            grid.DataSourceID = dataSource.UniqueID;  
            grid.MasterTableView.ID = grid.ID + "_MasterTableView";  
            e.PageView.Controls.Add(grid);  
        }  
 
        void grid_NeedDataSourceOne(object source, GridNeedDataSourceEventArgs e)  
        {  
            RadGrid grid = (RadGrid)source;  
            grid.DataSourceID = "dataSourceOne";  
        }  
        void grid_NeedDataSourceTwo(object source, GridNeedDataSourceEventArgs e)  
        {  
            RadGrid grid = (RadGrid)source;  
            grid.DataSourceID = "dataSourceTwo";  
        }  
    }  
}  
 
Nikolay Rusev
Telerik team
 answered on 28 Dec 2009
4 answers
211 views
Dear friends,

Take a look at the following code:

webappteste.WebReferenceX.Service1 sd = new webappteste.WebReferenceX.Service1(); 
DataSet ds = new DataSet(); 
ds = sd.getClientes(); //Get full list of customers from a web service
DataTable dt = new DataTable("clientes"); 
dt = ds.Tables[0]; 
RadGrid1.DataSource = dt; 
int asd = dt.Columns.Count; //Returns 58 columns - CORRECT
string tableName = ds.Tables[0].Columns[0].ToString(); //Returns the column name "CLIENTE" - CORRECT
int b = ds.Tables[0].Columns.Count; //Returns 58 columns - CORRECT
int a = RadGrid1.Columns.Count; //Return 0 columns - WRONG - Why not 58 columns???

Can you tell me why this is happening?
Is there any other way to load a DataSet into a RadGrid?

Thanks in advance!!

WebService:

[WebMethod]
public DataSet getClientes() 
  SqlDataAdapter dataAdapter = new SqlDataAdapter("SELECT * FROM CLIENTES ORDER BY    NOME",connections.retConn()) 
  DataSet dataSet = new DataSet(); 
  dataAdapter.Fill(dataSet); 
  return dataSet 
Tiago
Top achievements
Rank 2
 answered on 28 Dec 2009
4 answers
157 views
I am having trouble finding the magic setting that disables the item data labels for a line chart, and can't seem to get the x axis label's y position to change to try and move the labels closer to the axis.
Velin
Telerik team
 answered on 28 Dec 2009
5 answers
145 views
Hi All,

Here i had used RadComboBox  with _itemsrequested property and also total count of the items(i.e Items 1-5 out off 20) in the combobox at the bottom, Their is an issue regarding that (i.e on page load when i click on the combobox for the first time i am unable to get the total count of the combobox items but when i click on the area where i get that message then i will be getting the items message (i.e Items 1-5 out off 20) this message is been placed in the _itemsRequested so i am able to get the items message at the bottom of the combobox so how do i get the items count message on page load when i click on the combobox for first time.

Here is the code


protected void cmbPlatformName_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e){DataTable data = objTaskmanLib.GetData(e.Text); //GetData(e.Text); 
//objTaskmanLib is the library file from where i get the count.
  RadComboBoxItem item = new RadComboBoxItem();int itemOffset = e.NumberOfItems;int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);e.EndOfItems = endOffset == data.Rows.Count;for (int i = itemOffset; i < endOffset; i++){cmbPlatformName.Items.Add(new RadComboBoxItem(data.Rows[i]["Platform_Name"].ToString(), data.Rows[i]["Platform_Name"].ToString()));}e.Message = GetStatusMessage(endOffset, data.Rows.Count);}private string GetStatusMessage(int endOffset, int total){if (total <= 0)return "No matches";return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, total);}

Here i had used this GetStatusMessage function only in the _itemsRequested event so i am able to get the items message(i.e Items 1-5 out off 20) when i click on the area where items message is been displayed. so can any one help me how to use this function on page load also.

Thanks in advance.
Yana
Telerik team
 answered on 28 Dec 2009
2 answers
106 views
I am using the following: VS2008, Windows XP, IE7, the latest Telerik product and C#.

I have used the Configuration Tool to set my data instead of writing backend code to do so.  
My Datasource is as follows:

 

<asp:EntityDataSource ID="EntityDataSource1" runat="server"

 

ConnectionString="name=AllDataModels" DefaultContainerName="AllDataModels"

 

 

 

EntitySetName="Project" Select="it.[Name], it.[Identifier], it.[ID]">

 

 

 

</asp:EntityDataSource>

 

 

 

 

 


I have then selected from the RadGrid Tasks from the arrow in design view -->  General Features and checked "Enable Paging".

I am getting a error on the page when paging is enabled, but when paging is not enabled... the data is generated just fine and I can see all.  When I enable paging ... I get the error again.

Here is my aspx code:

<

 

telerik:RadGrid ID="RadGrid1" runat="server"

 

style="z-index: 1; left: 9px; top: 122px; position: absolute;"

 

 

 

AllowSorting="True" DataSourceID="EntityDataSource1" GridLines="None"

 

 

 

AllowPaging="True">

 

 

 <

MasterTableView AutoGenerateColumns="False" DataSourceID="EntityDataSource1">

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="Name" HeaderText="Name" ReadOnly="True"

 

 

 

SortExpression="Name" UniqueName="Name">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Identifier" HeaderText="Identifier"

 

 

 

ReadOnly="True" SortExpression="Identifier" UniqueName="Identifier">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"

 

 

 

ReadOnly="True" SortExpression="ID" UniqueName="ID">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

Thanks for any help you can give.  :)

~wen

Daniel
Telerik team
 answered on 28 Dec 2009
3 answers
141 views
Dear All

i have a radgrid, with item templates . i need to get the control in item template using javascript.

Thanks in Advance.

Regards
Balagangadharan.R
Dimo
Telerik team
 answered on 28 Dec 2009
5 answers
204 views
I've got some problems with Telerik livedemo site.
  • "Telerik' is undefined
  • Object not reference
  • Sys is undefine
i tried to reinstall telerik, .net version 2.0, 3.5... but i can not fix this problem that make me can not access any radcontrol ...
I've read many suggestion in this forum but  all of them are show the way to fix individual project. I can't understand why the live demo site in telerik get this problems.
Any Suggestion?
Many thanks.
T. Tsonev
Telerik team
 answered on 28 Dec 2009
2 answers
220 views
Argh...I apologize for bugging everyone at this time of the year, but I am having issues trying to retrieve the selected values from a combo box inside client javascript and am working on a demanding schedule.

I have a combo box (for example) populated as:

Item 1: Text=Sell; Value=1.
Item 2: Text=Rent; Value=2.
Item 3: Text=Trade; Value=3.

When the user selects an item from the combo (and enters text in a couple of textboxes) then clicks on an item on the screen, I need to open a new window and pass the value selected in the combo box.  I can't do this inside the server code, because a postback would end up basically performing a redirect and I need to keep the original window on the screen.

I cannot capture the combo box selected value when the user selects it, because they may just use the default value thus not triggering any events on the combo box before clicking on the screen item to continue.

I should add that I am using the combo box on a page that utilizes a master page, and that the combo box is defined inside a RadDock.

In my client javascript, I have tried several methods of doing this, but all I can seem to retrieve is the text value displayed in the combo box.  For examples:

Example 1.  The following code retrieves the actual visible text value from the combo (i.e. - trade, sell, rent)

a1 = document.getElementById("<%= ListTranType.ClientID %>").value;
alert(a1);

Example 2.  In the following, b1 displays [object object] and b2 displays undefined

var b1 = $find("<%= ListTranType.ClientID %>");
alert(b1);
var b2 = b1.value;
alert(b2);

Example 3.  The following code works exactly like #1 above. Only the visible text from the combo is displayed (sell, rent, trade).

var b1 = $find("<%= ListTranType.ClientID %>").value;
alert(b1);


The combo box is defined as shown below. 

<

 

telerik:RadComboBox ID="ListTranType" OnClientSelectedIndexChanged="gettrantype" EnableEmbeddedSkins="true" Skin="Black" runat="server" Width="200px" ></telerik:RadComboBox>

 

 I do have a script for capturing the value when the user selects one and it works fine as it is, but as said earlier sometimes the user will use the default value or not select one from the combo before clicking to proceed.  Both of these actions are valid within the application.  The code used to capture the value during the event is:

 

<script type="text/javascript">

 

 

 

var trantype;

 

 

function gettrantype(combo, eventArqs) {

 

 

var item = eventArqs.get_item();

 

trantypeval = item.get_value();

}


SUMMARY QUESTION:  What I need to retrieve from the combo box is the data loaded as the "value".  In the examples above, this would be either the 1, 2, or 3 -- not sell, rent, or trade.  How do I get the true selected value from the combo?

Thanks very much in advance!

Lynn




Lynn
Top achievements
Rank 2
 answered on 28 Dec 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?