Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
Hello Everyone,

I see there is a way to check the total file size that is being transferred from all files. But I am looking for some validation on the onclientfileselected method. Is there a way to check the file size of just the file that is just been selected so I can display a validation message if it exceeds 3mb?

-Chris
Shinu
Top achievements
Rank 2
 answered on 03 Jan 2012
4 answers
144 views
I have a grid Control where I have a client side ajax handler on a row click... but also in the row i have 2 controls which are buttons (LinkButtons) which calls a different method and I do not want the ajax handler on those.

The problem i'm having is that the row click always trigger the client side ajax... even if I've only clicked on the button controls.

I was able to get the behaviour I want with a different button (Image)
Here's the code to demonstrate the problem

<ClientSettings>
    <Selecting AllowRowSelect="True" />
    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    <ClientEvents OnRowClick="SelectShoppingList_RowClick" /> <% This triggers an Ajax Call on Row Click %>
</ClientSettings>
<MasterTableView DataKeyNames="Account_ID, List_ID" ClientDataKeyNames="Account_ID, List_ID">
    <Columns>
        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="SelectList" CommandArgument="Account_ID, List_ID"
            ImageUrl="../Images/btSelectCharcoal.gif" Visible="false" UniqueName="SelectColumn">
        </telerik:GridButtonColumn>
        <telerik:GridTemplateColumn UniqueName="TemplateColumn" ItemStyle-Width="400px">
            <ItemTemplate>
                <asp:Label ID="lblTemplateName" runat="server" CssClass="slListName"> <%# DataBinder.Eval(Container.DataItem, "List_Name")%></asp:Label><br />
                <asp:Label ID="lblLastUpdated" runat="server" CssClass="slDetailLine"> <%# DataBinder.Eval(Container.DataItem, "Detail_Line")%></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn UniqueName="ItemsColumn" DataField="Item_Count_Display"
            ItemStyle-Width="80px" ItemStyle-CssClass="slItemCount">
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn UniqueName="CommandsColumn">
            <ItemTemplate>
                <telerik:RadButton ID="btnRename" runat="server" CommandName="RenameList" CommandArgument="Account_ID, List_ID"
                    Text="Rename" UniqueName="RenameColumn" ButtonType="LinkButton" BorderWidth="0"
                    Font-Underline="true" BackColor="#063648" ForeColor="White">
                </telerik:RadButton> <%OnClick on this button always triggers the Ajax Call which I do not want %>
                <br />
                <telerik:RadButton ID="btnDelete" runat="server" CommandName="DeleteList" CommandArgument="Account_ID, List_ID"
                    Text="Delete" UniqueName="DeleteColumn" ButtonType="LinkButton" BorderWidth="0"
                    Font-Underline="true" BackColor="#063648" ForeColor="White">
                </telerik:RadButton><%OnClick on this button always triggers the Ajax Call which I do not want %>
 
                <telerik:RadButton ID="btnCancel" runat="server" Width="72"
                    Height="31">
                    <Image ImageUrl="../Images/btCancelCharcoal.gif" />
                </telerik:RadButton><% This button does not trigger the AJAX call which is what i want%>
 
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridButtonColumn FilterControlAltText="Filter DeleteCol column" UniqueName="DeleteCol"
            ButtonType="ImageButton" CommandName="DeleteItemFromShoppingList" CommandArgument="Account_ID,List_ID"
            ConfirmText="Are you sure you want to delete this item from the list ?" ConfirmTitle="Delete List"
            ImageUrl="..\Images\icoDeleteRedX.gif" ItemStyle-HorizontalAlign="Left"> ><% Similarly This button does not trigger the AJAX call which is what i want%>
        </telerik:GridButtonColumn>
    </Columns>
</MasterTableView>



Why Can't i have the same rowclick to be ignored on the LinkButtons as I have in the Image Buttons?

Thanks

Gotcha
Top achievements
Rank 1
 answered on 03 Jan 2012
2 answers
137 views

Hi Team,

In my web application,

 <asp:TableRow>
                                                    <asp:TableCell>
                                                      
                                                            <div id="JumpChoice">
                                                            <table>
                                                                <tr>
                                                                    <td id="Td1">
                                                                        <span class="smallTitle">Column Repeat</span><br />
                                                                        <telerik:RadComboBox ID="uxCheckboxChoicesColumnRepeat1" runat="server" OnClientSelectedIndexChanged="CheckBoxChoicesColumnRepeatChanged1">
                                                                            <Items>
                                                                                <telerik:RadComboBoxItem Text="One Column" Value="1" />
                                                                                <telerik:RadComboBoxItem Text="Two Columns" Value="2" />
                                                                                <telerik:RadComboBoxItem Text="Three Columns" Value="3" />
                                                                                <telerik:RadComboBoxItem Text="Four Columns" Value="4" />
                                                                            </Items>
                                                                        </telerik:RadComboBox>
                                                                    </td>
                                                                </tr>
                                                                 <tr>
                                                                    <td>
                                                                        <asp:Panel runat="server" ID="uxJumpPanel">
                                                                            <telerik:RadListView ID="feeldChoices" runat="server" OnItemDataBound = "feeldChoices_ItemDataBound" >
                                                                                <ItemTemplate>
                                                                                    <table cellpadding="0" cellspacing="0">
                                                                                        <tr>
                                                                                            <td>
                                                                                                <telerik:RadTextBox runat="server" Text='<%# Eval("Text") %>' onkeyup="SyncListToCheckbox(this)"
                                                                                                    ID="uxItemText" Width="260">
                                                                                                </telerik:RadTextBox>
                                                                                                  <telerik:RadComboBox runat="server" ID="uxSelectPage1" ></telerik:RadComboBox>
                                                                                            </td>
 
                                                                                            <td>
                                                                                                <img id="imageAdd" style="cursorpointer" runat="server" onclick="InitiateAjaxRequest('1,3,add|' + this.id + ',' + selectedDockId); SetUnsaved();"
                                                                                                    alt="Add field choice" border="0" src="Images/Add.png" />
                                                                                            </td>
                                                                                            <td>
                                                                                                <img id="imageDelete" style="cursorpointer" runat="server" onclick="InitiateAjaxRequest('1,3,remove|' + this.id + ',' + selectedDockId); SetUnsaved();"
                                                                                                    alt="Delete field choice" border="0" src="Images/Delete.png" />
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </ItemTemplate>
                                                                            </telerik:RadListView>
                                                                        </asp:Panel>
                                                                    </td>
                                                                </tr>
                                                              
                                                            </table>
                                                        </div>
                                                       
                                                    </asp:TableCell>
                                            </asp:TableRow>

what I want is, how do I set value to this uxSelectPage1 combobox from codebehind?

//Thanks

raaj
Top achievements
Rank 1
 answered on 03 Jan 2012
2 answers
298 views
I have looked everywhere for this answer and just can't seem to find it.  Hope someone out there knows....

I have a RadTabStrip on my page with dynamically loaded UserControls, each having its own RadGrid on it.  These are all scrollable grids and I have the appropriate working JavaScript to get the height to work and ensure the grid renders correctly (along with making sure the columns line up in all browsers). The problem I am having is that once a tab is loaded, I click on another tab to load that one, then go back to the first tab (with no Postback), the grid is all messed up!  The header row is gone and just replaced with blocks. I need to call my FixGrid method which takes a RadGrid as the parameter.  Calling this method does fix the grid when I have it in a scenario where the grids are not dynamically loaded with UserControls and I can access the IDs of each RadGrid on the page; i.e. something like this:

function ClientTabSelected(sender, args) {
    var radgrid;
     if (sender.get_selectedIndex() == 0) {
         radgrid = $find("<%= rgGrid1.ClientID %>");
     }
     else {
         radgrid = $find("<%= rgGrid2.ClientID %>");
     }
 
     FixGrid(radgrid);
 }


I have tried the OnClientTabSelected event on the RadTabStrip on the ASPX page that houses the UserControls; the problem is I can't access the IDs for the RadGrids on the dynamically loaded UserControls from that page.  Furthermore, I plan to use this scenario quite a bit and would like a centralized method that can handle this.

So, my question is, is it possible to write some JavaScript / jQuery that can get all instances of RadGrids on the page every time the OnClientTabSelected is called and loop through them, calling the my FixGrid method on every one?  Or is there a better way to solve this problem?

I saw there is a $telerik.findGrid() method, a $telerik.toGrid() method and I can access the Telerik.Web.UI.RadGrid object.  Unfortunately I just can't find any way to get this to work.

Thanks in advance for your help with this!
Brian Levin
Top achievements
Rank 2
 answered on 02 Jan 2012
1 answer
105 views
Is there documentation for the Ajax controls in pdf format? I would like to read them on the iPad.
abdu bukres
Top achievements
Rank 1
 answered on 02 Jan 2012
0 answers
127 views
Never mind, Stupid mistake
Tim
Top achievements
Rank 2
 asked on 02 Jan 2012
5 answers
242 views
Hello,

my control is updated by a RadAjaxManager which works fine. But now I try to register a client script resource. I don't get an exception when doing this, but the webresource isn't rendered into the page. The path to the embedded resource must be correct because using a wrong path generated an exception.

This is what I do in OnPreRender:
ScriptManager.RegisterClientScriptResource(this, GetType(), "Search.MySearch.js");

This is what I added to AssemblyInfo.cs:
[assembly: WebResource("Search.MySearch.js", "text/javascript")]

When I look into the assembly with dotPeek, I can see that the resource name is correct. Why doesn't 
the javascript file get rendered into the page? I don't use the RadScriptManager at the moment.

If I don't add the specific AjaxSetting to the RadAjaxManager, the script resource is added to the page.

Thanks for your help!
Jorge
Top achievements
Rank 1
 answered on 02 Jan 2012
4 answers
98 views
I followed the demo on the Telerik website for implementing a RadTreeView within a RadComboBox. I have the TreeView displaying in the ComboBox, but when I select an item it doesn't display anything in the box. Attached is an image of what the ComboBox looks like after I select an item. Below is the code:

ASPX

<div class="collapsibleContainer" data-title="Notifications">
      <telerik:RadAjaxLoadingPanel ID="notificationsLoadingPanel" runat="server" Skin="Simple" />
      <telerik:RadTreeList ID="notificationsTree" runat="server" AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false"
        OnNeedDataSource="notifications_needdata" DataKeyNames="ID" ParentDataKeyNames="PID" ShowTreeLines="false" EditMode="PopUp"
         OnPreRender="notifications_PreRender" OnItemDataBound="notificationTree_ItemDataBound" OnItemCommand="notificationTree_ItemCommand">
          <Columns>
              <telerik:TreeListEditCommandColumn ShowEditButton="false" AddRecordText="Add" HeaderStyle-Width="50px" />
              <telerik:TreeListBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID" Visible="false" />
              <telerik:TreeListBoundColumn HeaderText="PID" DataField="PID" UniqueName="PID" Visible="false" />
              <telerik:TreeListBoundColumn HeaderText="Name" DataField="Name" />
              <telerik:TreeListBoundColumn HeaderText="Item" DataField="ItemsID" HeaderStyle-Width="100px" />
              <telerik:TreeListBoundColumn HeaderText="Trigger On Allocate" DataField="TriggerOnAllocate" HeaderStyle-Width="125px"/>
              <telerik:TreeListBoundColumn HeaderText="Category" DataField="Category" />
              <telerik:TreeListBoundColumn HeaderText="Location" DataField="Location" HeaderStyle-Width="125px" />
              <telerik:TreeListEditCommandColumn ShowAddButton="false" HeaderStyle-Width="50px" />
              <telerik:TreeListButtonColumn HeaderStyle-Width="55px" Text="Delete" CommandName="Delete" ButtonType="LinkButton" />
          </Columns>
          <EditFormSettings EditFormType="Template" PopUpSettings-Modal="true" InsertCaption="Add Notification" PopUpSettings-Height="550px" PopUpSettings-Width="730px">
              <FormTemplate>
                  <table>
                      <tr>
                          <asp:Label ID="notificationID" runat="server" Text='<%#Bind("ID") %>' Visible="false" />
 
                          <td>Name:</td>
                          <td colspan="3"><telerik:RadTextBox ID="editName" runat="server" EmptyMessage="Enter Name" /></td>
                      </tr>
                      <tr>
                          <td>Repeat Interval:</td>
                          <td><telerik:RadTextBox ID="editInterval" runat="server" /></td>
                          <td>Max Repeat:</td>
                          <td><telerik:RadTextBox ID="editRepeat" runat="server" /></td>
                      </tr>
                      <tr>
                          <td>Send On Weekends:</td>
                          <td><asp:CheckBox ID="editWeekends" runat="server" /></td>
                          <td>Send On Holidays:</td>
                          <td><asp:CheckBox ID="editHolidays" runat="server" /></td>
                      </tr>
                      <tr>
                          <td colspan="2">Item:</td>
                          <td colspan="2">Location:</td>
                      </tr>
                      <tr>
                          <td style="vertical-align:top;"><telerik:RadComboBox ID="editItem" runat="server" EmptyMessage="Type a PS#" MarkFirstMatch="true" OnSelectedIndexChanged="editItem_SelectedIndexChanged"/></td>
                          <td>
                          <telerik:RadButton ID="editItemTransfer" runat="server" Text="+" OnClick="editItemTransfer" />
                          <telerik:RadListBox ID="editItemListBox" runat="server" AllowDelete="true" Height="170px" Width="130px" ButtonSettings-Position="Left" />
                          </td>
                          <td style="vertical-align:top;">
                              <telerik:RadComboBox ID="editLocationComboBox" runat="server" OnClientDropDownOpened="OnClientDropDownOpenedHandler" ShowToggleImage="true" Width="230px">
                                  <ItemTemplate>
                                      <div id="div1">
                                          <telerik:RadTreeView ID="editLocationTreeView" runat="server" OnClientNodeClicking="locationNodeClicking" />
                                      </div>
                                  </ItemTemplate>
                                  <Items>
                                      <telerik:RadComboBoxItem Text="" />
                                  </Items>
                              </telerik:RadComboBox>
 
                              <script type="text/javascript">
                                  var div1 = document.getElementById("div1");
                                  div1.onclick = StopPropagation;
                              </script>
                          </td>
                          <td><telerik:RadListBox ID="editLocationListBox" runat="server" AllowDelete="true" AllowTransfer="true" Height="170px" Width="170px">
                          <ButtonSettings ShowDelete="true" Position="Left" TransferButtons="TransferTo"  />
                          </telerik:RadListBox></td>
                      </tr>
                      <tr>
                          <td colspan="4">Category:</td>
                      </tr>
                      <tr>
                          <td style="vertical-align:top;"><telerik:RadComboBox ID="editCategory" runat="server" EmptyMessage="Type a Category" MarkFirstMatch="true" /></td>
                          <td colspan="3">
                          <telerik:RadButton ID="editCategoryTransfer" runat="server" Text="+" OnClick="editCategoryTransfer" />
                          <telerik:RadListBox ID="editCategoryListBox" runat="server" AllowDelete="true" Height="170px" Width="200px" ButtonSettings-Position="Left" />
                          </td>
                      </tr>
                      <tr>
                          <td colspan="4">
                              <telerik:RadButton ID="editSubmit" runat="server" Text="Submit" CommandName="Add Details" />
                              <telerik:RadButton ID="updateSubmit" runat="server" Text="Update" CommandName="Update" Visible="false" />
                          </td>
                      </tr>
                  </table>
              </FormTemplate>
          </EditFormSettings>
 
      </telerik:RadTreeList>


JS

<script type="text/javascript">
    function locationNodeClicking(sender, args) {
        var combobox = document.getElementById(editLocationComboBox.InputID);
        alert(combobox);
 
        var node = args.get_node()
 
        comboBox.set_text(node.get_text());
 
        comboBox.trackChanges();
        comboBox.get_items().getItem(0).set_text(node.get_text());
        comboBox.commitChanges();
 
        comboBox.hideDropDown();
 
        // Call comboBox.attachDropDown if:
        // 1) The RadComboBox is inside an AJAX panel.
        // 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
        // Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.
 
        comboBox.attachDropDown();
    }
 
    function StopPropagation(e) {
        if (!e) {
            e = window.event;
        }
 
        e.cancelBubble = true;
    }
 
    function OnClientDropDownOpenedHandler(sender, eventArgs) {
        // var tree = document.getElementById(editLocationTreeView.InputID);
        var tree = sender.get_items().getItem(0).findControl("editLocationTreeView");
        var selectedNode = tree.get_selectedNode();
        if (selectedNode) {
            selectedNode.scrollIntoView();
        }
    }
      </script>
William
Top achievements
Rank 1
 answered on 02 Jan 2012
1 answer
119 views
Hi all,


I have a grid view with an automatic datasource binding.
I would like this databinding to fire only if meets some condition.

Today, when ever a text is entered to the TextBox and a button is pressed the databidning is excuted.

Note - I don't want to change the datasource query, just it's happening...


Can I override this?


Thx
Iana Tsolova
Telerik team
 answered on 02 Jan 2012
2 answers
106 views
Hi All,

I have one simple gridview with inline edit. My problem is that it does not display "Save" and "Cancel" image button while adding new record untill i placed below tag in the gridview

<telerik:GridEditCommandColumn ButtonType="ImageButton">
             </telerik:GridEditCommandColumn>


I just only want to provide Insert functionality to gridview not edit functionality.

Any Idea ?

Regards,
Ruchi 
Ruchi
Top achievements
Rank 1
 answered on 02 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?