Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
106 views
Hi

I am creating the webpart in share point
I am having the the Rad schedular in side the Ajax Panel.Every thing is working fine
I need to acheive the same functionality like this(export to icalandar)
http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx.
I tried to export the individual events, at the time i got the error.Because individual item export image button inside the Ajax panel.I need to exclude this image button from Ajax inside the share point.How can i do this?

Here is my code

 public class AppTemplate : ITemplate

    {
        private DataTable dtfinalResult = new DataTable();
        private ScriptManager _ScriptManager;
        public AppTemplate(DataTable dtResult, ScriptManager ScriptManager)
        {
            dtfinalResult = dtResult.Copy();
            _ScriptManager = ScriptManager;
        }
       
        public void InstantiateIn(Control container)
        {
            ImageButton imgexport = new ImageButton();
            imgexport.CommandName = "Export";
            imgexport.ImageUrl = "/_layouts/images/smallOutlook.gif";
            imgexport.Width = new Unit(20);
            //Exclude from the Ajax
            //_ScriptManager.RegisterPostBackControl(imgexport);
            //imgexport.Attributes.Add("onclick", string.Format("realPostBack(this, \"\"); return false;"));
                //container.Controls.Add(imgexport);
            Literal subject = new Literal();           
            subject.DataBinding += subject_DataBinding;           
            container.Controls.Add(subject);
            CalendarPlus calendarplus = new CalendarPlus(); 
           
       
        }

        private void subject_DataBinding(object sender, EventArgs e)
        {
            Literal subject = (Literal)sender;
            IDataItemContainer aptContainer = (IDataItemContainer)subject.BindingContainer;

            //Access the appointment object and set its AllowEdit property:
            SchedulerAppointmentContainer aptCont = (SchedulerAppointmentContainer)subject.Parent;
            Appointment app = aptCont.Appointment;
            int APPID = int.Parse(app.ID.ToString());
            app.AllowEdit = false;
            DataView dvFinalresult = dtfinalResult.DefaultView;
            dvFinalresult.RowFilter = "FieldID=" + APPID;
            DataTable dtCurrentApp = dvFinalresult.ToTable();
            DateTime dtevent = DateTime.Parse(dtCurrentApp.Rows[0]["EventDate"].ToString());
            string strSubject = HttpUtility.HtmlEncode((string)DataBinder.Eval(aptContainer.DataItem, "Subject"));
            if (dtCurrentApp.Rows.Count > 0)
            {
                subject.Text = "<span id=\"spanID\" curDivDate=\"" + dtevent.ToString().Replace("/","_").Replace(" ","_")+ "\" title='' onmouseover=\"wsc_showmenu(this); return false\" ><A  HREF=\"javascript:void(window.open('" + dtCurrentApp.Rows[0]["URL"].ToString().Trim() + "'))\">" + strSubject + "</a></span>";
            }
            else
            {
                subject.Text = strSubject;
            }
        }
    }



Regards
Vairam
vairam
Top achievements
Rank 1
 answered on 01 Jul 2009
6 answers
133 views
Hi, can some ome help me.

I need to make an update once i select a row, i have a GridTemplateColumn as in Telerik Example (http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectrowwithcheckbox/defaultvb.aspx) and I need to update a database field (true/false) once is checked or unchecked. is there a way to do this?


<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn"> 
                            <HeaderTemplate> 
                             <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox> 
                            </HeaderTemplate> 
                            <ItemTemplate> 
                                <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
 

here is how i am trying to make the update.

Protected Sub ToggleRowSelection(ByVal sender As Object, ByVal e As EventArgs) 
        CType(CType(sender, CheckBox).Parent.Parent, GridItem).Selected = CType(sender, CheckBox).Checked 
 
        Dim State As String = CType(RadGrid1.MasterTableView.Items(0).FindControl("CheckBox1"), CheckBox).Checked.ToString 
        If State = "True" Then 
            SqlDataSourceArticulos.UpdateParameters(0).DefaultValue = 1 
            SqlDataSourceArticulos.UpdateParameters(1).DefaultValue = RadGrid1.SelectedValues("Solicitud") 
            SqlDataSourceArticulos.UpdateParameters(2).DefaultValue = RadGrid1.SelectedValues("NumPartida") 
            SqlDataSourceArticulos.Update() 
        Else 
            SqlDataSourceArticulos.UpdateParameters(0).DefaultValue = 0 
            SqlDataSourceArticulos.UpdateParameters(1).DefaultValue = RadGrid1.SelectedValues("Solicitud") 
            SqlDataSourceArticulos.UpdateParameters(2).DefaultValue = RadGrid1.SelectedValues("NumPartida") 
            SqlDataSourceArticulos.Update() 
        End If 
        RadGrid1.Rebind() 
        CType(RadGrid1.MasterTableView.Items(0).FindControl("CheckBox1"), CheckBox).Checked = State 
    End Sub 

Pavlina
Telerik team
 answered on 01 Jul 2009
2 answers
135 views
Hi there, I just upgraded from last years Telerik Ajax to this years latest release. One item that no longer works is our tooltip inside the radgrid. Here is our simple html and a picture of the mess. The style is now bad the scrolling and content is too small and the bottom borders are messed up too.

Picture of issue

<telerik:GridTemplateColumn AllowFiltering="false"   
    HeaderStyle-Width="25px"     
    ItemStyle-Width="25px"   
    UniqueName="QuickViewColumn">  
<ItemTemplate> 
    <asp:HyperLink runat="server" ID="hl1" style="text-decoration:underline;       
        color:Blue;   
        cursor:pointer;">view  
    </asp:HyperLink> 
    <telerik:RadToolTip ID="rtt1" runat="server" 
          IsClientID="true"   
          Width="600"   
          Height="300"   
          Skin="WebBlue"   
          Position="TopRight"   
          RelativeTo="Element"   
          Sticky="true"   
          ContentScrolling="Y"   
          ShowCallout="false"   
          OffsetX="20" > 
      <%# DataBinder.Eval(Container, "DataItem.Content") %> 
  </telerik:RadToolTip> 
</ItemTemplate> 
</telerik:GridTemplateColumn> 
Svetlina Anati
Telerik team
 answered on 01 Jul 2009
3 answers
168 views
hi i have several files on the webserver.

i tried for example to open the file in a new RadWindow. But i dont know what to do/use to make the client able to download a file..

any ideas / best practices?

thanks mario
Stuart Hemming
Top achievements
Rank 2
 answered on 01 Jul 2009
3 answers
78 views
Hi Telerik Suport Team,

I'm facing a problem of using <form> in UserControl page. This page is included in <EditFormSettings> like below :

<

 

telerik:RadGrid runat="server" ID="rgAgencyUsers" GridLines="None" DataKeyNames="AgencyUserID" DataSourceID="LinqDataSource1" >

 

<

 

MasterTableView DataKeyNames="AgencyUserID" AllowMultiColumnSorting="True" CommandItemDisplay="Top">

 

 

<

 

Columns>

 

 

.......
 </Columns>
<EditFormSettings UserControlName="Inc/EditUsers.ascx" EditFormType="WebUserControl">

 

 

<EditColumn UniqueName="EditCommandColumn1"></EditColumn>

 

 

 

</EditFormSettings>
</MasterTableView>

 

 

</

 

telerik:RadGrid>

 

 

 


In EditUsers.ascx, I'm trying to use <form> to let user perform insert/update action automatically just by pressing Enter key to submit form (No need to click on Insert/Update button). But it throws Exception that I can't use <form> tag. I've reviewed examples of how using RadGrid but finding no example that has that solution.

Please help me to solve this problem.

Thanks a lot,
Huong Nguyen.

 

 

 

 

huong nguyen
Top achievements
Rank 1
 answered on 01 Jul 2009
2 answers
123 views
Hi there,

I've wired up my radgrid to run off a webservice in the code behind file.
But when I create a webservice and place it into a different location then my radgrid doesn't populate. I'm obviously not connecting it properly.

Here is my ASPX:
            <ClientSettings> 
                <DataBinding Location="Default.aspx" SelectCountMethod="GetProductCount" SelectMethod="GetProducts"> 
                </DataBinding> 
                <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 

That works but if I change Location="Default.aspx" to Location="Products.asmx" then my grid doesn't populate.

Here is my Products.asmx:
[WebService(Namespace = "Products")] 
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.  
[System.Web.Script.Services.ScriptService] 
public class Products : System.Web.Services.WebService { 
 
    [WebMethod] 
    public static IEnumerable GetProducts(int startRowIndex, int maximumRows) 
    { 
        var northwind = new NorthwindDataContext(); 
        var products = from p in northwind.Products 
                       select new 
                       { 
                           ProductID = p.ProductID, 
                           Name = p.ProductName, 
                           CategoryName = p.Category.CategoryName, 
                           Price = p.UnitPrice, 
                           UnitsInStock = p.UnitsInStock 
                       }; 
 
        return products.Skip(startRowIndex).Take(maximumRows); 
    } 
 
    [WebMethod] 
    public static int GetProductCount() 
    { 
        var northwind = new NorthwindDataContext(); 
        var count = northwind.Products.Count(); 
        return count; 
    } 
     
} 

Thanks in advance for taking the time to help me out.
D
Darren
Top achievements
Rank 2
 answered on 01 Jul 2009
1 answer
108 views
Hi telerik,

Hopefully this one is easy...

I have a rad grid with following columns: Supplier, ProductName, Product Description.  These columns constitute an entity called line item.
On edit/insert I am using inline mode. Now, when in edit/insert mode users are able to search for supplier by supplier name or for a product by product name (I have a search icon next to each entry fields in edit/insert mode which will open a pop-up).  Once, values are selected for these fields I also need to store IDs for them behind the scene (for Supplier and for Product),
so for example my OnInsertCommand would look like this:
 
   protected void RadGrid1_OnInsertCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem item = null;
        string supplierID = String.Empty;
        string productID = string.Empty;

        item = this.RadGrid1.MasterTableView.GetInsertItem();

       // Get supplier ID for and assign to supplierID variable
          .................
        // Get product ID and assign to productID variable
       
        //Create new LIne Item
        LineItem llineItem = new LineItem();
        llineItem.GenerateALineItem(supplierID, productID, this.CurrentOrder.OrderID);
        this.CurrentOrder.Order.LineItem.Add(llineItem.GetItem());
        RadGrid1.MasterTableView.Rebind();
    }

How and where can I store these supplierID, productID for edited/new records to retrieve them in these methods (OnInsertCommand
OnItemUpdated)
Sebastian
Telerik team
 answered on 01 Jul 2009
1 answer
145 views
Please help!

We have been using telerik for some times now, we've been making this site using telerik. The site was OK until an error showed up.

Line: 6
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'Telerik.Web.UI 2009.'.

We have been using telerik but this is the first time we encountered this error.

Can anybody teach us how to solve this error

Thank you
Princy
Top achievements
Rank 2
 answered on 01 Jul 2009
1 answer
129 views
On the client, I'm perfoming the following treenode attribute update:
function onNodeClicking(sender, args) { 
    var treeNode = args.get_node(); 
    var attribs = treeNode.get_attributes(); 
    attribs.setAttribute("test", "54321"); 
 
    attribs2 = treeNode.get_attributes(); 
    alert(attribs2.getAttribute("test")); 
} 

After the PostBack, the treenode's "test" attribute hasn't been updated and the original is rendered in the TextBox.
protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack) {  
  
            RadTreeView1.Nodes.Add(new Telerik.Web.UI.RadTreeNode("Node1"));              
            RadTreeView1.Nodes.Add(new Telerik.Web.UI.RadTreeNode("Node2"));              
            RadTreeView1.Nodes.Add(new Telerik.Web.UI.RadTreeNode("Node3"));  
              
            RadTreeView1.Nodes[0].Attributes.Add("test", "1234");  
            RadTreeView1.Nodes[1].Attributes.Add("test", "1234");  
            RadTreeView1.Nodes[2].Attributes.Add("test", "1234");  
        }  
    }  
    protected void RadTreeView1_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e) {  
        TextBox1.Text = e.Node.Attributes["test"];  
    }  

I would assume this is a fairly common task and I'm just overlooking something.

Any help is appreciated!

telerik control is version 2009.1.402.35
Atanas Korchev
Telerik team
 answered on 01 Jul 2009
11 answers
213 views

Hi,

I have a RadGrid inside an <asp:panel> in my page.
The grid has a 
GridButtonColumn that does some AJAX operation in the displayed page. here is definition in the grid:

<

radG:RadGrid ID="grdFavorites" runat="server" CssClass="RadGrid"

 

 

 

 

 

AllowPaging="True"

 

 

 

 

AllowSorting="True"

 

 

 

EnableAJAX="false" EnableAJAXLoadingTemplate="false"

 

 

 

AutoGenerateColumns="False"

 

 

 

Skin="None"  

 

 

LoadingTemplateTransparency="7"

 

 

 

 

PageSize="100" Width="100%" GridLines="None"

 

 

 

OnItemCommand="grdFavorites_ItemCommand"

 

 

 

 

 

OnItemDataBound="grdFavorites_ItemDataBound" onfocus="this.blur();"

 

 

 

 

AllowMultiRowEdit="true"

 

 

 

 

OnNeedDataSource="grdFavorites_NeedDataSource">  

 

 

<ClientSettings>

 

 

 

 

 

<ClientEvents OnRequestStart="RequestStart" />

 

 

 

 

 

</ClientSettings>

 

 

 

<MasterTableView

 

 

 

HeaderStyle-CssClass="RadGridHeader"

 

 

 

FooterStyle-CssClass="RadGridHeader"

 

 

 

ItemStyle-CssClass="RadGridItem"

 

 

 

AlternatingItemStyle-CssClass="RadGridAltItem"

 

 

 

Width="100%"

 

 

 

GridLines="none" DataKeyNames="Id" Style="cursor:pointer;"

 

 

 

AllowMultiColumnSorting="True"

 

 

BorderWidth="0">

 

 

<Columns>

 

 

.......
<radG:GridButtonColumn ItemStyle-Width="7%" ButtonType="ImageButton" ImageUrl="../Images/MyImage.gif"

    HeaderText="Remove"

    UniqueName="RemoveFavorites" CommandName="RemoveFromFavorites"

    Reorderable="False" Resizable="False">

    <ItemStyle Width="40px" />

    <HeaderStyle Width="40px" />

</radG:GridButtonColumn>

</

Columns>

 

 

 

This works ok on IE (tested versions 6-7). However, in Firefox I get an error, It seems the error is on the imagebutton (see the below NET error).

Can anyone help out on this one? Is this a known issue? I can debug the code, but I think it is useless...

 

 Thank you!

 

Server Error in 'xxx' Application.


Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[FormatException: Input string was not in a correct format.]

   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599

   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112

   System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +138

   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +12

   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194

 


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

Sebastian
Telerik team
 answered on 01 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?