Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
843 views
Hi,
I have just updated from RadControls Classic. By and large the upgrade went smoothly but I am finding that a lot of my client side script is breaking.

Previously I could do something like this (just an example to demonstrate the point):
Page.ClientScript.RegisterStartupScript(GetType(),"key"
    myRadComboBox.ClientID + ".somefunction();"true); 

From the documentation it looks like this code should be rewritten like this:
Page.ClientScript.RegisterStartupScript(GetType(), "key"
    "$find(\"" + myRadComboBox.ClientID + "\").somefunction();"true); 

However, when I try this, the $find method returns null.

I notice that these scripts are being rendered above the Sys.Application.add_init calls for the control which could be part of the problem but I don't know how to solve this elegantly.


Kate
Telerik team
 answered on 17 Apr 2013
8 answers
241 views
Hi,

I have a radwindow with some .net controls. When i tab from the radwindow, it goes thru all the controls in the radwindow and then it reaches the url field of the browser of the parent page.

How can i restrict the access moving to the parent page from radwindow.
Any help will be much appreciated.

Thanks

Kiresh
Top achievements
Rank 1
 answered on 17 Apr 2013
1 answer
547 views
Trying to get the radgrid onclientclick to work, this way works but have sinceed changed to put variable into it but since then not working but it follows from telerik web site.  I would liek to chane to pass in varable that then pulls things into popup if variable is greater than 0.

This works.
<CommandItemTemplate>
                                <asp:LinkButton ID="lnkAdd" runat="server" Text="ADD ADMIN" OnClientClick="addAdminWin(); return false;"></asp:LinkButton>
                            </CommandItemTemplate>


This does not
<telerik:GridTemplateColumn>
        <ItemTemplate>
                <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" OnClientClick='<%# String.Format("addAdminWin({0}); return false;", Eval("intAdminId"))%>'></asp:LinkButton>
           </ItemTemplate>
</telerik:GridTemplateColumn>


here is the fucntion with and without the variable.
<script type="text/javascript">
 
       function addAdminWin(adminid) {
           var addAdmin = $find("<%= AddAdmin.ClientID %>");
           var HFId = $find("<%= HFId.ClientID %>");
           HFId.val = adminid
           addAdmin.show();
       }
   </script>


This works along with one that passes no variable.
<script type="text/javascript">
 
       function addAdminWin() {
           var addAdmin = $find("<%= AddAdmin.ClientID %>");
           addAdmin.show();
       }
   </script>




Shinu
Top achievements
Rank 2
 answered on 17 Apr 2013
1 answer
752 views
Edit: I found that I was calling databind from the method I called from the NeedDataSource handler in some cases, including this one.  I would delete the post if I could.


Greetings, I'm having an issue where I get the error:

You should not call DataBind in NeedDataSource event handler. DataBind would take place automatically right after NeedDataSource handler finishes execution.

And I get this error when I expand a details view on a row in my Grid.  This is the Detail Table Data Bind handler:


protected void grdSearchResults_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = e.DetailTableView.ParentItem;
 
            int itemID = int.Parse(dataItem.GetDataKeyValue("Item_ID").ToString());
            IMyService dbItems = ServiceFactory.Create<MyService>();
            e.DetailTableView.DataSource = dbItems.GetItemsByID(itemID);
 
            uppnlSearchCriteria.Update();
        }

Note that the update panel is not where the grid is, but it is where the error
 label is, which is showing me that aforementioned error.

Based on the documentation and examples I've been looking at today, I'm doing 
things right by setting the datasource and NOT actually binding, but the Grid 
seems to think I'm calling databind.

Is there something I'm missing here or somewhere in the code I should look 
to see how this is happening?

Thanks,

Alex
Shinu
Top achievements
Rank 2
 answered on 17 Apr 2013
1 answer
185 views
I have followed :

partially. And it seemed to be working as expected but on thing, I just wanted one row to be selected at a time.

aspx

GridView

<telerik:RadGrid ID="gv" runat="server" AllowSorting="true" AllowFilteringByColumn="true"
       OnItemCommand="ItemCommand" OnItemDataBound="ItemDataBound"
       AllowAutomaticUpdates="true" AllowMultiRowSelection="false" OnInsertCommand="InsertCommand"
       AllowAutomaticInserts="true" OnUpdateCommand="ItemUpdated" ActiveItemStyle-CssClass="gv_ActiveItem"
       OnNeedDataSource="NeedDataSource">


CheckBox Item Template

<telerik:GridTemplateColumn UniqueName="_SelectCommandColumn" AllowFiltering="false"
                    HeaderText="Select" HeaderAbbr="Check">
                    <ItemTemplate>
                        <asp:CheckBox ID="cbSelectCategory" runat="server" OnCheckedChanged="cbSelectCategory_CheckedChanged"
                            AutoPostBack="true" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

.cs

protected void cbSelectCategory_CheckedChanged(object sender, EventArgs e)
        {
            ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;
            //getting the id of the selected check-box
        }

the code works well and the style also gets applied to the row containing the checkbox selected. but the only problem is, the checkbox of the row previously selected, remains checked, I need to uncheck it anyway

Princy
Top achievements
Rank 2
 answered on 17 Apr 2013
9 answers
320 views
Hi, my RadAutoCompleteBox is like this:

<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" Skin="WebBlue" DropDownWidth="150" CssClass="SalesOrderSearch" DataTextField="strSalesOrderNumber" TextSettings-SelectionMode="Single" Filter="Contains" InputType="Text">
 <DropDownItemTemplate>
.
.
.
</DropDownItemTemplate>
</telerik:RadAutoCompleteBox>

I need to detect the event of when user select an item (click from the dropdownlist or "Enter" key press after typing valid entry). However, it doesnt seem easy when InputType is not "Token". The closest I got was to use the OnClientDropDownClosed event (and then validate the text entered) but that's pretty annoying and not really a "user selection". Any clue?

TIA

Martin
Brandon
Top achievements
Rank 1
 answered on 16 Apr 2013
1 answer
132 views



Objective :
Have all RadGrids in a project default to UseStaticHeaders='True' while allowing certain RadGrids to individually override that ClientSettings Scrolling property to false ( UseStaticHeaders='False')


What's Actually Happening (the problem) :
Setting UseStaticHeaders='False' at the RadGrid level is not overriding the default 'True' setting.  When we set up an individual RadGrid with UseStaticHeaders='False' the setting doesn't stick & the page containing the control still renders with UseStaticHeaders='True'



The Setup:
The Default.skin file looks like this : 
<telerik:RadGrid runat="server" >
    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
    <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
    <AlternatingItemStyle HorizontalAlign="Left" VerticalAlign="Top"></AlternatingItemStyle>
    <ClientSettings EnableRowHoverStyle="True">
        <Scrolling AllowScroll="True" SaveScrollPosition="true" UseStaticHeaders="true" />
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>




The individual RadGrid configuration looks like this : 
<ClientSettings AllowKeyboardNavigation="True" EnablePostBackOnRowClick="True" ActiveRowIndex="0">
        <Scrolling ScrollHeight="500px" AllowScroll="True" SaveScrollPosition="True" UseStaticHeaders="False" />
        <KeyboardNavigationSettings EnableKeyboardShortcuts="True" AllowSubmitOnEnter="True"
            AllowActiveRowCycle="True" CollapseDetailTableKey="LeftArrow" ExpandDetailTableKey="RightArrow" />
</ClientSettings>




Are we misunderstanding how this should work? Is UseStaticHeaders configurable on a grid-by-grid basis? If so, how?
GreenLizzard
Top achievements
Rank 1
 answered on 16 Apr 2013
1 answer
97 views
Hi,
i wrote this code radmanu:

<telerik:RadMenu ID="RadMenu1" Runat="server" EnableRoundedCorners="True"
  OnItemClick="RadMenu1_ItemClick"
  EnableShadows="True" Skin="Office2010Silver"
  style="top: 0px; left: 0px" Height="30px" Width="940px">                                                      
     <Items>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana" Font-Size="Small"
         Text="Immagine profilo" Owner="RadMenu1">
     <Items>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana"
         ImageUrl="~/Image/Icone/kuser.png" Owner="" Text="Nuova immagine">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana"
         ImageUrl="~/Image/Icone/delete.png" Owner="" Text="Elimina immagine">
         </telerik:RadMenuItem>
     </Items>
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" IsSeparator="True"
             Text="Root RadMenuItem13" Owner="RadMenu1">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana" Font-Size="Small"
         Text="Sfondo biglietto">
             <Items>
                 <telerik:RadMenuItem runat="server" Font-Names="Verdana"
                     ImageUrl="~/Image/Icone/lphoto.png" Owner="" Text="Nuovo sfondo" Value="3"
                     Width="180px">
                 </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" Font-Names="Verdana"
                     ImageUrl="~/Image/Icone/delete.png" Owner="" Text="Elimina sfondo" Value="4"
                     Width="180px">
                 </telerik:RadMenuItem>
             </Items>
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" IsSeparator="True" Owner="RadMenu1"
         Text="Root RadMenuItem4">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana"
         Font-Size="Small" Text="I miei preferiti" Enabled="False">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" IsSeparator="True"
         Text="Root RadMenuItem13">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana" Font-Size="Small"
         Text="Invita un amico" Owner="RadMenu1">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" IsSeparator="True" Text="Root RadMenuItem6"
         Owner="RadMenu1">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana" Font-Size="Small"
         Text="Modifica password" Owner="RadMenu1">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" IsSeparator="True"
         Text="Root RadMenuItem8">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana" Font-Size="Small"
         Text="Elimina account">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" IsSeparator="True" Owner="RadMenu1"
             Text="Root RadMenuItem10">
         </telerik:RadMenuItem>
         <telerik:RadMenuItem runat="server" Font-Names="Verdana" Font-Size="Small"
             Owner="RadMenu1" Text="Esci da Trycontact">
         </telerik:RadMenuItem>
     </Items>
     <ExpandAnimation Type="OutBack" />
 </telerik:RadMenu>

and this radmenu is located in a Div with css and this code:

.divmenuprofile
{
   width:964px;
   height: 35px;
   text-align:center;
   padding-left:23px;
   padding-top:8px;
   border: 1px solid #D5842B;
   background: #cccccc; /* opera */
   background: -webkit-gradient(linear, top, bottom, from(#cccccc), to(#ffffff)); /* chrome e safari4+ */
   background: -webkit-linear-gradient(top, #cccccc, #ffffff); /* Chrome 10+ e safari6 */
   background: -moz-linear-gradient(top#cccccc#ffffff); /* firefox 3.6+ */
   background: linear-gradient(top, #cccccc, #ffffff);
   filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0,startColorstr='#cccccc', endColorstr='#ffffff'); /*  IE 5.5-7*/
   -ms-filter: 'progid:DXImageTransform.Microsoft.gradient(GradientType = 0,startColorstr='#cccccc', endColorstr='#ffffff')'; /*  IE 8*/
   border-radius: 8px;
   -moz-border-radius: 8px;
   -khtml-border-radius: 8px;
   -webkit-border-radius: 8px;
   behavior: url(/App_Themes/TryCss/PIE.htc);
}

i posted two image. One there's radmenu with google chrome and good view and another with IE9 and the style is differente no good, why and and how can I solve the problem?


MasterChiefMasterChef
Top achievements
Rank 2
 answered on 16 Apr 2013
1 answer
97 views
I just upgraded to 2013.1.403.40, and i have what seems like a bug.  In many places i use a radgrid and create a hidden databoundcolumn like this:

<telerik:GridBoundColumn UniqueName="UpdateProfileActionID"     DataField="UpdateProfileActionID"   Visible="false"/>

And i've always been able in my code-behind to access this value.  This allows me to pass around hidden ID fields usually that can be passed into an edit or delete command without having to make the column visible to the user.  After the 2013.1.403.40 upgrade these values in my code-behind are blank well, "&nbsp;". 

1. is this intended behavior
2. is there a way to make this work like it did before?

I've confirmed that my code behind values are fine when i remove the Visible="false" flag.  So if the column is visible then i can access it in the code-behind.  I the column isn't visible then the value is &nbsp;.

I've now already found two places where this has caused me a problem since upgrading and i'm scared how many other places i'm probably doing this that i haven't found yet.

Thanks!
-Mark
Mark Kucera
Top achievements
Rank 1
 answered on 16 Apr 2013
0 answers
100 views
Hi,

I am using telerik radGrid for binding the data. I am using telerik:GridDropDownColumn so that in edit template I can update few columns.
I have two dropdowns displaying weeks("ddlWeeks" & ddlTotalWeeks) (text format: 1- 10/11/2013,2-10/12/2013...., values are: 1,2..). Second one is a text box which can be filled by user. Now when any date selected from dropdown "ddlWeeks", I am getting its values say "2" and adding it to textbox value say "2". So sum is "4", and now I want to select date in dropdown "ddlTotalWeeks" which is in same format as that of "ddlWeeks". how can select value in dropdown "ddlTotalWeeks", selected value should be sum of "ddlWeeks.SelectedValue+textboxdays".
I want to use 'ddlWeeks" on change client side event (it is working fine). On this event I want to set dropdownTotalWeeks values. Main problem how I can set the value in client side code telerik:GridDropDownColumn.
sarbjit
Top achievements
Rank 1
 asked on 16 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?