Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
133 views
Hello,

after updating the ASP.Net controls from Q3 2011 to Q1 2012 the following problem occured;
When disabling the RadDatePicker and hide the DatePopupButton the display of the date is a litlle bit unexpected :-). If the DatePopupButton stays vsible everything works fine but when visible is false than there's my problem.

.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.PanelBar_Default" %>
 
<%@ Register Src="~/PanelBar/WebUserControl.ascx" TagName="ucpb" TagPrefix="usercpb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
  <title></title>
  <style type="text/css">
     
  </style>
  <script type="text/javascript">
  </script>
</head>
<body>
  <form id="form1" runat="server">
  <telerik:RadScriptManager ID="ScriptManager1" runat="server">
  </telerik:RadScriptManager>
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
  </telerik:RadAjaxManager>
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Outlook">
  </telerik:RadAjaxLoadingPanel>
  <telerik:RadScriptBlock ID="ScriptBlock1" runat="server">
    <script type="text/javascript">
    </script>
  </telerik:RadScriptBlock>
  <telerik:RadAjaxPanel runat="server" ID="rapHourControl" LoadingPanelID="RadAjaxLoadingPanel1">
    <div style="width: 100px;">
      <telerik:RadDatePicker runat="server" ID="rdpDate" Skin="Windows7" Width="100px"
        TabIndex="2" DatePopupButton-TabIndex="-1">
        <DateInput ID="rdpDateInput" runat="server" EmptyMessage="Required">
          <EmptyMessageStyle BackColor="#FFF1F1" Font-Italic="True" ForeColor="Red" />
          <FocusedStyle BackColor="#CCFFCC" />
        </DateInput>
      </telerik:RadDatePicker>
    </div>
  </telerik:RadAjaxPanel>
  </form>
</body>
</html>

aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using Telerik.Web.UI;
using System.Data;
 
namespace WebApplication1
{
  public partial class PanelBar_Default : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      rdpDate.Enabled = false;
      rdpDate.DatePopupButton.Visible = false;
    }
 
    protected override void OnInit(EventArgs e)
    {
      base.OnInit(e);
 
      rdpDate.SelectedDate = DateTime.Now;
    }
  }
}

Anyone?

Regards,
  Jos Meerkerk



Vasil
Telerik team
 answered on 07 May 2012
4 answers
101 views
Editor: any option for thesaurus? Could I integrate something like nhunspell or mythes?

Form fields: Is there any built in way to dynamically add /duplicate a group of fields including upload?

Thanks, Marty
moegal
Top achievements
Rank 1
 answered on 07 May 2012
2 answers
120 views
This is what I'm trying to achieve:

I have some data that I want to export using a click of a button. When the user clicks the export button, I'm creating mutliple RadGrids dynamically, adding them to the form, and triggering the ExportToExcel() method.

This is part of the code:
For Each Vendor_ID As Integer In hashDataByVendor.Keys
    Dim tempRadGrid As New Telerik.Web.UI.RadGrid
    Dim dtVendor_ID As System.Data.DataTable = hashDataByVendor(Vendor_ID)
    tempRadGrid.DataSource = dtVendor_ID
    Dim vendor As New Vendor(Vendor_ID)
    tempRadGrid.ID = String.Format("{0}-{1}", vendor.Vendor_Name, Date.Now.ToString("MMddyyyy_HHmmssfff"))
    tempRadGrid.MasterTableView.Caption = String.Format("{0} ETA List for {1}", vendor.Vendor_Name, Date.Today.ToString("MM/dd/yyyy"))
 
    Dim tempColumnGrid As New Telerik.Web.UI.GridBoundColumn
    tempRadGrid.MasterTableView.Columns.Add(tempColumnGrid)
    tempColumnGrid.DataField = "Task_ID"
    tempColumnGrid.HeaderText = "Task ID"
    tempColumnGrid.ItemStyle.HorizontalAlign = HorizontalAlign.Left
 
    tempRadGrid.MasterTableView.ShowHeader = True
    tempRadGrid.AutoGenerateColumns = False
    tempRadGrid.ExportSettings.HideStructureColumns = False
    tempRadGrid.ExportSettings.ExportOnlyData = True
    tempRadGrid.ExportSettings.FileName = String.Format("{0} - {1}", vendor.Vendor_Name, Date.Now)
    tempRadGrid.ExportSettings.OpenInNewWindow = True
    Page.Controls.Add(tempRadGrid)
    tempRadGrid.DataBind()
    intTempVendor_ID = vendor.Vendor_ID ' Store the current vendor_id so we can use it in the GridExporting Sub.
    tempRadGrid.MasterTableView.ExportToExcel()
 
    AddHandler tempRadGrid.GridExporting, AddressOf tempRadGrid_GridExporting
    intVendorsCounter += 1
Next

When there is only ONE Grid created through this loop - everything works fine.

When there is more then one Grid created I'm getting an error: 

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

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.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

Line 355:                tempRadGrid.ExportSettings.FileName = String.Format("{0} - {1}", vendor.Vendor_Name, Date.Now)
Line 356:                tempRadGrid.ExportSettings.OpenInNewWindow = True
Line 357:                Page.Controls.Add(tempRadGrid)
Line 358:                tempRadGrid.DataBind()
Line 359:                intTempVendor_ID = vendor.Vendor_ID ' Store the current vendor_id so we can use it in the GridExporting Sub.



Any clue on how to solve this matter?
Daniel
Telerik team
 answered on 07 May 2012
1 answer
37 views
Hi All,

I have 2 questions about RadEditor

1. How can I add an item (like insert image) to my editor using ribbon mode with default tools?
2. Is there any way to add RTL and LTR buttons to RadEditor in ribbon mode with default tools?

Thank you.
Rumen
Telerik team
 answered on 07 May 2012
1 answer
188 views
I need to convert radgrid which has detail tables to html and send by email.

HtmlTextWriter

 

 

a = null; ;

 

rg.RenderControl(a);


does not work ( looked at http://gchandra.wordpress.com/2006/08/23/export-datagrid-to-html/)
error: rg is not a registered sctript control...script controls must be registerd using registerscriptcontrol() before calling registerscriptDescription()...

Can you send some working sample for convert radgrid to html text.
or some sample code for looping grid master and detail table  to get out put html text.

Please help!!!
Shinu
Top achievements
Rank 2
 answered on 07 May 2012
3 answers
255 views
Is there a simple way to have the dropdown (the "child menu") centered instead of aligned left or right? I guess you could write a function to calculate it and then use OffsetX property, but that seems very complicated. This should be a standard option I believe in the designer. 
Princy
Top achievements
Rank 2
 answered on 07 May 2012
1 answer
78 views
hello,

i have a radgrid joined with an sqldatasource and 4 datakeys. my problem is that autoupdate does not work because i have 4 datakeys. could you please tell how sql updatecommand in sqldatasource must be when you have more than one datakeys?

thanks!!!
Antonio Stoilkov
Telerik team
 answered on 07 May 2012
1 answer
614 views
Hello,

I have a page that has a filter control on it. The filter controls a Radgrid that has button links on it to show more details of the filtered rows. When users click the back button on the browser to return to the page with the filter, the filter is showed again on its initial state, this is, it does not preserve the last search/filtered options selected. Is there a way that I can preserve this without having to force my users to not to use the back button?

Thanks!
Tsvetina
Telerik team
 answered on 07 May 2012
1 answer
187 views
Hi,

I am trying to add items to a toolbar dynamically per need - the idea is that each page can have a set of "action buttons" which may differ per page so the toolbar need to be loaded dynamically. The dynamical loading of the same items works but when attempting to add new items on a postback the new item isn't displayed in the toolbar.
The dynamic loading of the toolbar is done in the OnInit event and the items are added on each postback (I don't use IsPostback). The toolbar is wrapped in an ASP.NET UpdatePanel. I also do call .Update() to make sure the UpdatePanel content is updated.
I've tried without the UpdatePanel either just to see but neither of them worked.
Is there any way to actually add items in a dynamic fashion?

Update
I donwloaded the latest Telerik controls to see if this has been fixed as i was using an older version od the Rad controls.
here is my code
<form id="form1" runat="server">
        <tl:RadScriptManager ID="rsm1" runat="server"></tl:RadScriptManager>
 
        <asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Label ID="lb1" runat="server"></asp:Label>
 
                <tl:RadToolBar ID="Toolbar1" runat="server" AutoPostBack="true">
                </tl:RadToolBar>
 
                <asp:Button ID="bt1" runat="server" Text="submit" OnClick="bt1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
 
        <%--<tl:RadAjaxManager ID="am1" runat="server">
            <AjaxSettings>
                <tl:AjaxSetting AjaxControlID="Toolbar1">
                    <UpdatedControls>
                        <tl:AjaxUpdatedControl ControlID="Toolbar1" />
                        <tl:AjaxUpdatedControl ControlID="lb1" />
                    </UpdatedControls>
                </tl:AjaxSetting>
                <tl:AjaxSetting AjaxControlID="bt1">
                    <UpdatedControls>
                        <tl:AjaxUpdatedControl ControlID="Toolbar1" />
                        <tl:AjaxUpdatedControl ControlID="lb1" />
                    </UpdatedControls>
                </tl:AjaxSetting>
            </AjaxSettings>
        </tl:RadAjaxManager>--%>
    </form>
and the code behind C#:
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
 
    //PopulateToolbar();
}
 
protected void Page_Load(object sender, EventArgs e)
{
    PopulateToolbar();
    Toolbar1.ButtonClick += new RadToolBarEventHandler(Toolbar1_ButtonClick);
}
 
public void PopulateToolbar()
{
    RadToolBarButton button;
    DropDownList ddl;
     
    Toolbar1.Items.Clear();
    Toolbar1.AutoPostBack = true;
 
    button = new RadToolBarButton();
    ddl = new DropDownList();
    ddl.ID = "ddl1";
    ddl.Items.Add(new ListItem("One"));
    ddl.Items.Add(new ListItem("Two"));
    ddl.Items.Add(new ListItem("Three"));
    ddl.AutoPostBack = true;
    ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
    button.Controls.Add(ddl);
    //
    Toolbar1.Items.Add(button);
 
    button = new RadToolBarButton();
    button.Text = "Refund";
    button.CommandName = "action";
    button.CommandArgument = "refund";
    Toolbar1.Items.Add(button);
}
 
protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
{
    DropDownList ddl;
    string szValue;
 
    ddl = sender as DropDownList;
    szValue = ddl.SelectedValue;
    lb1.Text = "ddl value changed: " + szValue;
}
 
protected void bt1_Click(object sender, EventArgs e)
{
    RadToolBarButton button;
    DropDownList ddl;
 
    button = new RadToolBarButton();
    button.Text = "Void";
    button.CommandArgument = "void";
    button.CommandName = "action";
    //
    Toolbar1.Items.Add(button);
}
 
protected void Toolbar1_ButtonClick(object sender, RadToolBarEventArgs e)
{
    lb1.Text = e.Item.Text + " clicked";
}

I've tested this with the RadAjaxManager and with the ASP.NET UpdatePanel getting the same result. Also tried to load the Toolbar controls from OnInit and Page_Load with a subtle change in the behaviour but both with a bug.
I want to be able to maintain the DropDownList between postbacks and also be able to dynamically add/remove Toolbar items (DropDownList, ToolbarButtons you name it) between postbacks.
I was thinking to use the RadToolBarDropDown instead of the ASP.NET DropDownList but the Telerik version doesn't seem to have certain behaviours as the ASP.NET version has built in, ie:
1. when a button is clicked in the DropDown the clicked item is not set to the DropDown.Text attribute (should be easy to do through javascript but still is a kind of fix needed) - it may be a design decision but still
2. cannot set a default DropDown item, say if I want to have on page load to have item 2 to be "selected/clicked". There seems to be a DropDown.Text attribute but still no Value/CommandArgument or such attribute holding the "clicked" button's value.
Kate
Telerik team
 answered on 07 May 2012
1 answer
117 views

Dear Team,

I have used "GridButtonColumn",

<rad:GridButtonColumn ButtonType="ImageButton" ImageUrl="../images/delete.gif" CommandName="Remove"

                               

 

ConfirmTitle="Remove" ConfirmDialogType="RadWindow" HeaderText="Remove" Text="Remove"

 

UniqueName="RemoveCommandColumn">

 

</rad:GridButtonColumn>



In item data bound event based on some condition.We are disabling the button.As below,

lnkgrdRemove.Enabled = fasle;

After disabling the button,Tooltip is not coming on mouse over(Firefox 3.6 only).Please let me know how can we fix it?

 

 

Milena
Telerik team
 answered on 07 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?