Radgrid template column paging get all data

2 posts, 0 answers
  1. dahan
    dahan avatar
    3 posts
    Member since:
    Jun 2020

    Posted 15 Jun 2020 Link to this post

    Hi,
    I am using the textbox, RadNumericTextBox and RadAutoCompleteBox inside the grid to receive the values and store them in the DB. However, when a lot of data needs to be input, the speed of binding becomes slower, so virtualization and paging are performed. So, there is a problem of turning the loop to get the data of the grid and not getting the entire data.

    RadGridItems.AllowPaging = false; RadGridItems.Rebind(); I need to get the data entered in needdatasource at the time, but I don't know how to get it. Please tell me how to get all the data entered on the paged grid. Please help me its urgent issue.please refer code below.

    <telerik:RadGrid ID="RadGridItems" runat="server" AllowMultiRowSelection="true" ShowFooter="true" RenderMode="Lightweight" 
                    OnItemDataBound="RadGridItems_ItemDataBound" OnRowDrop="RadGridItems_RowDrop" AutoGenerateColumns="false" AllowAutomaticDeletes="true" 
                     OnPageIndexChanged="RadGridItems_PageIndexChanged" 
                    ShowStatusBar="false" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="true" CssClass="brd_list2" PagerStyle-CssClass="brd_pager2" Width="1920">
    <MasterTableView EnableHeaderContextMenu="false" NoMasterRecordsText="" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" AlternatingItemStyle-Wrap="false">
                        <ColumnGroups>
                            <telerik:GridColumnGroup HeaderText="예상매입처" Name="Buy"></telerik:GridColumnGroup>
                            <telerik:GridColumnGroup HeaderText="예상운반비" Name="Trans"></telerik:GridColumnGroup>
        </ColumnGroups>
    <Columns>
    <telerik:GridClientSelectColumn UniqueName="chkline" HeaderStyle-Width="30" ItemStyle-CssClass="col_ct"></telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="Sequence" HeaderText="번호" Visible="false" HeaderStyle-Width="40px" ItemStyle-CssClass="col_ct"></telerik:GridBoundColumn>

                            <telerik:GridTemplateColumn HeaderText="품목코드" HeaderStyle-Width="100" ItemStyle-CssClass="col_ct" >
    <ItemTemplate>
                                    <telerik:RadTextBox ID="ItemCode" runat="server" Enabled="false" Text='<%# DataBinder.Eval(Container.DataItem, "ItemCode")%>' Skin="Windows7"></telerik:RadTextBox>
    </ItemTemplate>
    </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="ItemName" UniqueName="ItemName" Display="false" HeaderText="품목명"></telerik:GridBoundColumn> 
                                                          
    <telerik:GridTemplateColumn HeaderText="수종" HeaderStyle-Width="140">
    <ItemTemplate>
    <telerik:RadAutoCompleteBox ID="TreeCode" runat="server" OnClientTextChanged="TreeCode_TextChanged" DropDownPosition="Automatic" DropDownWidth="250" DataSourceID="TreeSpecies" 
                                        DataValueField="ItemCode" DataTextField="TreeName" InputType="Text" Skin="Windows7" OnDataSourceSelect="TreeCode_DataSourceSelect">
    <DropDownItemTemplate>
    <table>
    <tr>                                                 
    <th><%# DataBinder.Eval(Container.DataItem, "TreeName")%></th>                                                                                               
                                                    <th>,&nbsp;</th>
                                                    <th><%# DataBinder.Eval(Container.DataItem, "Description")%></th>
    </tr>
    </table>
    </DropDownItemTemplate>
    <TextSettings SelectionMode="Single" />                                  
    </telerik:RadAutoCompleteBox>
    </ItemTemplate>
    </telerik:GridTemplateColumn>
                         
                            <telerik:GridTemplateColumn HeaderText="규격" HeaderStyle-Width="120" ItemStyle-CssClass="col_ct">
    <ItemTemplate>
    <telerik:RadTextBox ID="Description" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>' Width="130" Skin="Windows7"></telerik:RadTextBox>
    </ItemTemplate>
    </telerik:GridTemplateColumn>                                                         

    <telerik:GridTemplateColumn UniqueName="Quantity" HeaderText="수량" HeaderStyle-Width="80" ItemStyle-CssClass="col_rg" FooterStyle-CssClass="col_rg">
    <ItemTemplate>
    <telerik:RadNumericTextBox ID="Quantity" EmptyMessage="0" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" DbValueFactor="1" LabelWidth="64px" Enabled="true"
    DbValue='<%# Bind("Quantity") %>' MaxValue="7.0368744177664E+15" MinValue="-7.0368744177664E+15" Width="115px" Height="19px" DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
                                        <ClientEvents OnValueChanged="CalculateSupplyAmount" />
    </telerik:RadNumericTextBox>
    </ItemTemplate>
                                <FooterTemplate>
    <telerik:RadNumericTextBox ID="SumQuantity" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" Width="100px" Height="19px" LabelWidth="64px"
    DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
    </telerik:RadNumericTextBox>
    </FooterTemplate>
    </telerik:GridTemplateColumn>                                                                     
                            <telerik:GridTemplateColumn UniqueName="UnitPrice" HeaderText="매출단가" HeaderStyle-Width="6%" ItemStyle-CssClass="col_rg align_txt_src" FooterStyle-CssClass="col_rg">
    <ItemTemplate>
                                   
                                    <telerik:RadNumericTextBox ID="UnitPrice" EmptyMessage="0" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" DbValueFactor="1" LabelWidth="24px" Enabled="true"
        DbValue='<%# Bind("UnitPrice") %>' MaxValue="7.0368744177664E+15" MinValue="-7.0368744177664E+15" Height="19px" DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
        <NegativeStyle Resize="None"></NegativeStyle>
        <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
        <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
        <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
        <FocusedStyle Resize="None"></FocusedStyle>
        <DisabledStyle Resize="None"></DisabledStyle>
        <InvalidStyle Resize="None"></InvalidStyle>
        <HoveredStyle Resize="None"></HoveredStyle>
        <EnabledStyle Resize="None"></EnabledStyle>
                                        <ClientEvents OnValueChanged="CalculateSupplyAmount" />
        </telerik:RadNumericTextBox> 
                                    <telerik:RadButton ID="btnUnitPrice" AutoPostBack="true" OnClick="btnUnitPrice_Click" runat="server" Text="Search" Skin="" CssClass="btn_src"></telerik:RadButton>
                                                                                                                                                      
        </ItemTemplate>
    </telerik:GridTemplateColumn>

                            <telerik:GridTemplateColumn UniqueName="UnitPriceButton" Display="false" HeaderStyle-Width="50">
    <ItemTemplate>
                                    <span class="telerik_bx inp_btn">
                                        <telerik:RadButton ID="btnUnitPrice2" AutoPostBack="true" OnClick="btnUnitPrice_Click" runat="server" Text="Search" Skin="" CssClass="btn_src"></telerik:RadButton>
                                    </span>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

    <telerik:GridTemplateColumn UniqueName="SupplyAmount" HeaderText="매출액" HeaderStyle-Width="110" ItemStyle-CssClass="col_rg" FooterStyle-CssClass="col_rg">
    <ItemTemplate>
    <telerik:RadNumericTextBox ID="SupplyAmount" EmptyMessage="0" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" DbValueFactor="1" LabelWidth="64px" 
    DbValue='<%# Bind("SupplyAmount") %>' MaxValue="7.0368744177664E+15" MinValue="-7.0368744177664E+15" Width="115px" Height="19px" DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
    </telerik:RadNumericTextBox>
    </ItemTemplate>
    <FooterTemplate>
    <telerik:RadNumericTextBox ID="SumSupplyAmount" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" Width="120" Height="19px" LabelWidth="64px"
    DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
    </telerik:RadNumericTextBox>
    </FooterTemplate>
    </telerik:GridTemplateColumn>
                           
                            <telerik:GridTemplateColumn HeaderText="코드" ColumnGroupName="Buy" HeaderStyle-Width="60px" ItemStyle-CssClass="col_ct" >
    <ItemTemplate>
                                    <telerik:RadTextBox ID="VendorCode" runat="server" ClientEvents-OnValueChanged="VendorCode_TextChanged" Text='<%# DataBinder.Eval(Container.DataItem, "VendorCode")%>' Skin="Windows7"></telerik:RadTextBox>
    </ItemTemplate>
    </telerik:GridTemplateColumn>
                            
    <telerik:GridTemplateColumn HeaderText="명칭" ColumnGroupName="Buy"  HeaderStyle-Width="190px" ItemStyle-CssClass="col_lf" >
    <ItemTemplate>
    <telerik:RadAutoCompleteBox ID="VendorName" runat="server" OnClientTextChanged="VendorName_TextChanged" DataSourceID="Vendor" DataTextField="VendorName" DataValueField="VendorCode" InputType="Text" Skin="Windows7" OnDataSourceSelect="VendorName_DataSourceSelect">
    <DropDownItemTemplate>
    <table>
    <tr>
    <th><%# DataBinder.Eval(Container.DataItem, "VendorCode")%></th>
    <th><%# DataBinder.Eval(Container.DataItem, "VendorName")%></th>
    </tr>
    </table>
    </DropDownItemTemplate>
    <TextSettings SelectionMode="Single" />
    </telerik:RadAutoCompleteBox>
    </ItemTemplate>
    </telerik:GridTemplateColumn>                   
                            <telerik:GridBoundColumn DataField="VendorCode" UniqueName="DisVendorCode" Display="false"></telerik:GridBoundColumn>
                            
                            <telerik:GridTemplateColumn HeaderText="매입단가" HeaderStyle-Width="6%" ItemStyle-CssClass="col_rg align_txt_src" FooterStyle-CssClass="col_rg">
    <ItemTemplate>       
                                                       
        <telerik:RadNumericTextBox ID="UnitCost2" EmptyMessage="0" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" DbValueFactor="1" LabelWidth="64px" Enabled="true"
        DbValue='<%# Bind("UnitCost") %>' MaxValue="7.0368744177664E+15" MinValue="-7.0368744177664E+15" Height="19px" DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
        <NegativeStyle Resize="None"></NegativeStyle>
        <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
        <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
        <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
        <FocusedStyle Resize="None"></FocusedStyle>
        <DisabledStyle Resize="None"></DisabledStyle>
        <InvalidStyle Resize="None"></InvalidStyle>
        <HoveredStyle Resize="None"></HoveredStyle>
        <EnabledStyle Resize="None"></EnabledStyle>
                                        <ClientEvents OnValueChanged="CalculateCost" />
        </telerik:RadNumericTextBox>
                                    
                                    <telerik:RadButton ID="btnUnitCost" AutoPostBack="true" OnClick="btnUnitCost_Click" runat="server" Text="Search" Skin="" CssClass="btn_src"></telerik:RadButton>
                                                            
        </ItemTemplate>
    </telerik:GridTemplateColumn>
                         
    <telerik:GridTemplateColumn HeaderText="매입액" HeaderStyle-Width="110" ItemStyle-CssClass="col_rg" FooterStyle-CssClass="col_rg">
    <ItemTemplate>
    <telerik:RadNumericTextBox ID="CostAmount" EmptyMessage="0" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" DbValueFactor="1" LabelWidth="64px" Enabled="true"
    DbValue='<%# Bind("Cost") %>' MaxValue="7.0368744177664E+15" MinValue="-7.0368744177664E+15" Width="115px" Height="19px" DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
    </telerik:RadNumericTextBox>
    </ItemTemplate>
    <FooterTemplate>
    <telerik:RadNumericTextBox ID="SumCost" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" Width="120" Height="19px" LabelWidth="64px" Enabled="true"
    DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
    </telerik:RadNumericTextBox>
    </FooterTemplate>
    </telerik:GridTemplateColumn>

                            <telerik:GridBoundColumn DataField="FromLocationCode" UniqueName="DisFromLocationCode" Display="false"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ToLocationCode" UniqueName="DisToLocationCode" Display="false"></telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="출도착" ColumnGroupName="Trans" HeaderStyle-Width="270" ItemStyle-CssClass="col_ct align_txt_src">
    <ItemTemplate>
                                    <telerik:RadAutoCompleteBox ID="FromLocation" runat="server" DataSourceID="FromLocationCode" DataTextField="FromLocationName" DataValueField="FromLocationCode" InputType="Text" Skin="Windows7" OnDataSourceSelect="FromLocation_DataSourceSelect">
    <DropDownItemTemplate>
    <table>
    <tr>
    <th><%# DataBinder.Eval(Container.DataItem, "FromLocationCode")%></th>
    <th><%# DataBinder.Eval(Container.DataItem, "FromLocationName")%></th>
    </tr>
    </table>
    </DropDownItemTemplate>
    <TextSettings SelectionMode="Single" />
    </telerik:RadAutoCompleteBox>
                                    <telerik:RadAutoCompleteBox ID="ToLocation" runat="server" DataSourceID="ToLocationCode" DataTextField="ToLocationName" DataValueField="ToLocationCode" InputType="Text" Skin="Windows7" OnDataSourceSelect="ToLocation_DataSourceSelect">
    <DropDownItemTemplate>
    <table>
    <tr>
    <th><%# DataBinder.Eval(Container.DataItem, "ToLocationCode")%></th>
    <th><%# DataBinder.Eval(Container.DataItem, "ToLocationName")%></th>
    </tr>
    </table>
    </DropDownItemTemplate>
    <TextSettings SelectionMode="Single" />
    </telerik:RadAutoCompleteBox>
                                    
                                    <telerik:RadButton ID="btnTransPort" AutoPostBack="true" OnClick="btnTransPort_Click" runat="server" Text="Search" Skin="" CssClass="btn_src"></telerik:RadButton>
                                                     
    </ItemTemplate>       
    </telerik:GridTemplateColumn>
                           
                            <telerik:GridTemplateColumn HeaderText="금액" ColumnGroupName="Trans" HeaderStyle-Width="90" ItemStyle-CssClass="col_rg" FooterStyle-CssClass="col_rg">
    <ItemTemplate>
    <telerik:RadNumericTextBox ID="DeliveryCost" Runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" DbValueFactor="1" LabelWidth="64px" 
    DbValue='<%# Bind("DeliveryCost") %>' MaxValue="7.0368744177664E+15" MinValue="-7.0368744177664E+15" Width="120px" Height="19px" DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="NotSet" FocusedStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
                                        <ClientEvents OnValueChanged="CalculateSumDeliveryCost" />
    </telerik:RadNumericTextBox>
    </ItemTemplate>
    <FooterTemplate>
    <telerik:RadNumericTextBox ID="SumDeliveryCost" runat="server" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" Culture="ko-KR" Width="80" Height="19px" LabelWidth="64px"
    DisabledStyle-HorizontalAlign="Right" EmptyMessageStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" FocusedStyle-HorizontalAlign="Right" HoveredStyle-HorizontalAlign="Right" InvalidStyle-HorizontalAlign="Right" NegativeStyle-HorizontalAlign="Right" ReadOnlyStyle-HorizontalAlign="Right">
    <NegativeStyle Resize="None"></NegativeStyle>
    <NumberFormat ZeroPattern="n" DecimalDigits="0"></NumberFormat>
    <EmptyMessageStyle Resize="None"></EmptyMessageStyle>
    <ReadOnlyStyle Resize="None"></ReadOnlyStyle>
    <FocusedStyle Resize="None"></FocusedStyle>
    <DisabledStyle Resize="None"></DisabledStyle>
    <InvalidStyle Resize="None"></InvalidStyle>
    <HoveredStyle Resize="None"></HoveredStyle>
    <EnabledStyle Resize="None"></EnabledStyle>
    </telerik:RadNumericTextBox>
    </FooterTemplate>
    </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="인도조건" ColumnGroupName="Trans" Visible="false" HeaderStyle-Width="80" ItemStyle-CssClass="col_ct">
    <ItemTemplate>
    <telerik:RadComboBox ID="TermsCode" runat="server" Skin="" Width="100%" DataSourceID="TermsOfDelivery"  
                                         SelectedValue='<%# DataBinder.Eval(Container.DataItem, "TermsCode") %>' DataTextField="TermsName" DataValueField="TermsCode"></telerik:RadComboBox>
    </ItemTemplate>       
    </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn HeaderText="비고" HeaderStyle-Width="130" ItemStyle-CssClass="col_ct">
    <ItemTemplate>
    <telerik:RadTextBox ID="Memo1" AutoCompleteType="BusinessCity" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Memo1")%>' Width="150" Skin="Windows7"></telerik:RadTextBox>
    </ItemTemplate>
    </telerik:GridTemplateColumn>                            
    </Columns>
    </MasterTableView>
    <ClientSettings AllowRowsDragDrop="true" EnablePostBackOnRowClick="false">
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="false" ScrollHeight="350px" />
    <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"/>
                        <Virtualization EnableVirtualization="true" RetrievedItemsPerRequest="20" InitiallyCachedItemsCount="20" ItemsPerView="20"
                        LoadingPanelID="RadAjaxLoadingPanel1"  EnableCurrentPageScrollOnly="false"/>
    </ClientSettings>
    </telerik:RadGrid>

    RadGridItems.AllowPaging = false;
            RadGridItems.Rebind();
        
            foreach (GridDataItem dataItem in RadGridItems.Items)
            {
                DataRow workRow = dtable.NewRow();

                if (!string.IsNullOrEmpty((dataItem.FindControl("TreeCode") as RadAutoCompleteBox).Text)) 
                {
                    workRow["Sequence"] = dataItem.ItemIndex;

                    string treeName = (dataItem.FindControl("TreeCode") as RadAutoCompleteBox).Entries[0].Text.Trim();
                    string itemCode = (dataItem.FindControl("ItemCode") as RadTextBox).Text.Trim();

                    if (!string.IsNullOrEmpty(itemCode))
                    {
                        workRow["ItemCode"] = itemCode;
                        workRow["TreeCode"] = utility.getTreeCodeByItemCode(itemCode);
                    }
                    else
                    {
                        workRow["ItemCode"] = string.Empty;
                        workRow["TreeCode"] = string.Empty;
                    }

                    workRow["TreeName"] = treeName;
                    workRow["ItemName"] = treeName;
                                   
                    workRow["Description"] = (dataItem.FindControl("Description") as RadTextBox).Text;
                    workRow["Quantity"] = entry.ConvertStringToDecimal((dataItem.FindControl("Quantity") as RadNumericTextBox).Text.ToString());
                    workRow["UnitPrice"] = entry.ConvertStringToDecimal((dataItem.FindControl("UnitPrice") as RadNumericTextBox).Text.ToString());
                    workRow["SupplyAmount"] = entry.ConvertStringToDecimal((dataItem.FindControl("SupplyAmount") as RadNumericTextBox).Text.ToString());

                    if (!string.IsNullOrEmpty((dataItem.FindControl("VendorName") as RadAutoCompleteBox).Text))
                    {
                        workRow["VendorCode"] = (dataItem.FindControl("VendorName") as RadAutoCompleteBox).Entries[0].Value;
                        workRow["VendorName"] = (dataItem.FindControl("VendorName") as RadAutoCompleteBox).Entries[0].Text;
                    }
                    else
                    {
                        workRow["VendorCode"] = string.Empty;
                        workRow["VendorName"] = string.Empty;
                    }

                    workRow["UnitCost"] = entry.ConvertStringToDecimal((dataItem.FindControl("UnitCost2") as RadNumericTextBox).Text.ToString());
                    workRow["Cost"] = entry.ConvertStringToDecimal((dataItem.FindControl("CostAmount") as RadNumericTextBox).Text.ToString());

                    if (!string.IsNullOrEmpty((dataItem.FindControl("FromLocation") as RadAutoCompleteBox).Text))
                    {
                        workRow["FromLocationCode"] = (dataItem.FindControl("FromLocation") as RadAutoCompleteBox).Entries[0].Value;
                        workRow["FromLocationName"] = (dataItem.FindControl("FromLocation") as RadAutoCompleteBox).Entries[0].Text;
                    }
                    else
                    {
                        workRow["FromLocationCode"] = string.Empty;
                        workRow["FromLocationName"] = string.Empty;    
                    }
                    if (!string.IsNullOrEmpty((dataItem.FindControl("ToLocation") as RadAutoCompleteBox).Text))
                    {
                        workRow["ToLocationCode"] = (dataItem.FindControl("ToLocation") as RadAutoCompleteBox).Entries[0].Value;
                        workRow["ToLocationName"] = (dataItem.FindControl("ToLocation") as RadAutoCompleteBox).Entries[0].Text;
                    }
                    else
                    {
                        workRow["ToLocationCode"] = string.Empty;
                        workRow["ToLocationName"] = string.Empty;    
                    }

                    workRow["DeliveryCost"] = entry.ConvertStringToDecimal((dataItem.FindControl("DeliveryCost") as RadNumericTextBox).Text.ToString());
                    workRow["TermsCode"] = (dataItem.FindControl("TermsCode") as RadComboBox).SelectedValue;
                    workRow["Memo1"] = (dataItem.FindControl("Memo1") as RadTextBox).Text;

                    dtable.Rows.Add(workRow);
                    dtable.AcceptChanges();
                }
            }

    protected void RadGridItems_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            //RadGridItems.DataSource = (DataTable)Session["Proposal_DT"];
            //RadGridItems.CurrentPageIndex = RadGridItems.MasterTableView.CurrentPageIndex;
        }


  2. Attila Antal
    Admin
    Attila Antal avatar
    593 posts

    Posted 18 Jun 2020 Link to this post

    Hi,

    This question has been answered in the Paging is not working if I rebind the grid. forum post.

    Also, for urgent matters, I suggest that you open a Formal Support ticket which provides a Guaranteed 24 hours response time rather than posting the question in multiple forum threads.

    Regards,
    Attila Antal
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top