Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
79 views

Hello

I have this senario

 <RadSplitter
      <RadPane
           <RadGrid ID="RadGrid1"></RadGrid>
      </RadPane
      <RadSplitBar />
      <RadPane
           <WebUserControl(inside the usercontrol is a Grid named "RadGrid2")
      </RadPane

 </RadSplitter

 <button1
 <button2

How can i reload the RadGrid1 and RadGrid2 on button1 click???
My problem here is that i can not reload the grid inside the usercontrl.

I have tried to reload the WebUsercontrol and the 2 loadingpanel show but the grid did not update its datasource...
It it went through all WebUserControls serverside codes but even if the datasource was new, the display is still old.

Hope you could Help!

Pavlina
Telerik team
 answered on 07 Oct 2010
2 answers
78 views
Issue: When the back button is clicked using Internet Explorer (version 7,8) on a page that has a Rad Ajax Manger the page re-loads as thought it has not been hit before.  

I would like the page to be stored in cache so that the form on the page is not empty when the user hits the back button.  Internet Explorer is the only browser that reloads the page, chrome stores the page and the form is filled in.

Is there a way to make IE "cache" the page so the form will be filled in when a user hits the back button?
AIU Web Services
Top achievements
Rank 1
 answered on 07 Oct 2010
0 answers
41 views
Hi ,

I have included Radscript manager in my sharpeoint webpart , when I hover te cursor on any of the top or left hand menu items of sharepoint site I am getting error as "Microsoft JScript runtime error:Object expected" ,can any one suggest as how to go about the same,please find the code block below

        protected override void OnLoad(EventArgs e)
        {
                base.OnLoad(e);
                ScriptManager scriptManagerchecknow = ScriptManager.GetCurrent(this.Page);
                if (scriptManagerchecknow == null)
                {
                    scriptManagerchecknow = new RadScriptManager();
                    this.Controls.AddAt(0, scriptManagerchecknow);
                 }
          }
Regards
Srujan.N

Srujan
Top achievements
Rank 1
 asked on 07 Oct 2010
1 answer
108 views

Hi Guys,

I need radcombobox's "AutoComplete" & "LoadOnDemand" functionalities together with "MarkFirstMatch= true".


Thanks'
Ravi
Kalina
Telerik team
 answered on 07 Oct 2010
1 answer
81 views
I want to add additional controls (buttons) in the title bar of the RadWindow, I just wanted to check if this ( http://www.telerik.com/support/kb/aspnet-ajax/window/adding-a-custom-button-to-radwindow-titlebar.aspx ) code sample is still current and the best suggested way to do this? 

Thanks! 
Georgi Tunev
Telerik team
 answered on 07 Oct 2010
8 answers
236 views
Hello,
I'd like to refresh the page's title from an asp:Timer.
I'm in a master/detail ASP.NET scenario.
My Site.Master contains a telerik:RadAjaxManager (with the default EnableAJAX and EnablePageHeadUpdate set to "true"):
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="myTimer">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="label1" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManager>
Here is my (simplified) Tick event:
protected void myTimer_Tick(object sender, EventArgs e)
{
    label1.Text = "ABC";
    titrePage.Text = "DEF";
}

Here is the way I made the title editable from code-behind:
<head runat="server">
    <title id="titrePage" runat="server"></title>
</head>

The update of the label1 is OK, but the page's title isn't (note: the title *is* updated in a no-AJAX scenario).
I tried a:
<telerik:AjaxUpdatedControl ControlID="pageTitle" /> but it fails my entire page.
Thanks for your help ;).
Maria Ilieva
Telerik team
 answered on 07 Oct 2010
3 answers
166 views

I've accomplished having a Menu Item open a radWindow for the Menu control by setting the NavigateUrl attribute to empty string for those items I want to open the radWindow (as instructed by telerik support/forums -- only items with no NavigateUrl run the ItemClick event). I can obviously set the Node's NavigateUrl attribute to empty string as well on NodeDataBound event, but the SiteMap control does not provide an ItemClick/NodeClick event.

What's the best method for accomplishing this until you guys implement an similar Click event for the SiteMap control?

Thanks...
Helen
Telerik team
 answered on 07 Oct 2010
2 answers
134 views
I have a problem with the new window disappearing on load.  It seems to only happen with the MasterPage being used.

Link: (this link uses a page with no masterpage, with a tabstrip, multipageview)

http://www.bobbarker.com/DTIF/payment.aspx

the first click here link is a standard javascript window.open call.
the second click here link is a telerik radwindow.

both work.

then you go here and it is the SAME page, controls, etc. except it is using a MasterPage.

http://www.bobbarker.com/DTIF/Full/Account/Shop/payment.aspx

the javascript one works, the telerik radwindow opens, but then disappears.

So now I have altered the code to create the window from the code behind instead of calling the javascript function.  The window is created and visible but some how the menu control created in the MasterPage is still on top of that window while everything else on the page is behind the new window!!!!   SEE IMAGE
Georgi Tunev
Telerik team
 answered on 07 Oct 2010
1 answer
186 views

I opened a support ticket for this already (# 354150 ) - but wanted to get the community input on this as well and to share the solution - I'm sure I won't be the first or last to ask these questions...


I am creating a RadGrid on a page where this particular RadGrid is "loosely" bound in the sense that it only serves as a visualization of a 'summary' of some data that is presented elsewhere on another grid.

The visual paradigm desired is for a left-most column that is a GridClientSelectColumn followed by 2 more bound columns, one for an ID and another for a Name.  The remaining columns are dynamic based on another piece of supporting data (Unit Types)...  so the # of columns will vary depending on data. These dynamic columns are simply built to contain a single CheckBox control. I'm using a Template Column in this case because we want the CheckBox columns to always be editable without the row being in 'Edit' mode (if I set the row to edit mode manually, the alternating row-color theming is lost and the client wants to retain it)...  What I found was that the checkbox control in a template column was editable in all cases... a good thing for this particular scenario...

From what I've read it is reccomended to not mix static/dynamic column definition so all columns are being added dynamically at runtime in the Page_Init event (this Grid is hosted on a UserControl, not a true Page)... An additional noteworthy point is that the Page contains a RadTabStrip and RadMultiPage within a RadAjaxPanel... the UserControl hosting this RadGrid is on a RadPage (2nd tab if that matters) ....

The grid is defined in the markup as follows:

<telerik:RadGrid ID="TransporterAssignmentGrid" runat="server" OnItemCreated="TransporterAssignmentGrid_ItemCreated"
                OnItemDataBound="TransporterAssignmentGrid_ItemDataBound" OnNeedDataSource="TransporterAssignmentGrid_NeedDataSource"
                Width="99%" AutoGenerateColumns="false">
    <ClientSettings>
         <Selecting AllowRowSelect="true" />
    </ClientSettings>
    <MasterTableView DataKeyNames="TransporterId">
    </MasterTableView>
</telerik:RadGrid>

 

Then in the Page_Init event there is a call to the "CreateTransporterAssignmentGridColumns" operation whose code contains the follwing:

// Create the GridClientSelectColumn (checkbox/row-selection)...
GridClientSelectColumn gridClientSelectColumn = new GridClientSelectColumn();
gridClientSelectColumn.UniqueName = "GridClientSelectColumn";
gridClientSelectColumn.HeaderStyle.Width = System.Web.UI.WebControls.Unit.Pixel(25);
gridClientSelectColumn.ItemStyle.Width = System.Web.UI.WebControls.Unit.Pixel(25);

this.TransporterAssignmentGrid.MasterTableView.Columns.Add
    (
        gridClientSelectColumn
     );

// Create the TransporterId bound column...
GridBoundColumn transporterIdGridBoundColumn = new GridBoundColumn();
transporterIdGridBoundColumn.UniqueName = "TransporterIdColumn";
transporterIdGridBoundColumn.DataField = "TransporterId";
transporterIdGridBoundColumn.DataType = typeof(Int32);
transporterIdGridBoundColumn.ReadOnly = true;
transporterIdGridBoundColumn.HeaderText = "Transporter ID";
transporterIdGridBoundColumn.HeaderStyle.Width = System.Web.UI.WebControls.Unit.Pixel(125);
transporterIdGridBoundColumn.ItemStyle.Width = System.Web.UI.WebControls.Unit.Pixel(125);
 
this.TransporterAssignmentGrid.MasterTableView.Columns.Add
    (
        transporterIdGridBoundColumn
     );

// Create the TransporterName bound column...
GridBoundColumn transporterNameGridBoundColumn = new GridBoundColumn();
transporterNameGridBoundColumn.UniqueName = "TransporterNameColumn";
transporterNameGridBoundColumn.DataField = "TransporterName"; // Handled in ItemDataBound...
transporterNameGridBoundColumn.DataType = typeof(Int32);
transporterNameGridBoundColumn.ReadOnly = true;
transporterNameGridBoundColumn.HeaderText = "Transporter Name";
transporterNameGridBoundColumn.HeaderStyle.Width = System.Web.UI.WebControls.Unit.Pixel(350);
transporterNameGridBoundColumn.ItemStyle.Width = System.Web.UI.WebControls.Unit.Pixel(350);

this.TransporterAssignmentGrid.MasterTableView.Columns.Add
    (
        transporterNameGridBoundColumn
     );

// Create a column for each UnitCategory
foreach (UnitCategory unitCategory in ZoneMaintenancePage.UnitCategoryList)
{
    GridTemplateColumn gridTemplateColumn = new GridTemplateColumn();
    gridTemplateColumn.UniqueName = unitCategory.Name + "Column";
    gridTemplateColumn.HeaderText = unitCategory.Name;
    gridTemplateColumn.HeaderStyle.Width = System.Web.UI.WebControls.Unit.Pixel(100);
    gridTemplateColumn.ItemStyle.Width = System.Web.UI.WebControls.Unit.Pixel(100);
    gridTemplateColumn.ItemTemplate = new UnitCategoryColumnTemplate
        (
            this.Page,
            unitCategory.Name
         );

    this.TransporterAssignmentGrid.MasterTableView.Columns.Add
        (
            gridTemplateColumn
         );
}

The template for the Unit Category column contains a single CheckBox control...

/// <summary>
/// 
/// </summary>
private class UnitCategoryColumnTemplate : ITemplate
{
    #region Constructor

    /// <summary>
    /// 
    /// </summary>
    /// <param name="columnName"></param>
    public UnitCategoryColumnTemplate
        (
            Page parentPage,
            string unitCategtoryName                    
         )
    {
        this.ParentPage = parentPage;
        this.UnitCategoryName = unitCategtoryName;
    }

    #endregion

    #region Properties

    /// <summary>
    /// 
    /// </summary>
    public Page ParentPage { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public string UnitCategoryName { get; set; }

    #endregion

    // Control Events

    #region UnitCategoryCheckBox_CheckedChanged
      
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void UnitCategoryCheckBox_CheckedChanged(object sender, EventArgs e)
    {
        object x = sender as CheckBox;
    }

    #endregion

    // ITemplate Operations

    #region InstantiateIn

    /// <summary>
    /// 
    /// </summary>
    /// <param name="container"></param>
    public void InstantiateIn(System.Web.UI.Control container)
    {
        try
        {
            // Determine the Transporter ID...
            GridDataItem gridDataItem = container.NamingContainer as GridDataItem;

            int transporterId = Convert.ToInt32
                (
                    gridDataItem.GetDataKeyValue("TransporterId")
                 );

            CheckBox checkBox = new CheckBox();
            checkBox.ID = "Transporter" + transporterId + "_" + UnitCategoryName + "CheckBox";
            checkBox.AutoPostBack = true;

            checkBox.CheckedChanged += new EventHandler
                (
                    UnitCategoryCheckBox_CheckedChanged
                 );

            container.Controls.Add
                (
                    checkBox
                 );
        }
        catch
        {
            throw;
        }
    }

    #endregion
}

 

  • NOTE: The constructor argument/property ParentPage is only used so that calls to RadScriptManager.GetCurrent() can have a Page reference...

The item being used for the DataSource is a very simple List<T> object where the list item is a simple object with just the TransporterId property so that the grid can use that value for a DataKey... All the data binding is handled in the ItemDataBound event by using that TransporterId and other data sources...

protected void TransporterAssignmentGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem gridDataItem = e.Item as GridDataItem;

        // Reference the TransporterId from the data-binding object...
        int transporterId = Convert.ToInt32
            (
                gridDataItem.GetDataKeyValue("TransporterId")
             );

        // Reference the Transporter for the current TransporterId...
        Transporter transporter = ZoneMaintenancePage.TransporterList.FindByTransporterId
            (
                transporterId
             );

        // Reference the ZoneTransporterAssignment entries for the current Transporter...
        TransporterZoneAssignmentList transporterZoneAssignmentList = ZoneMaintenancePage.TransporterZoneAssignmentList.FindByTransporterId
            (
                transporterId
             );

        // Populate the Transporter ID/Name columns...
        gridDataItem.Cells[gridDataItem.GetIndexOfColumn("TransporterIdColumn")].Text = transporter.Id.ToString();
        gridDataItem.Cells[gridDataItem.GetIndexOfColumn("TransporterNameColumn")].Text = transporter.Name;

        // Populate the Unit Category columns...
        foreach (UnitCategory unitCategory in ZoneMaintenancePage.UnitCategoryList)
        {
            // Reference the entry for this Unit Category (should be 1 record only if any)...
            TransporterZoneAssignmentList unitCategoryTransporterZoneAssignmentList = transporterZoneAssignmentList.FindByUnitCategoryId
                (
                    unitCategory.UnitCategoryId
                 );

            // Reference & populate the CheckBox for the appropriate GridCheckBoxColumn...
            CheckBox checkBox = gridDataItem.Cells[gridDataItem.GetIndexOfColumn(unitCategory.Name + "Column")].Controls[0] as CheckBox;
            checkBox.Checked = (unitCategoryTransporterZoneAssignmentList.Count > 0);
        }
    }
}

 

  • NOTE: Above there is a custom C# Extension Method being used by the name of 'GetIndexOfColumn'

The problem I am having is being able to use the CheckBox controls' CheckedChanged event... I can not get this Event to fire properly... I have an event wired-up in the Template control class itself and have used it to set a breakpoint and test - but I never hit my breakpoint...


Additionally,

[A] I've tried adding the EventHandler during the Grid's ItemDataBound event...

[B] I've tried adding the EventHandler during the Grid's ItemCreated event...

[C] I've tried adding RadScriptManager.GetCurrent(ParentPage).RegisterAsyncPostBackControl(checkBox) in the Template (before adding to the Controls collection)...

  

 

[D] I've tried adding RadScriptManager.GetCurrent(ParentPage).RegisterPostBackControl(checkBox) in the Template (before adding to the Controls collection)...

What I have been able to diagnose this far is that I'm getting a JavaScript error, which seems to be AJAX-related from what I've found via Google searching... I am getting the "PageRequestManagerParserErrorException" error... which is what led me to trying [C] and [D] above...

When I tried [D] above, I was able to see Page_Init/Load firing but I still get an exception - but oddly enough it's related to the GridClientSelectColumn for the current grid... The server-side exception message was "Multiple controls with the same ID 'GridClientSelectColumnSelectCheckBox' were found. FindControl requires that controls have unique IDs."

What is the appropriate approach to achieve these goals?  My desired functionality would be for the CheckedChanged event handler code to reside in the User Control itself - and not the template control... 

Tsvetina
Telerik team
 answered on 07 Oct 2010
2 answers
169 views

I have a asp:TextBox and RegExpTextBoxSetting that connected to it.
I have 2 qustions:
1.  Can the RegExpTextBoxSetting use with client function for validation? (instead the RegularExpression)
      I want that the checking will done by the function.

2.  Can I connect the RegExpTextBoxSetting to RadTextBox?
     In the examples, its working only with the asp:TextBox !

 
Thanks.

Tsvetina
Telerik team
 answered on 07 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?