Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
236 views
I have a basic menu created successfully, but would like to have a template applied to a couple dynamically created items.

I would like to have a User Control be the contents so that the management of the content can be controlled separately.

So my basic scenario is this:

Create Root Menu item, Create Sub item, Apply ItemTemplate, Create New Sub Item, Undo Template...

My Template is such:


'ItemTemplate Class. Just pulls the User Control
Class QC_HACCP_Hold
        Implements ITemplate
        Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
            Dim lit1 As New QC_HACCP_Hold_Lot
            container.Controls.Add(lit1)
        End Sub
    End Class
 
 
'User Control write up - QC_HACCP_Hold_Lot
 
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="QC_HACCP_Hold_Lot.ascx.vb" Inherits="sadlersnet.QC_HACCP_Hold_Lot" %>
<asp:panel id="pnlHold" runat="server">
    <p>
        Enter Lot Number to Place on Hold<br />
        <asp:TextBox ID="txtLotNumber" runat="server"></asp:TextBox><asp:Button ID="cmdHoldLot" runat="server" Text="Set to Hold" />
    </p>
</asp:panel>
 
'Code to Create Parent and Sub with Template Applied
        Dim _QCHACCP_Place_Lot_On_Hold As RadMenuItem = AddMenuItem("Place Lot on Hold", Nothing, False)
        With _QCHACCP_Place_Lot_On_Hold
            Dim _QC_HoldTemplate As New Custom_Rad_Templates.QC_HACCP_Hold
            mnuMain.ItemTemplate = _QC_HoldTemplate
            .Items.Add(New RadMenuItem)
   
        End With
 
'Helper function for creating menuitems
Private Function AddMenuItem(ByVal Caption As String, URL As String, ByVal AutoPostBack As Boolean, Optional ByVal Target As String = Nothing) As RadMenuItem
        Dim _MenuItem As RadMenuItem = New RadMenuItem
        _MenuItem.PostBack = AutoPostBack
        _MenuItem.NavigateUrl = URL
        _MenuItem.Text = Caption
        If Not IsNothing(Target) Then _MenuItem.Target = Target
        Return _MenuItem
    End Function

Im getting the Parent and it knows theres a sub, and expanding just gives me a little tiny box with no content...

Any Ideas?
Dimitar Terziev
Telerik team
 answered on 18 Sep 2014
2 answers
201 views
Hi there!  I'm trying to slightly change the appearance of the tabs of a radsplitter with sliding panes.  I'm currently using the WebBlue skin, but would like to add distinct borders to the tabs and a different color to the expanded tab.  I've added the following css code to my page, but nothing changes.

I must be missing something.  Any help appreciated.  Thanks!
​.
RadSplitter .paneTabContainer
 {
 border-color: #424242 !important;
 border-width: thin !important;
 
 }
 
 .RadSplitter .paneTabContainerDocked,
 .RadSplitter .paneTabContainerDockedHorizontal
 {
 background: #FAAC58 !important;
 }
 
 .RadSplitter .tabsContainer .paneTabContainerExpanded,
 .RadSplitter .tabsContainer .paneTabContainerExpandedHorizontal
 {
 background: #FAAC58 !important;
 }
Dusty
Top achievements
Rank 1
 answered on 18 Sep 2014
5 answers
337 views
I have the following RadAjaxManager defined in my page. The problem is once a user enters some text in the RadModalPopup, I want the RadGrid to refresh when the modalpopup closes. It currently is not, any ideas as to why not?

           function closeRadWindow() {
 
               $find("<%= RadAjaxManager.ClientID %>").ajaxRequest();
 
           }
 
 
 
       </script>  
 
   </TELERIK:RADCODEBLOCK>
 
   <telerik:RadWindowManager ID="RadWindowManager" runat="server">
 
        <Windows>
 
            <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Title="Add New Description to Table" Width="400px" Height="150" Behaviors="Close, Move" OnClientClose="closeRadWindow">
 
                <ContentTemplate>
 
                   <asp:Label ID="Description" runat="server" Text="New Description: "></asp:Label>
 
                   <asp:TextBox ID="NewDescriptionTextBox" runat="server" Width="300px"></asp:TextBox>
 
                    <asp:Button ID="AddNewDescriptionButton" runat="server" Text="Add" OnClick="AddNewDescriptionButton_Click" /><br /><br />
 
                    <asp:Button ID="CancelAddDescriptionButton" runat="server" Text="Cancel" />
 
                    <asp:Label ID="messageLabel" runat="server" Text="Label" Visible="false"></asp:Label>
 
                </ContentTemplate>
 
            </telerik:RadWindow>
 
        </Windows>
 
    </telerik:RadWindowManager>
 
 
 
       <telerik:RadAjaxManager runat="server" ID="RadAjaxManager" DefaultLoadingPanelID="RadAjaxLoadingPanel" OnAjaxRequest="RadAjaxManager_AjaxRequest">
 
           <AjaxSettings>
 
               <telerik:AjaxSetting AjaxControlID="AdminHoldReasonGrid">
 
                   <UpdatedControls>
 
                       <telerik:AjaxUpdatedControl ControlID="AdminHoldReasonGrid" />
 
                   </UpdatedControls>
 
               </telerik:AjaxSetting>
 
 
 
               <telerik:AjaxSetting AjaxControlID="RadAjaxManager">
 
                   <UpdatedControls>
 
                       <telerik:AjaxUpdatedControl ControlID="AdminHoldReasonGrid" />
 
                   </UpdatedControls>
 
               </telerik:AjaxSetting>
 
           </AjaxSettings>
 
       </telerik:RadAjaxManager>
 
 
 
 
 
 
 
THIS IS THE RELEVANT CODE BEHIND
 
 
       protected void RadAjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
 
       {
 
           AdminHoldReasonGrid.MasterTableView.SortExpressions.Clear();
 
           AdminHoldReasonGrid.Rebind();
 
       }
Sasha
Top achievements
Rank 1
 answered on 18 Sep 2014
10 answers
466 views

I have a problem with 2 of my controls "disappearing" when I use the RadAjaxManager to update them when I click a button.

Here is my button:
<asp:Button runat="server" id="btnClick" OnClick="btnClick_Click" />

Here is the btnClick_Click in my C# file:

        protected void btnClick_Click(object sender, EventArgs e)
        {
            SqlConnection myConn3 = new SqlConnection("Dataconnection");
            myConn3.Open();
           
            string getCategoryQueryString;
            getCategoryQueryString = "SELECT MasterTableCategories.MasterID, MasterTableCategories.SICCode, [Sic-Codes].[SIC Name1] AS Category FROM MasterTableCategories INNER JOIN [Sic-Codes] ON MasterTableCategories.SICCode = [Sic-Codes].[SIC Code1] WHERE (MasterTableCategories.MasterID = @MasterID)";

            SqlCommand getCategoryQuery = new SqlCommand(getCategoryQueryString, myConn3);
            getCategoryQuery.Parameters.Add("@MasterID", Master_RecordID.Value);
            SqlDataReader getCategoryReader = getCategoryQuery.ExecuteReader();

            if (getCategoryReader.HasRows)
            {
                getCategoryReader.Read();
                Category.Text = getCategoryReader["Category"].ToString();
                SICCode.Value = getCategoryReader["SICCode"].ToString();
            }
            else
            {
                //For testing purposes
                Category.Text = "Cars";
                SICCode.Value = "123456789";
            }
            getCategoryReader.Dispose();
            myConn3.Close();
        }

Here is the Ajax:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel_CampaignChange">
      <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="btnClick">
          <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="Category" />
            <telerik:AjaxUpdatedControl ControlID="SICCode" />
         </UpdatedControls>
        </telerik:AjaxSetting>
      </AjaxSettings>
    </telerik:RadAjaxManager>

Here are the controls:
<asp:TextBox ID="Category" runat="server" Width="100%" ReadOnly="true"></asp:TextBox>
<asp:HiddenField ID="SICCode" runat="server" Value="" />

The user presses the button and the btnClick_Click goes to the database and retrieves the Category and SIC Code.  It's then supposed to update the controls with string data, but makes the ENTIRE textbox and hidden field disappear from the html.  All I am left with is an empty div...sort of.  It even removes the CategoryPanel div and SICCodePanel div from the html.

If anyone has a clue why these controls vanish, I would appreciate it immensely!

Maria Ilieva
Telerik team
 answered on 18 Sep 2014
4 answers
273 views
a few peers finally convinced me to dump cuteeditor and buy telerik radeditor, to be honest it's caused me nothing but problems since it's inclusion into our app.

now, every time I load any page it is on with chrome I get the "aw snap" error something went wrong.

app is an asp.net 4.5 app with an ajax update panel on the page.

please advise

-Pat
Patrick
Top achievements
Rank 1
 answered on 18 Sep 2014
2 answers
115 views
I have many sql tables that are all structured in the same identical way (headers and type).
I would like to use one radgrid to work on all these tables (insert, update, delete) selecting the table from a drop down list.
The code here below works only partially, I can select a different table from the drop down list and it is immediately loaded but I cannot perform insert delete update and also sorting and filtering are not working.
What should I do to get all the above working? Is there a demo for such situation?
Moreover, I have added manually the "Edit" and "Delete" columns because I like to have the image buttons for these operations but in this context they both appear on the left side of the grid. I understand the reasons but I would like to get them on the sides (left and right) of the columns.


<div>
          <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged1">
 
              <asp:ListItem Value="Table_321">Table_321</asp:ListItem>
              <asp:ListItem Value="Table_621">Table_621</asp:ListItem>
          </asp:DropDownList>
          <br />
          <br />
          <br />
          <telerik:RadGrid ID="RadGrid1" runat="server" Culture="it-IT" OnNeedDataSource="RadGrid1_NeedDataSource" AllowPaging="True" AllowSorting="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
              <ExportSettings ExportOnlyData="True">
                  <Pdf PageWidth="">
                  </Pdf>
              </ExportSettings>
              <ClientSettings>
                  <Scrolling AllowScroll="True" UseStaticHeaders="True" />
              </ClientSettings>
              <MasterTableView CommandItemDisplay="Top">
                  <CommandItemSettings ShowExportToExcelButton="True" />
                  <Columns>
                      <telerik:GridEditCommandColumn ButtonType="ImageButton">
                          <HeaderStyle Width="30px" />
                      </telerik:GridEditCommandColumn>
                      <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="Cancel">
                          <HeaderStyle Width="30px" />
                      </telerik:GridButtonColumn>
                  </Columns>
 
                  <EditFormSettings>
                      <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                  </EditFormSettings>
                  <PagerStyle AlwaysVisible="True" />
              </MasterTableView>
              <PagerStyle AlwaysVisible="True" />
          </telerik:RadGrid>
          <br />
          <br />
 
      </div>
 
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BOMConnectionString %>">
          <DeleteParameters>
              <asp:Parameter Name="Id" Type="Int32" />
          </DeleteParameters>
          <InsertParameters>
              <asp:Parameter Name="Code" Type="Double" />
              <asp:Parameter Name="Description" Type="String" />
              <asp:Parameter Name="Bkgroup" Type="Double" />
              <asp:Parameter Name="Stgroup" Type="Double" />
              <asp:Parameter Name="Quantity" Type="Double" />
              <asp:Parameter Name="BomNote" Type="String" />
              <asp:Parameter Name="UnitEng" Type="String" />
              <asp:Parameter Name="AlternCost" Type="Double" />
          </InsertParameters>
          <UpdateParameters>
              <asp:Parameter Name="Code" Type="Double" />
              <asp:Parameter Name="Description" Type="String" />
              <asp:Parameter Name="Bkgroup" Type="Double" />
              <asp:Parameter Name="Stgroup" Type="Double" />
              <asp:Parameter Name="Quantity" Type="Double" />
              <asp:Parameter Name="BomNote" Type="String" />
              <asp:Parameter Name="UnitEng" Type="String" />
              <asp:Parameter Name="AlternCost" Type="Double" />
              <asp:Parameter Name="Id" Type="Int32" />
          </UpdateParameters>
      </asp:SqlDataSource>
  
and this is the code behind:
protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex > -1)
        {
            RadGrid1.DataSource=null;
            RadGrid1.Rebind();
        }
    }
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        string tableInUse = DropDownList1.SelectedItem.Text;
        RadGrid1.DataSource = SqlDataSource1;
        SqlDataSource1.DeleteCommand = "DELETE FROM [" + tableInUse + "] WHERE [Id] = @Id";
        SqlDataSource1.InsertCommand = "INSERT INTO [" + tableInUse + "] ([Code], [Description], [Bkgroup], [Stgroup], [Quantity], [BomNote], [UnitEng], [AlternCost]) VALUES (@Code, @Description, @Bkgroup, @Stgroup, @Quantity, @BomNote, @UnitEng, @AlternCost)";
        SqlDataSource1.SelectCommand = "SELECT * FROM [" + tableInUse + "] ORDER BY [Code]";
        SqlDataSource1.UpdateCommand = "UPDATE [" + tableInUse + "] SET [Code] = @Code, [Description] = @Description, [Bkgroup] = @Bkgroup, [Stgroup] = @Stgroup, [Quantity] = @Quantity, [BomNote] = @BomNote, [UnitEng] = @UnitEng, [AlternCost] = @AlternCost WHERE [Id] = @Id";
    }

Thank you for supporting,
Felice
Felice
Top achievements
Rank 1
 answered on 18 Sep 2014
4 answers
132 views
Hi,

I am looking at the demo TabStrip - Dynamic PageView Creation via AJAX and I'm trying to implement something similar.
The problem with the demo is that the RadGrid on the second tab is not sending postbacks (cannot enter edit mode, cannot change pages, etc). And this also happens in my implementation. I tried to add an AjaxManagerProxy in the user control but with no luck.
As I said this bug seems to reproduce in the online demo, with Google Chrome and IE 10.
Do you have any idea why this happens and how can I fix it?

Thank you.
Nencho
Telerik team
 answered on 18 Sep 2014
0 answers
88 views
Hi, i need to bind a grid like attached image, any idea??
Velkumar
Top achievements
Rank 1
 asked on 18 Sep 2014
1 answer
146 views
Hello!

I have an issue with the grid layout when there are frozen columns and the grid width allows to show all columns without horizontal scrollbar.

The test page is very simple:

<div style="width: 50%;height: 200px">
    <telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" Height="100%" AutoGenerateColumns="False" OnNeedDataSource="OnGridNeedDataSource">
        <MasterTableView Width="100%" CommandItemDisplay="None">
            <Columns>
                <telerik:GridBoundColumn HeaderText="Column 1" UniqueName="Column1" DataField="Column1" HeaderStyle-Width="100" />
                <telerik:GridBoundColumn HeaderText="Column 2" UniqueName="Column2" DataField="Column2" HeaderStyle-Width="100" />
                <telerik:GridBoundColumn HeaderText="Column 3" UniqueName="Column3" DataField="Column3" HeaderStyle-Width="100" />
                <telerik:GridBoundColumn HeaderText="Column 4" UniqueName="Column4" DataField="Column4" HeaderStyle-Width="100" />
                <telerik:GridBoundColumn HeaderText="Column 5" UniqueName="Column5" DataField="Column5" HeaderStyle-Width="100" />
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" FrozenColumnsCount="2" />
        </ClientSettings>
        </telerik:RadGrid>
</div>

When the browser width is small and the horizontal scrollbar is shown, everything looks fine. But when I enlarge the browser window, the scrollbar disappears, but some space at the bottom still seems to be "reserved" for it.

Well, in the OnGridCreated event handler I could set the size of the scroll area

<script>
    function ResizeGrid(gridID)
    {
        var scrollArea = $get(gridID + "_GridData");
        scrollArea.style.height = (157 + 17) + "px";
    }
 
    function OnGridCreated(sender, ev)
    {
        ResizeGrid(sender.ClientID);
    }
</script>

but this does not work for me because (1) how should I get know whether the horizontal scrollbar is shown, and (2) more important, I need the grid be resized dynamically.

The following code does not work:

<telerik:RadScriptBlock runat="server">
    <script>
        window.onresize = function () { setTimeout(function() { ResizeGrid("<%=RadGrid1.ClientID%>"); }, 200) }
 
        function ResizeGrid(gridID)
        {
            var scrollArea = $get(gridID + "_GridData");
            scrollArea.style.height = (157 + 17) + "px";
            $find(gridID).repaint();
        }
    </script>
</telerik:RadScriptBlock>

This issue occurs only when FrozenColumnsCount is set to non-zero. The UseStaticHeaders parameter does not matter.

So, could you please guide me how to get rid of this layout issue for the grid with frozen columns?

Thank you!
Maria Ilieva
Telerik team
 answered on 18 Sep 2014
7 answers
190 views
Hello Support Team,

I am using rad async upload control in my project.

I have kept filtration for the images. If i am trying to browse file that filter is not working at first time.

Attached snap and zip file for the code.


 <script type="text/javascript">
        function validationFailed(radAsyncUpload, args) {
            var erorMessage = getErrorMessage(radAsyncUpload, args);
            if (erorMessage == false) {
                alert("The file must have the extension gif,jpeg,jpg,png");
                return false;
            }
            return true;
        }

        function uploadFile(radUpload, arguments) {
            $('#<%=btnUploadImage.ClientID %>').click();
        }
    </script>
    <div>
        <div id="divUploadControl" style="float: left; width: 100%;">
            <telerik:RadAsyncUpload runat="server" ID="radUploadImage" EnableFileInputSkinning="true"
                MultipleFileSelection="Disabled" MaxFileInputsCount="1" OnClientFileUploaded="uploadFile"
                PostbackTriggers="btnUploadImage" Width="250" Localization-Select="Browse" OnClientValidationFailed="validationFailed"
                EnableInlineProgress="false" TabIndex="3" AllowedFileExtensions="gif,jpeg,jpg,png">
                <FileFilters>
                    <telerik:FileFilter Description="Allowed files are gif,jpeg,jpg,png" Extensions="gif,jpeg,jpg,png" />
                </FileFilters>
            </telerik:RadAsyncUpload>
            <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
            <telerik:RadProgressArea ID="RadProgressArea1" Width="240px" runat="server" BackColor="Black"
                Skin="WebBlue" ToolTip="Uploading">
            </telerik:RadProgressArea>
        </div>
        <input type="button" id="btnUploadImage" runat="server" style="width: 0px; font-size: 0px;
            height: 0px;" value="" onserverclick="btnUploadImage_Click" />
    </div>




Peter Filipov
Telerik team
 answered on 18 Sep 2014
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?