Telerik Forums
UI for ASP.NET AJAX Forum
22 answers
559 views
I am getting a wierd error when trying to run a (framework 3.5) radcontrols enabled web application in c# or vb.  When I try and run the web application the first time it says debugging is not enabled.  In the dialog it give me to options to add a new web.config and or to run without debugging.  If I try and add a new web.config which there is one already it give me a the operation could not be completed unspecified error.  If I modify the web.config to enable debugging by hand it still gives me the debugging is not enabled message box.
Erjan Gavalji
Telerik team
 answered on 29 Oct 2010
1 answer
94 views
Hi,

I received the following errors on using Rad Editor.
The steps to repro are:
1. Place large html content in the HTML section of the Rad Editor which also contains some images.
2. Switch to Design View and select any image.
3. Right click on the image and select properties.
The application Hangs and the following screens are displayed.

Screen shot 1
 
After clicking on Ok another error window pops up displaying the following error message.
Screen shot 2 


Please let me know if anybody has similar exception/ Solution
Thanks
Rajesh Soni

Stanimir
Telerik team
 answered on 29 Oct 2010
1 answer
92 views
Hello, 

I'm trying to put an AppointmentContextMenus and it's working well.

Do you have any project to add a fonctionnality like Copy/Cut/Past?
It could be very usefull.

I made something by my own, but the grid is not refersh in ajax when I past. I have to reload the page to see the past...
And I can't enable or not item depending on the state... Can we past? can we copy?

Thank you

Jean-Yves
Shinu
Top achievements
Rank 2
 answered on 29 Oct 2010
2 answers
164 views
Hello,
I have grid that is for printing purposes. It has some GridBoundColumns and some GridTemplateColumns. Now, the users want to change some values in the cells before printing. Therefore I have implemented an EditCommandColumn. By pressing the edit button only the GridBoundColumns can be changed. Is it possible to have the TemplateColumns edited as well? The changed data does not have to be saved or anything else. It just has to be printed later.

Best regards
Ferdinand
Ferdinand
Top achievements
Rank 1
 answered on 29 Oct 2010
1 answer
91 views
  

When I change the order of the items/rows in the grid using client side code, I would like to find the new order representation.
I used the MasterTableView.Items collection and I end up with the original order, as when I bind the grid with the data. 

What is the correct collection property to iterate through to retrieve the current row order of the rearranged grid?

  <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            var _selectedRow;
            function radgvAddress_RowSelected(sender, args) {
                _selectedRow = $get(args.get_id());

            }

            function moveRowUp() {
                if (_selectedRow && _selectedRow.sectionRowIndex > 0) {
                    swapRows(_selectedRow, _selectedRow.parentNode.rows[_selectedRow.sectionRowIndex - 1])
                }
            }

            function moveRowDown() {
                if (_selectedRow && _selectedRow.sectionRowIndex < _selectedRow.parentNode.rows.length - 1) {

                    swapRows(_selectedRow, _selectedRow.parentNode.rows[_selectedRow.sectionRowIndex + 1])
                }
            }

            function serializeChanges(index1, index2) {
                var reorderInput = document.getElementById("ReorderChanges");
                if (reorderInput) {
                    reorderInput.value += index1 + "," + index2 + ";";
                }
            }

            function swapRows(sourceRow, targetRow) {
                for (var i = 0; i < sourceRow.cells.length; i++) {
                    var cellContent1 = targetRow.cells[i].innerHTML;
                    var cellContent2 = sourceRow.cells[i].innerHTML;
                    targetRow.cells[i].innerHTML = cellContent2;
                    sourceRow.cells[i].innerHTML = cellContent1;
                }
                $find("<%= radgvAddress.MasterTableView.ClientID %>").selectItem(targetRow);
                serializeChanges(sourceRow.sectionRowIndex, targetRow.sectionRowIndex);
            }
        </script>
    </telerik:RadScriptBlock>



//// I've used a foreach statement also but then I figured it was the collection.  radgvAddress.MasterTableView.Items return the orginal order for us.

for (int i = radgvAddress.Items.Count; i > 0; i--)
                {
                    //int PatientAddressID = Convert.ToInt32(radgvAddress.Items[i - 1].OwnerTableView.DataKeyValues[radgvAddress.Items[i - 1].ItemIndex]["PatientAddressID"]);
                    int PatientAddressID = Convert.ToInt32(radgvAddress.MasterTableView.Items[i - 1].GetDataKeyValue("PatientAddressID"));
                    QuickviewPMS_BO.PatientAddress PatientAddressObj = QuickviewPMS_BO.PatientAddress.GetPatientAddress(PatientAddressID, SessionHelper.SessionUserObjectsInfo.ClientId);
                    PatientAddressObj.AddressOrder = i;
                    if (!PatientAddressObj.IsValid)
                    {
                        GlobalHelper.ShowMessage(lblMessage, GlobalHelper.GetBrokenRules(PatientAddressObj), GlobalHelper.MessageType.Error);
                        return;
                    }
                    PatientAddressObj.Save();
                                 } 
  radgvAddress.Rebind();

            }





 

 

 

 

<telerik:RadGrid ID="radgvAddress" runat="server" GridLines="None"
   AllowPaging="True" PageSize="5" AutoGenerateColumns="False" Width="100%"
    ShowStatusBar="true" AllowAutomaticDeletes="false" AllowAutomaticInserts="false"
    AllowAutomaticUpdates="false" HorizontalAlign="NotSet" Skin="Vista"
    OnDetailTableDataBind="radgvAddress_DetailTableDataBind"
                            OnInsertCommand="radgvAddress_InsertCommand"
                            OnNeedDataSource="radgvAddress_NeedDataSource"
                            OnUpdateCommand="radgvAddress_UpdateCommand"
                            OnDeleteCommand="radgvAddress_DeleteCommand"
                            OnItemDataBound="radgvAddress_ItemDatabound"
                            onselectedindexchanged="radgvAddress_SelectedIndexChanged">
    <MasterTableView CommandItemDisplay="Top" ClientDataKeyNames="PatientAddressID" DataKeyNames="PatientAddressID" EditMode="PopUp">
        <CommandItemTemplate>
            <telerik:RadToolBar ID="RadToolBar1" OnButtonClick="RadToolBar1_ButtonClick" runat="server"
                Skin="Vista" OnClientButtonClicking="onToolBarClientButtonClicking">
                <Items>
                    <telerik:RadToolBarButton  Text="Add" CommandName="InitInsert" Value="1" ImageUrl="~/Images/AddRecord.gif"
                        Visible='<%# !radgvAddress.MasterTableView.IsItemInserted %>'>
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="Edit" Enabled="false" CommandName="EditSelected" Value="2" ImageUrl="~/Images/Edit.gif"
                        Visible='<%# radgvAddress.EditIndexes.Count == 0 %>'>
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="Update" CausesValidation="false" CommandName="UpdateEdited" Value="3" ImageUrl="~/Images/Update.gif"
                        Visible='<%# radgvAddress.EditIndexes.Count > 0 %>'>
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="Cancel" CausesValidation="false" CommandName="CancelAll" Value="4" ImageUrl="~/Images/Cancel.gif"
                        Visible='<%# radgvAddress.EditIndexes.Count > 0 || radgvAddress.MasterTableView.IsItemInserted %>'>
                    </telerik:RadToolBarButton>                
                    <telerik:RadToolBarButton Text="Delete" Enabled="false" CausesValidation="false"  CommandName="DeleteSelected" Value="5"
                        ImageUrl="~/Images/Delete.gif">
                         </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Visible="false" Text="ChangeStatus" CommandName="ChangeStatus" Value="6"
                         ImageUrl="~/Images/Edit.gif">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton  Text="Refresh" CausesValidation="false" CommandName="RebindGrid" Value="7" ImageUrl="~/Images/Refresh.gif">
                    </telerik:RadToolBarButton>
                      <telerik:RadToolBarButton  Text="Save" CausesValidation="false" CommandName="RebindGrid" Value="8" ImageUrl="~/Images/Update.gif">
                    </telerik:RadToolBarButton>
                </Items>
            </telerik:RadToolBar>
        </CommandItemTemplate>
       
        <Columns>
         <telerik:GridTemplateColumn UniqueName="SNo" HeaderText="S No">
                                <ItemTemplate>
                                <asp:Label ID="lblSno" runat="server" ></asp:Label>
                               
                                </ItemTemplate>
                                <HeaderStyle Width="45px" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="AddressID">
                <ItemTemplate>
              
                                 <asp:Label ID="lblAddressID" runat="server" Text='<%#Bind("PatientAddressID") %>'></asp:Label>
                             
                </ItemTemplate>
                </telerik:GridTemplateColumn>
             <telerik:GridBoundColumn UniqueName="AddressLine" HeaderText="Address Line" DataField="Address1">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Country" HeaderText="Country" DataField="CountryName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="StateName" HeaderText="State" DataField="StateName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField="CityName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ZipCode" HeaderText="Zip Code" DataField="ZipCodeName">
            </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Status">
                <ItemTemplate>
                <asp:Label ID="lblStatus" runat="server" Text='<%#Bind("Active") %>'></asp:Label>
                </ItemTemplate>
                </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings InsertCaption="Add new Address" CaptionFormatString="Edit Address"
            CaptionDataField="PatientAddressID" PopUpSettings-Width="520" EditFormType="Template" PopUpSettings-Modal="true">
           
             <FormTemplate>
                <table id="Table1" cellspacing="1" cellpadding="1" class="popuptbl" width="520" border="0">
                            <td class="popregtxt">
                        Address Line1<span class="mandatory">*</span> :
                    </td>
                    <td class="popregcontrol">
                        <telerik:RadTextBox Width="160px" TabIndex="1" ID="radtxtAddress1" runat="server" Text='<%# Bind( "Address1") %>'>
                        </telerik:RadTextBox>
                         <br />
                             <asp:RequiredFieldValidator ID="rfvAddress1" runat="server" ControlToValidate="radtxtAddress1"
                        Display="Dynamic" ErrorMessage="Enter Address1" ValidationGroup="Address"  CssClass="validationtxt"   Font-Bold="false" SetFocusOnError="True">
                        </asp:RequiredFieldValidator>  
                    </td>

                     <td class="popregtxt">
                        Address Line2<span class="mandatory"></span> :
                    </td>
                    <td class="popregcontrol">
                        <telerik:RadTextBox Width="160px" TabIndex="2" ID="radtxtAddress2" runat="server" Text='<%# Bind( "Address2") %>'>
                        </telerik:RadTextBox>
                       
                    </td>

                    </tr>
                    <tr>
                   
                    <td class="popregtxt">
                        Country<span class="mandatory">*</span> :
                    </td>
                    <td class="popregcontrol">
                       <telerik:RadComboBox ID="radcmbCountry" Width="160px" TabIndex="3"  DataTextField="CountryName"
                        DataValueField="CountryID" DataSourceID="DsCountryClassSelect" AllowCustomText="false"
                        SelectedValue='<%# Bind("CountryID") %>' AutoCompleteSeparator="" CausesValidation="false" MarkFirstMatch="true" runat="server" 
                        AutoPostBack="true" OnSelectedIndexChanged="radcmbCountry_SelectedIndexChanged">
                       <Items>
                        <telerik:RadComboBoxItem Text="--Select--" Value="-1" Selected="true" runat="server" />
                        </Items>
                      </telerik:RadComboBox>
                       <br />
                        <asp:RequiredFieldValidator ValidationGroup="Address" CssClass="validationtxt" ID="rfvCountry"
                         runat="server" ErrorMessage="Select a Country" InitialValue="--Select--" ControlToValidate="radcmbCountry"></asp:RequiredFieldValidator>
                    </td>

                        <td class="popregtxt">
                            State<span class="mandatory">*</span> :
                        </td>
                        <td class="popregcontrol">
                            <telerik:RadComboBox ID="radcmbState"  runat="server" DataTextField="StateName" DataValueField="StateID"
                            TabIndex="4" AllowCustomText="false" AutoCompleteSeparator="" Width="160px" CausesValidation="false"
                            MarkFirstMatch="true" AutoPostBack="true" OnSelectedIndexChanged="radcmbState_SelectedIndexChanged">
                            <Items>
                            <telerik:RadComboBoxItem Text="--Select--" Value="-1" Selected="true" runat="server" />
                            </Items>
                            </telerik:RadComboBox>
                            <br />
                             <asp:RequiredFieldValidator ValidationGroup="Address" CssClass="validationtxt" ID="rfvState"
                         runat="server" ErrorMessage="Select a State" InitialValue="--Select--" ControlToValidate="radcmbState"></asp:RequiredFieldValidator>
                        </td>
                       
                    </tr>
                    <tr>
                    <td class="popregtxt">
                            City<span class="mandatory">*</span> :
                        </td>
                        <td class="popregcontrol">
                             <telerik:RadComboBox ID="radcmbCity" Width="163px" AllowCustomText="false" runat="server"
                             DataTextField="CityName" DataValueField="CityID" CausesValidation="false" MarkFirstMatch="true" TabIndex="5"
                             AutoPostBack="true" OnSelectedIndexChanged="radcmbCity_SelectedIndexChanged"  >
                             <Items>
                            <telerik:RadComboBoxItem Text="--Select--" Value="-1" runat="server" />
                            </Items>
                           </telerik:RadComboBox>
                            <br />
                        <asp:RequiredFieldValidator ValidationGroup="Address" CssClass="validationtxt" ID="rfvCity"
                         runat="server" ErrorMessage="Select a City" InitialValue="--Select--" ControlToValidate="radcmbCity"></asp:RequiredFieldValidator>
                        </td>
                        <td class="popregtxt">
                            ZipCode<span class="mandatory">*</span> :
                        </td>
                        <td class="popregcontrol">
                            <telerik:RadComboBox ID="radcmbZipCode" Width="163px" runat="server" DataTextField="ZipCodeName"
                            DataValueField="ZipCodeID" AllowCustomText="false" TabIndex="6" AutoCompleteSeparator=""
                            CausesValidation="false" MarkFirstMatch="true" >
                            <Items>
                            <telerik:RadComboBoxItem Text="--Select--" Value="-1" Selected="true" runat="server" />
                            </Items>
                        </telerik:RadComboBox>
                        <br />
                        <asp:RequiredFieldValidator ValidationGroup="Address" CssClass="validationtxt" ID="rfvZipCode"
                         runat="server" ErrorMessage="Select a ZipCode" InitialValue="--Select--" ControlToValidate="radcmbZipCode"></asp:RequiredFieldValidator>
                        </td>
                     
                    </tr>
                    <tr>
                      <td class="popregtxt">
                            Status :
                        </td>
                        <td class="popregcontrol">
                           <telerik:RadComboBox ID="radcmbStatus" runat="server" Width="163px" TabIndex="7" SelectedValue='<%#Bind("Active") %>'>
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="Active" Value="True" />
                                                    <telerik:RadComboBoxItem Text="InActive" Value="False" />
                                                </Items>
                                            </telerik:RadComboBox>
                        </td>

                   
                    </tr>
                    <tr> 
                    <td>
                    </td><td></td></tr>
                </table>
                <table class="popbuttontbl">
                    <tr>
                        <td align="right">
                            <asp:Button ID="Button1" ValidationGroup="Address" TabIndex="10" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                            </asp:Button>&nbsp;
                            <asp:Button ID="Button2" TabIndex="11" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                            </asp:Button>
                        </td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
     </MasterTableView> 
    <ClientSettings>
  <%--   EnablePostBackOnRowClick="true"--%>
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
     <ClientEvents OnRowSelected="radgvAddress_RowSelected"></ClientEvents>
    </ClientSettings>

</telerik:RadGrid>

 

 

Veli
Telerik team
 answered on 29 Oct 2010
8 answers
261 views
my webpage have two input control that is textbox &  search button. i wrote  textbox keypress event javascript .
if i try to type keywords in textbox, the keypress event is firing and then click search button control .again i try  to type keywords in textbox the keypress event not firing..

Hope u could understand what i meant, plz help me..


this is my code:


<head id="Head1" runat="server">
 
</head>
<body>
    <form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="True">
     <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />    
    </Scripts>
</asp:ScriptManager>
  
  <script type="text/javascript">
    window.$ = $telerik.$;
    $(document).ready(function() {
        var typeDelay = function(){
            var timer = 0;
            return function(callback, ms){
               clearTimeout (timer);
               timer = setTimeout(callback, ms);
            
        }();
         
        $("#query").keypress(function(){
        
               // your ajax search here, with a 300 ms delay...   
               typeDelay(function(){
                
               alert('controls comes here.!'); 
                
                }, 300);
        });
    }); 
  
 </script>
<telerik:RadAjaxManager id="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <ajaxsettings>
              <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">
                <UpdatedControls>
                               <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />  
                </UpdatedControls>
            </telerik:AjaxSetting>                
  </ajaxsettings>
</telerik:RadAjaxManager>
 
<telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" Runat="server" Skin="Default"  Width="100%"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
         <asp:TextBox ID="query" MaxLength="100" runat="server" />
        <asp:Button ID="btnSubmit" runat="server" Text="Search" />
                
        </telerik:RadAjaxPanel>
    </form>
</body>
</html>
nanthakumar thangavel
Top achievements
Rank 1
 answered on 29 Oct 2010
4 answers
146 views
Hello,

I'm working on a scenario similar to this demo, where a click on an item in a RadGrid updates other RadGrids through AJAX. That part works fine. Now, I would like the header above the automatically updated RadGrids to be updated too, based on the clicked item. The code below allows me to get the ID which was clicked in the main RadGrid.

    Private Sub RadGridResellers_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridResellers.ItemCommand
        If (e.CommandName = "RowClick") Then
            Dim GridItem As Telerik.Web.UI.GridDataItem = e.CommandSource
            Dim ResellerID As Short = GridItem.GetDataKeyValue("id")
wState)
            ... more code ...
        End If
    End Sub

However, this event seems to be too late in the page life cycle to make changes to the header or any other control. I can store the ID into the viewstate and make my changes on a second postback, but that's not very elegant. Is there another way?
Arno
Top achievements
Rank 2
 answered on 29 Oct 2010
2 answers
75 views
Why does the advanced form have to work the way that it does? What I mean is, if I've understood correctly, the advanced form is actually just another part of the scheduler itself and so updating the advanced form, is, in fact, an update of the scheduler itself.

I wonder if it is not possible to completely divorce the advanced form from the scheduler completely. that is, have a completely independent page that queries and updates the data store directly, taking only an indication of the mode and maybe the ID of the appointment to be edited from the scheduler when it is called, maybe via the query string. 

OK, it would, I suppose, mean that the code currently in the scheduler for handling the data store operations for an update would have to be moved but updates to the scheduler itself, if needed could be stimulated using the OnClientClose callback function of the window holding the new advanced form.

I wonder if there is the ability already to do it this way as I note that the SchedulerFormMode enumeration has a "Hidden" value. I'd like to know what that's for.

I guess I'd have to catch a number of the client-side events to stop the built-in functionality from kicking in, but I'd imagine that that is quite doable.

I'd like to hear from someone at telerik towers on the above, especially on the idea of suppressing the built in forms.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 29 Oct 2010
1 answer
69 views
Hi,

I was hoping to easily trap errors such as access denied and handle those gracefully. What would be the best way to handle this as it happens alot. Thanks.
Fiko
Telerik team
 answered on 29 Oct 2010
1 answer
138 views
Hi,
I've read the previous threads on this topic but I still cannot seem to get it working consistently.
I have a radgrid that contains an Image button column. I am registering the button in this column as a post back control in the ItemCreated event of the grid. When the page first loads and I click on this button it works as expected, by doing a full postback. The problem only occurs if any other ajax update is applied to the grid, such as selecting a different page off the grid. The next time i click on the 'post back' button in the column, it will postback via ajax.

Here is my code:

void SearchResults_ItemCreated(object sender, GridItemEventArgs e)
    {
        if(e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
            ImageButton publishedImgButton = item["PublishButton"].Controls[0] as ImageButton;
            if (publishedImgButton != null)
            {
                RadScriptManager.GetCurrent(this.Page).RegisterPostBackControl(publishedImgButton);
            }
        }
    }

This is the column definition in the rad grid:
<telerik:GridButtonColumn ItemStyle-HorizontalAlign="Center" HeaderText="Download PDF file" UniqueName="PublishButton" CommandName="GetPublished" ButtonType="ImageButton" ImageUrl="../../Images/Buttons/Small/document_down.png">
      <ItemStyle HorizontalAlign="Center"></ItemStyle>
</telerik:GridButtonColumn>

Thanks for your help
Pavlina
Telerik team
 answered on 29 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?