Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
153 views

Hello,

 

I have a RadGrid with BatchEdit mode, as the following

 

        <telerik:RadGrid runat="server" RenderMode="Lightweight" ID="RadGrid1" Width="100%"
            DataSourceID="SqlDataSourceMain"
            AutoGenerateColumns="false"
            AllowSorting="true" ShowFooter="true"
            Skin="Bootstrap" OnBatchEditCommand="RadGrid1_BatchEditCommand"
AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" ClientSettings-ClientEvents-OnBatchEditCellValueChanged="cellValChanged" ClientSettings-ClientEvents-OnBatchEditClosed="batchEditClosed"
            AllowPaging="true" PageSize="10">
                        
            <MasterTableView CommandItemDisplay="Top" DataSourceID="SqlDataSourceMain" HorizontalAlign="NotSet" InsertItemDisplay="Bottom" DataKeyNames="Id"
                EditMode="Batch" BatchEditingSettings-EditType="Row">

                <Columns>
                   
                    <telerik:GridTemplateColumn HeaderText="Type" UniqueName="accountName" DataField="accountName">
                        <ItemTemplate>
                            <%# Eval("accountName") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            
                                                             <telerik:RadAutoCompleteBox Width="100%" RenderMode="Lightweight" runat="server" ID="txtAccountName" DataValueField="new_account_number"
                                                                DataTextField="accName" DropDownWidth="400px" DataSourceID="SqlDataSourceAccounts" Skin="Bootstrap" InputType="Token" Filter="Contains" OnClientEntryAdding="OnClientEntryAddingHandler" OnClientEntryRemoving="clientEntryRem">
                                                            </telerik:RadAutoCompleteBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="150px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="accountNumber" UniqueName="accountNumber" DataField="accountNumber">
                        <ItemTemplate>
                                 <%# Eval("accountNumber") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadAutoCompleteBox RenderMode="Lightweight" Width="100%" runat="server" ID="txtAccountNumber" DataValueField="accName"
                                                                DataTextField="new_account_number" DropDownWidth="400px" DataSourceID="SqlDataSourceAccounts" Skin="Bootstrap" InputType="Token" Filter="Contains">
                                                            </telerik:RadAutoCompleteBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="150px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="debitValue" DefaultInsertValue="0" SortExpression="debitValue" UniqueName="debitValue"
                        DataField="debitValue" FooterAggregateFormatString="{0:#,0.000}" Aggregate="Sum">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblDebitAmount" Text='<%# Eval("debitValue", "{0:#,0.000}") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <span>
                                <telerik:RadNumericTextBox Width="95px" RenderMode="Lightweight" Skin="Bootstrap" ClientEvents-OnValueChanged="valChangedDebit" runat="server" ID="txtDebitNumeric" Type="Currency">
                                </telerik:RadNumericTextBox>
                                <span style="color: Red">
                                    <asp:RequiredFieldValidator ID="rfvAmount"
                                        ControlToValidate="txtDebitNumeric" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                    </asp:RequiredFieldValidator>
                                </span>
                            </span>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                        <ItemStyle HorizontalAlign="Right" />
                        <FooterStyle HorizontalAlign="Right" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="creditValue"  DefaultInsertValue="0" SortExpression="creditValue" UniqueName="creditValue"
                        DataField="creditValue" FooterAggregateFormatString="{0:#,0.000}" Aggregate="Sum">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblCreditAmount" Text='<%# Eval("creditValue", "{0:#,0.000}") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <span>
                                <telerik:RadNumericTextBox Width="95px" RenderMode="Lightweight" Skin="Bootstrap" ClientEvents-OnValueChanged="valChangedCredit" runat="server" ID="txtCreditNumeric" Type="Currency">
                                </telerik:RadNumericTextBox>
                                <span style="color: Red">
                                    <asp:RequiredFieldValidator ID="rfvAmount2"
                                        ControlToValidate="txtCreditNumeric" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                    </asp:RequiredFieldValidator>
                                </span>
                            </span>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                        <ItemStyle HorizontalAlign="Right" />
                        <FooterStyle HorizontalAlign="Right" />
                    </telerik:GridTemplateColumn>
                      <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" 
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                    </telerik:GridButtonColumn>
                </Columns>

            </MasterTableView>
        </telerik:RadGrid>

 

I have outside two labels, one is Debit and the other is Credit. How can I refresh the labels (client-side) to contain the total of each column, the total of Debit to be in the debitlabel and the total of the Credit to be in the creditlabel.

 

Also, in the autocomplete, when i select a token, it is shown "token;" with additional ';' in the item template, this causes to be also inserted in the database, how can i remove the ';' mark?

 

 

Many thanks

Eyup
Telerik team
 answered on 06 Jan 2020
2 answers
490 views
I have a RadGrid setup so that the Edit is done in the modal popup.

Is there anyway to disable the "draggability" of the popup?

I want the popup window to stay where it is displayed initially.  I don't want the users to be able to drag it around. 

(Don't ask - long story)  :)

Any help would be appreciated-

Thanks-

John
Top achievements
Rank 1
 answered on 03 Jan 2020
3 answers
293 views
hi,

Find the attached grid image

I am using nestedviewtemplate in my application. i am saving the grid values using this query
 gvAddPlans - This original grid
gvAddSubPlans - This is nestedview grid

For Each item As GridDataItem In gvAddPlans.Items
 Next

How to get NestedView grid values.

i used this query

For Each NesItem As GridNestedViewItem In gvAddPlans.Items
Next

but it is not working
please give me any idea for this one.

Thanks,
Eyup
Telerik team
 answered on 03 Jan 2020
1 answer
155 views

I have a RadDataForm that contains several RadDropdownLists.   They are all using client binding each with their own instance of RadClientDataSource.

 

How can I unsure the dropdown list data is retrieved and bound before the dataform data is retrieved and attempted to bind?

 

eg.  I have event handler on OnSetValues as follows:

<telerik:RadDataForm RenderMode="Lightweight" runat="server" ID="RadDataForm1"
    DataKeyNames="RecordID" RenderWrapper="true"  ClientDataSourceID="RadClientDataSource1">
    <ClientSettings>
        <ClientEvents OnSetValues="dataFormSetValues" OnGetValues="dataFormGetValues" OnDataFormCreated="dataFormCreated"       />
    </ClientSettings>

 

function dataFormSetValues(sender, args) { 
 
        var dataItem = args;
 
       $telerik.findControl(document, "EditJobTypeDD").findItemByValue(dataItem.JobType).select();
 }

 

The .select() in the javascript function above will fail occasionally when the webservice for the form data returns quicker than the webservice to populate the dropdown list, because there are no items in the dropdownlist yet.

 

Is there a best practice to implement this sort of scenario correctly?

Eyup
Telerik team
 answered on 02 Jan 2020
3 answers
151 views

Hi All,

I copied the demo code for Excel-Like filtering (here) into one of my projects, but the checkboxes in the filterlist are not rendering. However, they do render in the demo app on the Telerik website.

Possible bug in my version of the controls? I'm on 2019.3.1023.45.

Thx in advance - M.

Rumen
Telerik team
 answered on 31 Dec 2019
1 answer
196 views

Hi all

I am trying to create a RadGrid where the value of the product tags are replaced by the tag name. I attached and image for the grid I want to replace the product tag column with the names instead of the values.

Eyup
Telerik team
 answered on 31 Dec 2019
2 answers
289 views

Hi there,

 

I'm trying to use RadlistBox with custom item template under RadAjaxPanel where my page is a webform which use a MasterPage file.

And I'm receiving the following error:

Server Error in '/' Application.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).] System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +9812992 Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +142 [HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.] Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +190 Telerik.Web.UI.RadAjaxControl.PerformRender() +405 Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1187 Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +75 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +270 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14 System.Web.UI.Page.Render(HtmlTextWriter writer) +30 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +67 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +101 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1342

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.3752.0

 

How can I solved it? below is my asp.net webform  declaration.

 

Looking forward to your earliest reply,

Thanks,

Hagai.

<telerik:RadAjaxPanel ID="RadAjaxPanelPublications" runat="server">
   <telerik:RadListBox ID="RadListBoxPublications" runat="server" AllowReorder="True" EnableDragAndDrop="True" SelectionMode="Multiple" Width="98%" Height="700px">      
       <ItemTemplate>           
           <div class="row">
               <div class="col-md-9">
                   <div dir="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Language == Idc.FacultySites.Models.Publication.LanguageName.Hebrew? "rtl" : "ltr" %>"
                       class="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Language == Idc.FacultySites.Models.Publication.LanguageName.Hebrew? "text-right-fix" : "text-left-fix" %>">
                       <a id="PublicationLink" runat="server">
                           <%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Text %>
                       </a>
                   </div>
               </div>
               <div class="col-md-1"> </div>
               <div class="col-md-2">
                   <div class="row">
                       <div class="col-md-2">
                           <telerik:RadButton ID="RadButtonEditPublication" runat="server" RenderMode="Lightweight" ToolTip="<%$ Resources:FacultySites, Edit%>" CommandArgument="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Id %>" OnCommand="RadButtonEditPublication_Command">
                               <ContentTemplate>
                                   <span class="glyphicon glyphicon-edit"></span>
                               </ContentTemplate>
                           </telerik:RadButton>
                       </div>
                       <div class="col-md-2">
                           <telerik:RadButton ID="RadButtonDeletePublication" runat="server" RenderMode="Lightweight" ToolTip="<%$ Resources:FacultySites, Delete%>" OnClick="RadButtonDeletePublication_Click" CommandArgument="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Id %>" OnCommand="RadButtonDeletePublication_Command">
                               <ContentTemplate>
                                   <span class="glyphicon glyphicon-remove"></span>
                               </ContentTemplate>
                               <ConfirmSettings ConfirmText="<%$ Resources:FacultySites, GeneralActionConfirmMessage%>" />
                           </telerik:RadButton>
                       </div>
                       <div class="col-md-8"> </div>
                   </div>
               </div>
           </div>
           <div class="row">
               <div class="col-md-12"> </div>
           </div>               
       </ItemTemplate>
   </telerik:RadListBox>
   </telerik:RadAjaxPanel>

 

Eyup
Telerik team
 answered on 31 Dec 2019
12 answers
316 views

Hello,

I have my grid in ajaxpanel.

With one Edit link button,

When I click on Edit button my header flicks.

Is there any way to find Linkbuttons ClientDatakey so that we can avoid post back ?

Thanks 

Ashish

Eyup
Telerik team
 answered on 31 Dec 2019
1 answer
153 views

There's an oddity when using shift and the left arrow key to select text, where it will skip the first character and then start over. This only happens when using the left arrow, and only at the last word in a line, which makes me think that there's something strange going on with how whatever this is treats the ends of lines.

Highlighting using arrow keys top to bottom and right to left seems fine. But highlighting left to right and bottom to top, seems to cut off highlighting and it doesn't highlight the text as you expect, but instead un-highlights sections you've previously highlighted. 

Reproducible here https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx 

Any help would be appreciated.

Rumen
Telerik team
 answered on 30 Dec 2019
1 answer
229 views
     Hi;

I had added the radnavigation to a masterpage. Everything works well if there is no ajax postback in pages.. When you make a ajax postback with ajaxmanagerproxy in a page, the navigation locks and can't use.. Only nodes without subitems can be clickable...
Rumen
Telerik team
 answered on 30 Dec 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?