Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
187 views

Hi,

 

Why would the following not accept the value 12.1 as valid?

 

 Dim tb As RadNumericTextBox = New RadNumericTextBox
                        plh.Controls.Add(tb)

                        tb.ID = "check_" + e.Item.DataItem("id").ToString
                        tb.Type = NumericType.Number
                        tb.NumberFormat.DecimalSeparator = "."
                     
                        Dim rv As RangeValidator = New RangeValidator
                        rv.ControlToValidate = tb.ID
                        rv.Type = ValidationDataType.Double
                        rv.MinimumValue = "12"
                        rv.MaximumValue = "13"
                        rv.ErrorMessage = "Invalid"
                        plh.Controls.Add(rv)

 

in the above the value 12.1 is not accepted as valid and should be I guess...

 

Marc

Vessy
Telerik team
 answered on 07 Oct 2019
1 answer
206 views

Hi,

Please refer to demo on this page for the dropdown of "Region"

https://demos.telerik.com/aspnet-ajax/combobox/examples/overview/defaultcs.aspx

As you type a letter or two it highlights a value and that value is displayed in the textbox of combobox. 

I have used exactly same properties but this feature is not accomplished, as a result of which on tab press, the value of combobox goes to default one.

But if I select using mouse it works that time and for other attempts going ahead. 

Please help me in this regard. Below is my code

<telerik:RadComboBox ID="ddlPrimaryPMForThisGO" runat="server" Width="115px" Filter="Contains" RenderMode="Lightweight" EmptyMessage="--Select--" MarkFirstMatch="true" EnableLoadOnDemand="true"
                              AutoPostBack="false"  ForeColor="#0067cd" CausesValidation="false"
                              autocompletemode="SuggestAppend" dropdownstyle="Dropdown">
                          </telerik:RadComboBox>

 

 

Rumen
Telerik team
 answered on 07 Oct 2019
1 answer
227 views

Hi,

I have a RadEditor and I want to get some text, I get the cursor position with getRange(), but I now need to create a range from the beginning of my text to that position.

Example text:"Hello my world!",

My cursor is after "my|", in the middle of the sentence...

so I want to return "Hello my", excluding "world!".

thanks

Rumen
Telerik team
 answered on 07 Oct 2019
5 answers
410 views
I have a grid that is empty on page load, and columns change  a few time (columns getting added from code behind, and column names get changed from code behind).  I am unable to get the columns to size to the contents.  Here is my code:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function pageLoad() {
            var grid = $find("<%= grdImportData.ClientID %>");
            var columns = grid.get_masterTableView().get_columns();
            var columnIndex = columns.length + 1;
                columns[columnIndex].resizeToFit();
            }       
    </script>
</telerik:RadCodeBlock>
<telerik:RadGrid runat="server" ID="grdImportData" RenderMode="Lightweight" AllowPaging="true" PageSize="10" OnNeedDataSource="grdImportData_NeedDataSource" OnPageIndexChanged="grdImportData_PageIndexChanged" OnUpdateCommand="grdImportData_UpdateCommand" OnDeleteCommand="grdImportData_DeleteCommand" OnItemCommand="grdImportData_ItemCommand"  OnItemDataBound="grdImportData_ItemDataBound" AllowSorting="False" AlternatingItemStyle-BackColor="#f5f5f5" ItemStyle-BackColor="#ffffff" ColumnWidth="Auto" HorizontalAlignment="Stretch" >
        <ClientSettings>
            <Scrolling AllowScroll="True" SaveScrollPosition="true" FrozenColumnsCount="1" EnableVirtualScrollPaging="true"></Scrolling>
                <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" EnableRealTimeResize="true" AllowResizeToFit="true"/>
        </ClientSettings>
    <MasterTableView EditMode="InPlace" DataKeyNames="Id">
        <Columns>
            <telerik:GridEditCommandColumn  HeaderStyle-Width="75px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"/>
            <telerik:GridTemplateColumn HeaderStyle-Width="50px">
                <ItemTemplate>
                    <asp:LinkButton runat="server" CommandName="Delete"><i class="icon s7-junk grid-edit-icon"></i></asp:LinkButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
Attila Antal
Telerik team
 answered on 04 Oct 2019
1 answer
146 views

I'm trying to set up radnavigation using a radsitemap to build a list of links in a menu.  

I'm following your demo for radnavigation and server side templates, and I'm getting the same result - a list of links with a bullet in front of each option.

I want to replace the bullet with a custom image, and I've set the node imageurl and now I have both the bullet and the custom image.

See attached image.

How do I remove the bullet and just show the imageurl?

Thanks

                <telerik:NavigationNode Text="Reports" ID="Reports">
                    <ContentTemplate>
                        <div class="column">
                            <h5>MESSAGE ACTIVITY REPORTS</h5>
                            <telerik:RadSiteMap runat="server" ID="RadSiteMap6">
                                <Nodes>
                                    <telerik:RadSiteMapNode Level="0" ImageUrl="images/arrow.png" Text="TOTAL RESULTS SUMMARY" NavigateUrl="~/reports_totalresults.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="DETAILED REPORT" NavigateUrl="~/reports_detailpernumber2.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="USER ACTIVITY" NavigateUrl="~/useractivity.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="TOTAL RESULTS SUMMARY" NavigateUrl="~/reports_totalresults.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="DETAILED REPORT" NavigateUrl="~/reports_detailpernumber2.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="USER ACTIVITY" NavigateUrl="~/useractivity.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="SMS AUTO" NavigateUrl="~/report_smsautoresponder.aspx" />
                               </Nodes>
                            </telerik:RadSiteMap>
                        </div>
                        <div class="column">
                            <h5>PORTAL REPORTS</h5>
                            <telerik:RadSiteMap ID="RadSiteMap1" runat="server">
                                <Nodes>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="EMAIL COLLECTION" NavigateUrl="~/report_emailcollection2.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="SURVEY REPORT" NavigateUrl="~/report_survey.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="APPOINTMENT SCHEDULING" NavigateUrl="~/report_appointments3.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="APPOINTMETN STATISTICS" Visible="False" ID="report_appointmentsSummary" NavigateUrl="~/report_appointmentsSummary.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="REGISTERED CUSTOMERS" NavigateUrl="~/report_ServiceDetails.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="OVERDUE REPORT" NavigateUrl="~/report_overdue.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="UPDATED RECORDS" NavigateUrl="~/report_UpdateRecords.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="CLICK REPORT" NavigateUrl="~/report_redir.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="SEARCH PINS" NavigateUrl="~/report_pins.aspx"></telerik:RadSiteMapNode>
                                <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="SMS ACTIVITY" NavigateUrl="~/reports_smsdetail.aspx" />
                                </Nodes> 
                                </telerik:RadSiteMap>
                        </div>
                        <div class="column">
                            <h5>ROI REPORTS</h5>
                            <telerik:RadSiteMap ID="RadSiteMap2" runat="server">
                                <Nodes>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="ROI REPORT" NavigateUrl="~/report_roi2.aspx" />
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="CONQUEST REPORT" NavigateUrl="~/report_ph.aspx"></telerik:RadSiteMapNode>
                                    <telerik:RadSiteMapNode ImageUrl="images/arrow.png" Text="SUCCESS REPORT" NavigateUrl="~/report_success.aspx"></telerik:RadSiteMapNode>
                                </Nodes> 
                                </telerik:RadSiteMap>
                        </div>
                        <div class="column">
                            <div id="qr" style="display:inline-block;width:75px;height:75px;align:center;vertical-align:middle;" >
                                <img src="images/placeholder.png" style="height:75px;width:75px;">
                            </div>
                            <div style="display:inline-block;vertical-align:middle;">
                                <h5>TOTAL RESULTS SUMMARY</h5>
                            </div>
                            <div style="width:400px;overflow-wrap:break-word;">
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod<br />
                                tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, <br />
                                quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo <br />
                                consequat. 
                                <br /><br />
                                Duis aute irure dolor in reprehenderit in voluptate velit esse <br />
                                cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non <br/>
                                proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br />
                            </div>
                        </div>
                    </ContentTemplate>
                </telerik:NavigationNode>

Bill
Top achievements
Rank 1
 answered on 04 Oct 2019
2 answers
253 views

I have a RadGrid in a user control on a webpage

 

1. The radgrid has one template GridHyperLinkColumn and many other columns loaded from the datatable.

2. The grid loads successfully from a Datatable with the template column.

3. I have a Checkbox column and it shows well.

4. Button click calls MarkSelectedInvalid()

** It never gets inside the For Loop as the RadGrid1.MasterTableView.Items is zero.  I have enabledviewstate on page, and in HTML Mark up for RadGrid.

 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="false" AllowMultiRowEdit = "true"
        SortingSettings-SortedBackColor="#999999" OnPreRender="RadGrid1_PreRender"
        CellSpacing="-1" GridLines="Both" Font-Size="xx-Small"
        EnableViewState="true" ViewStateMode="Enabled">
        <GroupingSettings CollapseAllTooltip="Collapse all groups" />
        <SortingSettings SortedBackColor="153, 153, 153" />
        <MasterTableView EditMode="InPlace" EnableColumnsViewState="true"
            EnableViewState="true">
            <RowIndicatorColumn Visible="False">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Created="True">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="Path" DataTextField="Path"
                    FilterControlAltText="Filter Path column" HeaderText="Path"
                    SortExpression="Path" Target="_blank" UniqueName="Path1">
                </telerik:GridHyperLinkColumn>
            </Columns>
        </MasterTableView>
        </telerik:RadGrid>

 

 

Code:  

private void MarkSelectedItemsInvalid()
       {
           foreach (GridDataItem item in this.RadGrid1.MasterTableView.Items)
           {
               TableCell cell = item["MarkInvalid"];
               CheckBox checkBox = (CheckBox)cell.Controls[0];
               if (checkBox.Checked)
               {
                   string path = (item["Path"].FindControl("TB_Path") as TextBox).Text;
                   string title = (item["Title"].FindControl("TB_Title") as TextBox).Text;
                   item.Enabled = false;
                   var dictionary = new Dictionary<string, string>();
                   dictionary.Add("ContentTypeId", GetContentTypeID(qsURLSite, GetLibraryFromURL(path), "Invalid"));
                   UpdateMetaData(path,GetLibraryFromURL(path), dictionary);
               }
           }
       }
Roger
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 04 Oct 2019
1 answer
295 views

Hi Guys

I have a radgrid, with multiple columns. Four of them, have the same content, is there a way that using the first column filter, the other with the same content?

Thanks in advance.

Example 

Column A      Column B      Column C      Column D
Spain            Spain             Poland           Italy
France          Germany        France           Denmark
Italy               USA               Germany       Spain

Using Column A filter = Spain

Column A      Column B      Column C      Column D
Spain            Spain             Poland           Italy
Italy               USA               Germany       Spain

Eyup
Telerik team
 answered on 04 Oct 2019
1 answer
337 views
Is there any facility in this family of products that can be used to view a .epub file?  I would need to have a display for the user and to know the current page he or she is viewing, so I can store it and return when the user loads the book again.
Attila Antal
Telerik team
 answered on 03 Oct 2019
3 answers
242 views
Hi
I have implemented a multicolumn combobox  [same way as in demo] which loads items on demand by calling a webservice.
I need to show a formatted tooltip for each combo item. I tried adding a rad tooltip in the item template,
but the tooltip is not getting generated. I am not sure if I am missing anything. I highly appreciate if anybody could provide a code sample by adding tooltip to multicolumn combobox.

Thanks
VInay
Rumen
Telerik team
 answered on 03 Oct 2019
1 answer
873 views

Hi 

I have a problem with radgrid in batch edit mode. I am trying to find out how I can get all values from all columns/rows when saving. I have not bound this grid to a simple datasource. Based on all data from the grid I need to create and populate a new class and send it to the server (via other functions). So I need to get all values from the grid so I can build and populate the correct class (datatable). My grid consist of both normal editable fields, read-only fields and radcombo boxes. Based on the value in my combobox I make columns read-only or not. I am trying to achive a mass update of a list<class>.

I need to find all values in code-behind! I can find the new values for updated editable fields this example

foreach (GridBatchEditingCommand command in e.Commands)
            {
                if ((command.Type == GridBatchEditingCommandType.Update))
                {
                    Hashtable newValues = command.NewValues;
                    Hashtable oldValues = command.OldValues;

 

But I can not find out how I can get:

1. selected value from radcombobox (datasource for this combo is build on-click).

2. value from read-only columns in the grid.

<%@ Page Title="Mass update of requisition lines/Parts" Language="C#" MasterPageFile="~/SunFlower.Master" AutoEventWireup="true" CodeBehind="RequisitionLineMassUpdate.aspx.cs" Inherits="SunflowerWeb.RequisitionLineMassUpdate" %>
 
<%@ Register Assembly="Sunflower.Web.Controls" Namespace="Sunflower.Web.Controls" TagPrefix="sunflower" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ID="MassUpdateContent" ContentPlaceHolderID="mcph"  runat="server">
     
   <telerik:RadAjaxManagerProxy ID="ManagerProxy" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="MasterAjaxManger">
                <UpdatedControls>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridMassUpdate">
                <UpdatedControls>
                </UpdatedControls>
            </telerik:AjaxSetting>
 
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
 
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            var ReqLineFunctions = new Array();
 
            function saveAll() {
                var grid1 = $find("<%=gridMassUpdate.ClientID%>");
                var batchManager1 = grid1.get_batchEditingManager();
                var hasChanges = batchManager1.hasChanges(grid1.get_masterTableView());
                if (hasChanges) {
                    batchManager1.saveTableChanges([grid1.get_masterTableView()]);
                } else {
                    var ajaxPanel = $find("<%=RadAjaxPanel1.ClientID%>");
                    ajaxPanel.ajaxRequest("saveChanges");
                }
            }
 
            function GetSelectedFunction(sender, args) {
                var batchManager = sender.get_batchEditingManager();
                var masterTable = sender.get_masterTableView();
                masterTable.get_dataItems();
                var dataItem = $find(args.get_row().id);
                var combo = dataItem.findControl("cbFunction");
                var comboValue = combo.get_selectedItem().get_value();
                return comboValue;            
            }
 
            function GetReqLineId(sender, args) {
                var batchManager = sender.get_batchEditingManager();
                var masterTable = sender.get_masterTableView();
                masterTable.get_dataItems();
                var dataItem = $find(args.get_row().id);
                var reqLineId = dataItem.findElement("lblReqLineId");
                var reqLineIdValue = reqLineId.innerText;
                return reqLineIdValue;            
            }
 
            function batchEditOpening(sender, args) {
 
                var selectedFunc = GetSelectedFunction(sender, args);
                var reqLineId = GetReqLineId(sender, args);
 
                if (selectedFunc !== null && reqLineId !== null) {
                    if (ReqLineFunctions.length > 0) {
                        //Is partnumber updatable
                        for (let i = 0; i < ReqLineFunctions.length; i++) {
                            if (ReqLineFunctions[i].ReqLineId === reqLineId) {
                                var funcs = ReqLineFunctions[i].Functions;
 
                                for (let k = 0;k < funcs.length; k++) {
                                    if (funcs[k].FunctionName === selectedFunc) {
                                        if (!funcs[k].IsPartUpdatable) {
                                            args.set_cancel(true);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
 
            function SelectFunction(sender, eventArgs) {
                //todo: populate the rest of the columns based on the selected function
           
            }
 
            function GetFunctions(sender, args) {
                var text = args._text;
                itemsRequesting(sender, args);
 
                //Dummy collection of functions. todo: replace with functions from api-call
                var funcs = new Array();
                funcs.push({
                     FunctionName: "SuppToTecOk",
                     FunctionDescription : "Receive from supplier",  
                     IsPartUpdatable : true
                  });
 
                funcs.push({
                     FunctionName: "TecOkToCust",
                     FunctionDescription : "Deliver to customer",  
                     IsPartUpdatable : false
                  });
 
                //add to global array so i can lookup and find values later
                var reqlineid = sender.get_attributes().getAttribute("data-reqlineid");
                if (reqlineid !== null) {
                    ReqLineFunctions.push({
                        ReqLineId: reqlineid,
                        Functions: funcs
                    })
                }
 
                FillCombo(sender, funcs);
                sender.highlightAllMatches(sender.get_text());
            }
 
            // This cancels the default RadComboBox behavior
            function itemsRequesting(sender, args) {
                if (args.set_cancel != null) {
                    args.set_cancel(true);
                }
                if (sender.get_emptyMessage() == sender.get_text())
                    sender.set_text("");
            }
 
            function FillCombo(combo, functions) {
                combo.clearItems();
                combo.trackChanges();
                for (var i = 0; i < functions.length; i++) {
                    var comboItem = new Telerik.Web.UI.RadComboBoxItem();
                    comboItem.set_text(functions[i].FunctionDescription);
                    comboItem.set_value(functions[i].FunctionName);
                    combo.get_items().add(comboItem);
                }
            }
 
        </script>
    </telerik:RadCodeBlock>
 
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" OnAjaxRequest="RadAjaxPanel1_AjaxRequest">
        <h1>Mass update parts</h1>
        <h4><asp:Label ID="litTip" runat="server" Text=""></asp:Label></h4>
 
        <div class="buttonFormBorderXL">
            <div class="fltlft buttons tools">
                <telerik:RadButton runat="server" ID="RadButton1" AutoPostBack="false" Text="Save all"  OnClientClicked="saveAll"></telerik:RadButton>
            </div>
        </div>
        <div class="box fltlft formXL clft">
            <img src="fwimages/form_curve01.gif" class="curve01" alt="" />
            <img src="fwimages/form_curve02.gif" class="curve02" alt="" />
            <br />
 
            <div class="simpleList">
                <telerik:RadGrid ID="gridMassUpdate" renderMode="Lightweight" runat="server" OnNeedDataSource="gridMassUpdate_NeedDataSource" AllowAutomaticInserts="True" 
                        AllowPaging="false" AutoGenerateColumns="False" Skin="SunflowerSkin" EnableEmbeddedSkins="False"
                        OnBatchEditCommand="gridMassUpdate_BatchEditCommand" CellSpacing ="0" GridLines="None" Height="680px">
                <ClientSettings>
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
                     
                <AlternatingItemStyle Font-Size="8pt" />
                <MasterTableView EditMode="Batch" PageSize="50" CommandItemDisplay="None" AllowPaging="false" DataKeyNames="SearchResultRowId" AutoGenerateColumns="false">
                    <BatchEditingSettings EditType="Cell"/>
                    <Columns>
                        <telerik:GridTemplateColumn Visible="true" ReadOnly="true" UniqueName="SearchResultRowId"  DataField="SearchResultRowId" HeaderText="id">
                            <ItemTemplate>
                                <telerik:RadLabel ID="lblReqLineId" runat="server" Text='<%# Eval("SearchResultRowId")%>'></telerik:RadLabel>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                         
                        <telerik:GridNumericColumn Visible="true" ReadOnly="true" DataField="RequisitionNumber" HeaderText="Requisition" AllowFiltering="false">
                        </telerik:GridNumericColumn>
 
                        <telerik:GridTemplateColumn DataField="PartNumber"  HeaderText="Part" UniqueName="PartNumber">
                            <ItemTemplate>
                                <telerik:RadLabel ID="lblPartNumber" runat="server" Text='<%# Eval("PartNumber")%>'></telerik:RadLabel>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="txtPartNumber" runat="server" Text='<%# Eval("PartNumber")%>'></telerik:RadTextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridBoundColumn DataField="PartDescription" ReadOnly="true" HeaderText="Description" UniqueName="PartDescription">
                        </telerik:GridBoundColumn>
 
                         <telerik:GridTemplateColumn HeaderText="Function" UniqueName="SelectedFunction">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cbFunction" RenderMode="Lightweight" runat="server" EnableLoadOnDemand="true" EmptyMessage="Select"
                                    data-reqlineid='<%# Eval("SearchResultRowId")%>' OnClientItemsRequesting="GetFunctions" OnClientSelectedIndexChanged="SelectFunction" Text="Select">
                                </telerik:RadComboBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
 
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <ClientEvents OnBatchEditOpening="batchEditOpening" />
                </ClientSettings>
                <ItemStyle Font-Size="8pt" />
            </telerik:RadGrid>
        </div>
    </div>
    </telerik:RadAjaxPanel>
</asp:Content>

 

and code-behind:

using Sunflower.Web.Controls;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace SunflowerWeb
{
    public partial class RequisitionLineMassUpdate : System.Web.UI.Page
    {
        private bool saveChanges = false;
 
        private List<Sunflower.Business.RequisitionLineMassUpdate> ReqLines
        {
            get
            {
                return (List<Sunflower.Business.RequisitionLineMassUpdate>)Session["ReqLines" + MassUpdateId];
            }
        }
 
        public string MassUpdateId
        {
            get
            {
                return (string)ViewState["MassUpdateId"];
            }
            set
            {
                ViewState["MassUpdateId"] = value;
            }
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["MassUpdateId"] == null && string.IsNullOrEmpty(MassUpdateId))
                    MassUpdateId = Guid.NewGuid().ToString();
                else if (Request.QueryString["MassUpdateId"] != null)
                    MassUpdateId = Request.QueryString["MassUpdateId"];
            }
 
        }
 
        protected void gridMassUpdate_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
        {
            saveChanges = true;
 
            //Trying to read all items....do not work!
            foreach (GridDataItem item in gridMassUpdate.Items)
            {
                string func = item.Cells[4].Text;  //radcombo
                string part = item.Cells[2].Text;  //radtexbox
            }
 
            foreach (GridBatchEditingCommand command in e.Commands)
            {
                if ((command.Type == GridBatchEditingCommandType.Update))
                {
                    Hashtable newValues = command.NewValues;
                    Hashtable oldValues = command.OldValues;
 
                    try
                    {
                        string combinedId = newValues["SearchResultRowId"].ToString();
                        string partNumber = newValues["PartNumber"].ToString();
 
                        //NONONO. Not possible to get value from radcombobox. Why ?
                        string function = newValues["SelectedFunction"].ToString();
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
        }
 
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (saveChanges)
            {
                //Save the values from the other controls
            }
        }
 
        protected void RadAjaxPanel1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "saveChanges")
            {
                saveChanges = true;
            }
        }
 
        protected void gridMassUpdate_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (ReqLines.Count > 0)
            {
                gridMassUpdate.DataSource = ReqLines;
            }
        }
 
    }
}

 

Is it possible to get all values from an updated radgrid in batch mode ????

 

Best regards

Lars

 

 

 

 

 

 

Eyup
Telerik team
 answered on 03 Oct 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?