Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
80 views

I have a radgrid bound to a iList of objects. I have a command button that executes a javascript function that executes an ajax request using a radajaxmanager. This request adds a number of new objects to the list then calls the rebind method of the grid. The new objects appear in the grid briefly then dissappear and only the original objects are there. If i execute the ajax request again, you can see all the newly added objects fomr the second request, plus the previously added objects from the first request, plus the original objects for a brief moment, then they dissappear and the grid only shows the original objects. 

The list actually contains all the objects, but the grid seems to be reverting back to the original cache when the app started.

Anyone seen this before? 

I am using the grid in other places without problem.
Maria Ilieva
Telerik team
 answered on 26 Mar 2012
3 answers
288 views
Hi ,
I am using RadWindowManager in my application , I need to send a argument from the Window to its parent Control.I am adding the records form Rad Window which are displayed on its parent control , when i hit a particular button i need to refresh the parent so that the records get updated in the parent control without closing the Rad Window..

Can some one help me on this?

Thanks
rdmptn
Top achievements
Rank 1
 answered on 26 Mar 2012
1 answer
82 views
I have a ribbonbar in a masterpage. What I want to accomplish is to perform a response.redirect("urlhere") when the end user clicks on a tab. I am trying to accomplish this by using the following code below:
Private Sub rrbMain_SelectedTabChange(sender As Object, e As Telerik.Web.UI.RibbonBarSelectedTabChangeEventArgs) Handles rrbMain.SelectedTabChange
    Select Case e.Tab.Text
        Case "Tab1"
            Response.Redirect("~/tab1.aspx")
        Case "Tab2"
            Response.Redirect("~/tab2.aspx")
    End Select
End Sub

Unfortunately, that does not work. Clicking on a tab does not perform any redirection. Your help is appreciated. Thanks.



Bozhidar
Telerik team
 answered on 26 Mar 2012
1 answer
415 views
Hello,

Am havinf 2 usercontrols in my project and both are having RadAjaxManager.
i have register both controls on singel page.

<%

 

@ Register TagPrefix="ModelData" TagName="ucSourscDoc" Src="~/PeerBenchmarking/controls/ucSourceDocument.ascx" %>

 

<%

 

@ Register TagPrefix="ModelData" TagName="ucUploadDoc" Src="~/PeerBenchmarking/controls/ucUploadDocument.ascx" %>

 


So its giving me error as

Only one instance of a RadAjaxManager can be added to the page!

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.InvalidOperationException: Only one instance of a RadAjaxManager can be added to the page!

i need RadAjaxManager on both usercontrol because i want to show loading image while datatloading.

Any solution for this?
Shinu
Top achievements
Rank 2
 answered on 26 Mar 2012
3 answers
211 views
Hello Telerik,

I have a non-editable RadGrid (say Grid1) with some columns. I have another grid (say Grid2) on the page which should update a hidden field (GridBoundColumn) in Grid1 when the item template asp:checkbox is clicked. The whole Grid1 should persist back to the server on another button for saving the changes, not a row at time, or after every check of Grid2. How can this be achieved in Javascript? I cant seem to find the correct syntax for the datagrid items to write to it on Grid1. The innerHTML doesnt persist back, so I cant use that. This seems like a simple thing, but the documentation doesnt show enough help for the grid items properites. Maybe I can attach and attribute to each row of Grid1 and update the attribute value. But I dont see any syntax again in the documentation. Can you please point me in the right direction? And if this is missing from the documentation please update it.

Here is the code:

Grid1:
    <telerik:RadGrid runat="server" ID="RadGridBoardPositionLink" AllowMultiRowSelection="false">
        <MasterTableView DataKeyNames="BoardPositionId" ClientDataKeyNames="BoardPositionId, ProgramLink, GroupLink" AutoGenerateColumns="false" TableLayout="Fixed" NoMasterRecordsText="You do not have any board positions created" CommandItemDisplay="Top">
        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
        <CommandItemTemplate>
            <asp:Panel runat="server" CssClass="CommandItemPanel">
                <telerik:RadButton runat="server" ID="RadButtonSaveBoardPositionLink" Text="Save"/>
            </asp:Panel>
        </CommandItemTemplate>                                          
        <Columns>
                <telerik:GridBoundColumn DataField="BoardPositionID" DataType="System.Int64" UniqueName="BoardPositionID" Display="false" />
                <telerik:GridBoundColumn DataField="ApplicationId" DataType="System.Int64" UniqueName="ApplicationId" Display="false" />                                                   
                <telerik:GridBoundColumn DataField="ProgramLink" DataType="System.String" UniqueName="ProgramId" Display="false" />
                <telerik:GridBoundColumn DataField="GroupLink" DataType="System.String" UniqueName="GroupLink" Display="false" />                                                   
                <telerik:GridBoundColumn DataField="ProgramId" DataType="System.Int64" UniqueName="ProgramId" Display="false" />
                <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Position Name" UniqueName="Name" ItemStyle-Width="25%" HeaderStyle-Width="25%" />
            </Columns>
        </MasterTableView>                                           
    <ClientSettings EnableRowHoverStyle="true">
        <Selecting AllowRowSelect="true" />                                           
        <ClientEvents OnRowSelected="RowSelectedRadGridBoardPositionLink"/>
    </ClientSettings>
</telerik:RadGrid>

Grid2:
<telerik:RadGrid runat="server" ID="RadGridProgramsLink" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowMultiRowSelection="true">
    <MasterTableView DataKeyNames="ProgramId" ClientDataKeyNames="ProgramId" CommandItemDisplay="None" AutoGenerateColumns="false" TableLayout="Fixed">
        <Columns>
            <telerik:GridTemplateColumn HeaderStyle-Width="20px" ItemStyle-Width="20px">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="CheckboxProgramCheck" AutoPostBack="false" Onclick="OnCheckedCheckBoxProgram(this);" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="ProgramId" DataType="System.Int64" UniqueName="ProgramId" Display="false" />
            <telerik:GridBoundColumn DataField="Name" DataType="System.String" UniqueName="Name" HeaderText="Program Name" HeaderStyle-Width="150px" ItemStyle-Width="150px" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

OnClick event for Grid2
function OnCheckedCheckBoxProgram( sender )
{
if ( myRowSelectedBoardPositionLink == 0 )
{
radalert( "You need to select a position to assign program(s)", 400, 100, "Assign Program", null );                                           
return false;
 }
                                         
// assign it to the attribute of the selected position record
AssignProgramId();
}

This string is created and needs to be written to Grid1, at the end of the function it writes it out, but how?

function AssignProgramId()
{
    // selected row of the Board Position to edit the ProgramId attribute
    var myCheckbox;
    var myString = "";
    var myMasterTable = $find( "<%= RadGridProgramsLink.ClientID %>" ).get_masterTableView();
                                         
    // build the array and store back in the SelectedRow - BoardPosition table
    for ( var i = 0; i < myMasterTable.get_dataItems().length; i++ )
    {
        myCheckbox = myMasterTable.get_dataItems()[i].findElement( "CheckboxProgramCheck" );
        if ( myCheckbox.checked )
        {
            myString = myString + myMasterTable.get_dataItems()[i].getDataKeyValue( 'ProgramId' ) + "|";
        }
    }
 
    myMasterTable = $find( "<%= RadGridBoardPositionLink.ClientID %>" ).get_masterTableView();
     
// ***** CODE HERE FOR WRITTING TO THE SELECTED ROW ProgramLink COLUMN ******
 
}

Thanks a ton!
SDI


Radoslav
Telerik team
 answered on 26 Mar 2012
1 answer
141 views
Hi,
How can i set border width of tool tip?
I have set as shown in below code but not showing the width as specified.
<div style="z-index: 1;">
        <telerik:RadToolTip runat="server" ID="testTooltip" HideEvent="FromCode" Position="Center"
            Width="400px" Height="200px" Animation="None" ShowEvent="OnClick" ShowDelay="0"
            ManualClose="true" EnableViewState="true" TargetControlID="" RenderInPageRoot="true"
            RelativeTo="BrowserWindow" ShowCallout="False" Modal="true" BorderWidth="6spx"
            BorderColor="Gray" BorderStyle="Solid">
             
        </telerik:RadToolTip>
    </div>
I am using telerik version Q1 2012 (2012.1.215.35).
Princy
Top achievements
Rank 2
 answered on 26 Mar 2012
3 answers
355 views
<MasterTableView TableLayout="Auto" EditMode="PopUp" AlternatingItemStyle-BorderColor="Red">
     <Columns>
         <telerik:GridClientSelectColumn HeaderStyle-Width="36px">
             <HeaderStyle Width="36px" />
         </telerik:GridClientSelectColumn>
         <telerik:GridBoundColumn DataField="pkID" HeaderText="SerialNO" UniqueName="pkID">
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="Visit_IP" HeaderText="IP" UniqueName="Visit_IP">
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="DateTimes" HeaderText="DateTime" UniqueName="DateTimes">
         </telerik:GridBoundColumn>
         <telerik:GridTemplateColumn HeaderText="Edit" UniqueName="TemplateEditColumn">
             <ItemTemplate>
                 <asp:LinkButton runat="server" ID="LinkButtonEdit" Text="LinkButtonEdit" CommandName="LinkButtonEdit" CommandArgument='<%# Eval("pkID") %>' />
             </ItemTemplate>
         </telerik:GridTemplateColumn>
     </Columns>
</MasterTableView>
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = ((GridDataItem)(e.Item));
        LinkButton linkButton = dataItem.FindControl("LinkButtonEdit") as LinkButton;
        linkButton.ID = "LinkButtonEditID_" + dataItem.ItemIndex;
        linkButton.Text = "LinkButtonEditText_" + dataItem.ItemIndex;
        RadWindowIndexBuilder winbuider = new RadWindowIndexBuilder(this.RadWindowManager1, this.RadPaneWindow.ClientID, dataItem);
        linkButton.Click += winbuider.LinkButtonEdit_Click;
    }
}
//How to Get/Set Follow Value for 'pkID' From Rows of RadGrid ???????
public class RadWindowIndexBuilder
{
    RadWindowManager radWindowManager = null;
    string restrictionZoneID = null;
    int index = 0;
    string pkid = null;
    public RadWindowIndexBuilder(RadWindowManager RadWindowManager1, string RestrictionZoneID,
        GridDataItem Item)
    {
        radWindowManager = RadWindowManager1;
        restrictionZoneID = RestrictionZoneID;
        index = Item.ItemIndex;
        pkid = "???"; //How to Get/Set this Value From Rows of RadGrid ???
           //pkid = Item.GetDataKeyValue("pkID").ToString(); ???
           //pkid = Item.OwnerTableView.DataKeyValues[Item.ItemIndex][0].ToString(); ???
    }
    public void LinkButtonEdit_Click(object sender, EventArgs e)
    {
        radWindowManager.Windows.Clear();
        RadWindow rwin = new RadWindow();
        rwin.ID = "RadWindowLinkButtonEdit_" + index;
        rwin.Modal = false;
        rwin.Width = 640;
        rwin.Height = 480;
        rwin.Skin = "Office2007";
        rwin.NavigateUrl = "AdminContentBuilderInfo.aspx?id=" + pkid;
        rwin.Behaviors = WindowBehaviors.Close;
        rwin.InitialBehaviors = WindowBehaviors.Maximize | WindowBehaviors.None;
        rwin.RestrictionZoneID = restrictionZoneID;
        rwin.VisibleOnPageLoad = true;
        radWindowManager.Windows.Add(rwin);
    }
}
Princy
Top achievements
Rank 2
 answered on 26 Mar 2012
2 answers
158 views
Hi,

I am facing issue when i am using the property of RadDockZone control . whenever i am keeping Orientation property as Horizontal . when i am doing minimize then the RadDock width is auto generated . how to remove the auto generated width. all screenshots are attached please refer and provide some good solution.

Thanks,
Rajesh

Rajesh
Top achievements
Rank 1
 answered on 26 Mar 2012
1 answer
91 views

When I save the displayed chart image with the code below, the axis labels are missing from the image  (I saw on an earlier post this can happen if scroll mode is on).  I am not using scroll mode

Here is the code

 

Dim

 

ms1 As New System.IO.MemoryStream()

 

 

Me.chtGraph.Save(ms1, System.Drawing.Imaging.ImageFormat.Png)

 

 

Me.Page.Response.Clear()

 

 

Me.Page.Response.ClearHeaders()

 

 

Me.Page.Response.AddHeader("Content-disposition", "attachment; filename=graph.png")

 

 

Me.Page.Response.AddHeader("Content-type", "image/png")

 

 

Me.Page.Response.BinaryWrite(ms1.ToArray())

 

 

Me.Page.Response.[End]()

 

Petar Marchev
Telerik team
 answered on 26 Mar 2012
3 answers
1.1K+ views
I am building a Grid using the Q1 2010 RadGrid control, and
using Template Form Update as my guide.

I have a Template edit form, and I'm having an issue when
trying to add a Telerik Grid Dropdown Column.
I am getting an error saying that the Grid Dropdown
Column is not a known element.

Below is a copy of my edit form template:

<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
    AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False"
    ShowStatusBar="true" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True" DataSourceID="SqlDataSource1" OnItemDeleted="RadGrid1_ItemDeleted"
    OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand"
    >
 <MasterTableView CommandItemDisplay="TopAndBottom" DataSourceID="SqlDataSource1" DataKeyNames="MCCLoadId">
    <Columns>
        <telerik:GridEditCommandColumn>
        </telerik:GridEditCommandColumn>
        <telerik:GridBoundColumn UniqueName="MCCNo" HeaderText="MCCNo" DataField="MCCNo">
            <HeaderStyle ForeColor="Silver" ></HeaderStyle>
            <ItemStyle ForeColor="Gray" />               
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MCC_Cmpt" HeaderText="MCC Compartment" UniqueName="MCC_Cmpt">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DeviceType_DeviceTypeId" HeaderText="Device Type" UniqueName="DeviceTypeId" >
        </telerik:GridBoundColumn>
    </Columns>
    <EditFormSettings EditFormType="Template">
        <FormTemplate>
            <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
               style="border-collapse: collapse; background: white;">
               <tr class="EditFormHeader">
                   <td colspan="2" style="font-size:small">
                        <b>MCC Load Details</b>
                   </td>
               </tr>
               <tr>
                   <td>
                        <table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0" class="module">
                            <tr>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC #:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MCCNo") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Section:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("MCC_Sect") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Section Suffix:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("MCC_Sect_Suffix") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Compartment:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("MCC_Cmpt") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Compartment Suffix:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("MCC_Cmpt_Suffix") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Compartment Space Factor:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("MCC_Cmpt_Space_Factor") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Compartment Connection:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("MCC_Cmpt_Conn") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Short Circuit:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("MCC_Short_Ckt_Prot") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Short Circuit Rating:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("MCC_Short_Ckt_Rating") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Short Circuit Class:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("MCC_Short_Ckt_Class") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    MCC Control Device:
                                </td>
                                <td>
                                    <telerik:GridDropDownColumn DataField="DeviceType_DeviceTypeId" DataSourceID="SqlDataSource2"
                                        HeaderText="DeviceTypes" ListTextField="DeviceTypeName" ListValueField="DeviceTypeId"
                                        UniqueName="DeviceTypeId" ColumnEditorID="GridDropDownColumnEditor1">
                                    </telerik:GridDropDownColumn>
                                </td>
                            </tr>
                        </table>
                   </td>
               </tr>
        </FormTemplate>
    </EditFormSettings>
 </MasterTableView>
</telerik:RadGrid>


Thanks,
Jason

Shinu
Top achievements
Rank 2
 answered on 26 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?