Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
338 views
Hi Everyone,

I have a unique situation and I can't find any help on it.  I have a RadGrid that uses a User Web Control(.ascx) to insert and edit the grid items.  I need to used javascript to get the value of two RadTextBox on the User Web Control and sum them together and then update a third RadTextBox with the result value.

Here is my problem:
1) I have to create the javascript on the parent aspx page in order for the User Web Control to see it. If I create it on the .ascx page, it doesn't see it.
2) Since I have to create it on  the parent aspx page where the grid reside, I can't figure a way to access the RadTextBox value on the User Web Control.

Any help would be greatly appreciated.  Is there a way to run the javascript within the User Web Control?

Anthony
Eyup
Telerik team
 answered on 03 Mar 2017
1 answer
132 views

I have run into a problem when sorting a RadGrid. I am using the advanced databinding option in a grid creating in the markup. When I click on a grid header, the sort happens properly for that column, and the arrow indicator appears. If I then click on the indicator to do the opposite sort, the sorting indicator jumps to the next column to the right. This proceeds that way all across the grid.

I found this problem referenced in one older ticket from 2013, but that one simply indicated that the problem was resolved by using advanced databinding. I am already doing that, so what else am I missing?

 

My grid is defined as given here:

 

 <telerik:RadGrid ID="RecalledUPCDisplay" runat="server" Width="700px"  OnNeedDataSource="RadGrid1_NeedDataSource"
                OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"  OnHTMLExporting="RadGrid1_HtmlExporting" AllowSorting="True"
                 AutoGenerateColumns="False" Height="400px" Skin="Web20" ItemStyle-Height="18"
                        AlternatingItemStyle-Height="20">

                <ClientSettings EnablePostBackOnRowClick="true" >
                     <Scrolling AllowScroll="True" ScrollHeight="300px" UseStaticHeaders="True" />
                     <Selecting AllowRowSelect="True" />

                         
                </ClientSettings>
                
                <MasterTableView EnableViewState="False" HeaderStyle-HorizontalAlign="Center" Font-Names="Arial"  Font-Size="8" UseAllDataFields="true" DataKeyNames="UPC">
                <Columns>

                                     
                                   <telerik:GridBoundColumn DataField="UPC" HeaderText="UPC"
                                          UniqueName="UPC" SortExpression="UPC">
                                          <HeaderStyle HorizontalAlign="Center" Width="20" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                          
                                      </telerik:GridBoundColumn>

                                 <telerik:GridBoundColumn DataField="Description" HeaderText="Description"
                                          UniqueName="Description">
                                          <HeaderStyle HorizontalAlign="Center" Width="60" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                      </telerik:GridBoundColumn>

                                   <telerik:GridBoundColumn DataField="DateEntered" HeaderText="Date Entered"
                                          UniqueName="DateEntered">
                                          <HeaderStyle HorizontalAlign="Center" Width="15" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                      </telerik:GridBoundColumn>

                                 <telerik:GridBoundColumn DataField="Comment" HeaderText="Comment"
                                          UniqueName="Comment">
                                          <HeaderStyle HorizontalAlign="Center" Width="20" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                      </telerik:GridBoundColumn>


              </Columns>


              </MasterTableView>

                    <SortingSettings SortedBackColor="#FFF6D6" EnableSkinSortStyles="True"></SortingSettings>


                 <ExportSettings  IgnorePaging="False" OpenInNewWindow="True" ExportOnlyData="True">

                  <Csv ColumnDelimiter="VerticalBar" EncloseDataWithQuotes="False" />

            </ExportSettings>

    </telerik:RadGrid>

 

 

And the NeedDataSource call:

 

    Protected Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
        TryCast(sender, RadGrid).DataSource = BLLInterface.GetRecalledUPCs
    End Sub

 

 

 

Eyup
Telerik team
 answered on 03 Mar 2017
2 answers
610 views

Hello! I create radgrid data dynamically, and i don't even know how many columns it contains and column names are unknown.

The values are simple integers. The task is to calculate the summ of cells values of specific row. How can i iterate through columns

client-side javascript ?

Алексей Сергеевич
Top achievements
Rank 1
 answered on 03 Mar 2017
0 answers
77 views

Hi 

I have a scenario where in the EditItemCommand I will have a lookup button that will display a RadWindow with some records in another grid. User will click row which will close the window and the data from one of the columns on the selected row on this grid (grid on the window) will be shown in the parent page's grid template item control (text box for example).

How to achieve this?

 

 

Regards

 

SYA
Top achievements
Rank 1
 asked on 03 Mar 2017
0 answers
95 views

This is something that was driving me crazy.

I have a project that I updated to use the 2015.2.826.40 version. I noticed that when I was trying to clear the selection of the grid it was not working. The grid is set to allow selections and I have a function attached to a button that will clear the selection.Using the basic code (I tried a number of variations and even looping through the items and setting the selected property to false):

var grid = $find("<%=RadGrid1.ClientID %>");
grid.clearSelectedItems();

 

I spent a lot of time going through the code and trying to find out what the issue could be, nothing. I discovered that if I set the grid to allowMultiSelect='true' then it worked! The issue is I can't allow multi select.

I then tested my old project (backup) and everything worked correctly. I then replaced the control .dll files in my new (updated) project with version 2014.2.724.40 and the code is now working :/

Is this a bug or known issue with this version? Has anybody else seen this? I am sure this is fixed in later versions but I am locked into this version. Any suggestions?

Thanks,
Craig

Craig
Top achievements
Rank 1
 asked on 03 Mar 2017
3 answers
355 views
Hi,

Im getting this error, "Microsoft JScript runtime error: 'undefined' is null or not an object", when trying to open a rad window using the radopen function , it seems as if the radWindowManager cannot be found, because in the following function _1d is undefined after it has passed the second line, this function is created automatically.

window.radopen=

function(url,_1c){

 

var

 

_1d=GetRadWindowManager();

 

return

 

_1d.open(url,_1c);

 

};


i need to open the window after the code behind is executed, this is the code im using to open the window.

aspx page:

<

 

telerik:RadWindowManager ID="RadWindowManager1" runat="server"

 

 

Behavior="Default" InitialBehavior="None" Left="" style="display: none;" Top="">

 

 

<Windows>

 

 

 

<telerik:RadWindow ID="radwUploadFiles" runat="server"

 

 

NavigateUrl="~/Bursaries/UploadConfig.aspx" Title="Upload File(s)"

 

 

VisibleStatusbar="false" Width="840px" Height="620px" ReloadOnShow="true" Skin="Web20">

 

 

</telerik:RadWindow>

 

 

 

</Windows>

 

 

</telerik:RadWindowManager>

 

 

<script type="text/javascript">

 

 

function ShowUploader()

 

{

 

window.radopen(

null, "radwUploadFiles"); 

 

}


code behind(in the image button click event):

ImageButton

 

imgbtn = sender as ImageButton;

 

imgbtn.Attributes.Add(

"OnLoad", "ShowUploader();return false;");

 


any help would be appreciated, thanks.
Regards
Luis
Top achievements
Rank 1
 answered on 02 Mar 2017
3 answers
587 views
Hi there,

I'm considering adding a Save RadButton outside of the ImageEditor box which perform the same functionality as the Save tool in ImageEditor. Here's my code:

Public Sub SaveRB_Click(ByVal sender As Object, ByVal args As EventArgs) Handles SaveRB.Click
  
    Dim RadImageEditor1 As RadImageEditor = DirectCast(MiscUtils.FindControlRecursively(Me.Page, "RadImageEditor1"), RadImageEditor)
    RadImageEditor1.SaveImageOnServer("", true)
  
End

However, it seemed that the property "CanvasMode" was blocking this functionality. When I set CanvasMode="False", it worked; otherwise it didn't. Is there any workaround so that I can have both the Save RadButton and CanvasMode's tools? Thank you!

Best,

Long
Vessy
Telerik team
 answered on 02 Mar 2017
5 answers
501 views
I've had a hierarchical grid w/binds on server mode and a checkbox nested inside the GridTemplateColumn found on the third level. The problem is I can't get to work the functionality such that when user selects a checkbox then scrolls to next page it should retain the expanded state. Currently, I have tried your sample code found on http://www.telerik.com/forums/how-to-maintain-expanded-rows-of-detailtable-after-postback but the problem is for every row selected on a particular page, it also expands the row from detail table on the other pages.

Appreciate your immediate response and help on the matter.


Below is the aspx code

<td>
<Telerik:RadScriptManager runat="server" ID="RadScriptManager1">
</Telerik:RadScriptManager>
<Telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<Telerik:RadGrid ID="RadGridPatientData" runat="server" AllowMultiRowSelection="true"
CellSpacing="0" Width="945" Height="325" PagerStyle-AlwaysVisible="true" Visible="false"
AllowPaging="True" OnDetailTableDataBind="RadGridPatientData_DetailTableDataBind"
OnNeedDataSource="RadGridPatientData_NeedDataSource" OnItemDataBound="RadGridPatientData_ItemDataBound"
OnItemCreated="RadGridPatientData_ItemCreated" OnPageIndexChanged="RadGridPatientData_PageIndexChanged"
AutoGenerateColumns="true" HeaderStyle-HorizontalAlign="Left">
<PagerStyle Mode="NextPrev" PagerTextFormat="{4} Page {0} of {1}, items {2} to {3} of {5}">
</PagerStyle>
<MasterTableView DataMember="Patient" Width="100%" ClientDataKeyNames="CheckSumId"
DataKeyNames="CheckSumId" AllowMultiColumnSorting="True" AutoGenerateColumns="true"
EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="false">
<DetailTables>
<Telerik:GridTableView DataMember="Admission" ClientDataKeyNames="AdmissionId" DataKeyNames="AdmissionId"
Width="100%" AllowPaging="false">
<DetailTables>
<Telerik:GridTableView DataMember="Document" ClientDataKeyNames="Id" DataKeyNames="Id"
Width="99%" AllowPaging="false">
<Columns>
<Telerik:GridTemplateColumn HeaderText="">
<ItemTemplate>
<asp:CheckBox ID="chkSelectDoc" runat="server" AutoPostBack="true" OnCheckedChanged="chkSelectDoc_CheckChanged" />
</ItemTemplate>
</Telerik:GridTemplateColumn>
</Columns>
</Telerik:GridTableView>
</DetailTables>
</Telerik:GridTableView>
</DetailTables>
<NoRecordsTemplate>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<br />
<p style="color: Black">
No document(s) found...</p>
</td>
</tr>
</table>
</NoRecordsTemplate>
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="true" ScrollHeight="400px" UseStaticHeaders="true" />
<Selecting AllowRowSelect="true" />
<ClientEvents OnCommand="function(){}" />
</ClientSettings>
</Telerik:RadGrid>
</Telerik:RadAjaxPanel>
</td>
Pavlina
Telerik team
 answered on 02 Mar 2017
1 answer
206 views

I am trying to bind to the Content Template of a RadPanelBar with and object (see below).  I am able to get the Panel Labels to display but the panel items are not expandable and they don't show the Rad Text Box inside the content. 

 

 

 <telerik:RadPanelBar  RenderMode="Lightweight" ID="RadPanelBar1" Runat="server"  Width="75%">
            <Items>
                <telerik:RadPanelItem runat="server">
                    <ContentTemplate>
                         <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DetailMessage") %>'></telerik:RadTextBox>
                    
                    </ContentTemplate>
                </telerik:RadPanelItem>
            </Items>
            </telerik:RadPanelBar>

        public class DetailInfo
        {
            public string DetailMessage { get; set; }
        }
        public class PanelInfo
        {
            public int PanelId { get; set; }
            public string PanelLabel { get; set; }
            public DetailInfo Details { get; set; }
            public string DetailMessage {get; set; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            List<PanelInfo> PanelLabels = Enumerable.Range(1, 10).Select(m =>
                 new PanelInfo
                 {
                     PanelLabel = String.Format("Panel {0}", m),
                     PanelId = m,
                     Details = new DetailInfo { DetailMessage = string.Format("Detail {0}", m) },
                     DetailMessage = String.Format("Message {0}", m),
                 }
               ).ToList();

            RadPanelBar1.DataSource = PanelLabels;
            RadPanelBar1.DataTextField = "PanelLabel";
            RadPanelBar1.DataValueField = "PanelId";
            RadPanelBar1.DataBind();
          
        }

Peter Milchev
Telerik team
 answered on 02 Mar 2017
1 answer
133 views

Hi there,

I would like to change a couple of things regarding styling to the RadSiteMap (see attachment)

1. Remove horizontal line
I want to remove the horizontal lines, like beneath the 'Auxiliary equipment' text and 'Drivetrain' text.

2. Remove indent level
Is there a way to remove the indents before a level (like before the bullets)?

3. Add empty line last level
I want to create extra space between the 2 levels (like extra space between 'Weigh scale hand pallet trucks' and 'Drivetrain')

I hope somebody is able to assist.

Regards,

Marcel

Rumen
Telerik team
 answered on 01 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?