i have an issue with maintaining state of template column textbox on paging in radgrid.
I am storing the data in session and then on need datasource event trying to get the data again from session.
But this does not help.
Please help me its urgent issue.please refer code below-
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadGrid ID="grChecklist1" runat="server" AutoGenerateColumns="false"
onneeddatasource="grChecklist1_NeedDataSource"
onpageindexchanged="grChecklist1_PageIndexChanged" >
<MasterTableView AllowPaging="true" AutoGenerateColumns="false" PageSize="5">
<Columns>
<telerik:GridTemplateColumn DataField="Number" HeaderText="Number" Visible="true">
<ItemTemplate>
<asp:TextBox ID="txtNumber" runat="server" Text='<%#Bind("Number")%>'/>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="TaskDescription" HeaderText="TaskDescription" Visible="true">
<ItemTemplate>
<asp:TextBox ID="txtTaskDescription" runat="server" Text='<%#Bind("TaskDescription")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadDetails();
}
}
private void LoadDetails()
{
DataTable dt = new DataTable();
dt.Columns.Add("Number",typeof(string));
dt.Columns.Add("TaskDescription", typeof(string));
dt.Rows.Add("1", "task1");
dt.Rows.Add("2", "task2");
dt.Rows.Add("3", "task3");
dt.Rows.Add("4", "task4");
dt.Rows.Add("5", "task5");
dt.Rows.Add("6", "task6");
dt.Rows.Add("7", "task7");
//grChecklist.DataSource = dt;
// grChecklist.DataBind();
Session["dt"] = dt;
}
private void RefreshSessionState()
{
DataTable dt = new DataTable();
dt.Columns.Add("Number", typeof(string));
dt.Columns.Add("TaskDescription", typeof(string));
foreach (GridDataItem item in grChecklist1.Items)
{
string number=(item.FindControl("txtNumber") as TextBox).Text;
string task = (item.FindControl("txtTaskDescription") as TextBox).Text;
dt.Rows.Add(number,task);
}
if (Session["dt"] != null)
Session.Remove("dt");
Session["dt"] = dt;
}
protected void grChecklist1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
// RefreshSessionState();
grChecklist1.DataSource = (DataTable)Session["dt"];
}
protected void grChecklist1_PageIndexChanged(object sender, GridPageChangedEventArgs e)
{
grChecklist1.AllowPaging = false;
grChecklist1.Rebind();
// RefreshSessionState();
grChecklist1.CurrentPageIndex = e.NewPageIndex;
grChecklist1.AllowPaging = true;
grChecklist1.Rebind();
}
}
1 Answer, 1 is accepted
Please try with the below code snippet.
ASPX
<
telerik:RadGrid
ID
=
"grChecklist1"
runat
=
"server"
AutoGenerateColumns
=
"false"
OnNeedDataSource
=
"grChecklist1_NeedDataSource"
OnPageIndexChanged
=
"grChecklist1_PageIndexChanged"
>
<
MasterTableView
AllowPaging
=
"true"
AutoGenerateColumns
=
"false"
PageSize
=
"5"
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"Number"
HeaderText
=
"Number"
Visible
=
"true"
>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"txtNumber"
runat
=
"server"
Text='<%#Bind("Number")%>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"TaskDescription"
HeaderText
=
"TaskDescription"
Visible
=
"true"
>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"txtTaskDescription"
runat
=
"server"
Text='<%#Bind("TaskDescription")%>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
ASPX.CS
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
LoadDetails();
}
}
private
void
LoadDetails()
{
DataTable dt =
new
DataTable();
dt.Columns.Add(
"Number"
,
typeof
(
string
));
dt.Columns.Add(
"TaskDescription"
,
typeof
(
string
));
dt.Rows.Add(
"1"
,
"task1"
);
dt.Rows.Add(
"2"
,
"task2"
);
dt.Rows.Add(
"3"
,
"task3"
);
dt.Rows.Add(
"4"
,
"task4"
);
dt.Rows.Add(
"5"
,
"task5"
);
dt.Rows.Add(
"6"
,
"task6"
);
dt.Rows.Add(
"7"
,
"task7"
);
//grChecklist.DataSource = dt;
// grChecklist.DataBind();
Session[
"dt"
] = dt;
}
protected
void
grChecklist1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
// RefreshSessionState();
grChecklist1.DataSource = (DataTable)Session[
"dt"
];
}
protected
void
grChecklist1_PageIndexChanged(
object
sender, GridPageChangedEventArgs e)
{
DataTable dt = Session[
"dt"
]
as
DataTable;
int
pagesize = 5;
int
currentpagesize = grChecklist1.CurrentPageIndex;
for
(
int
i = pagesize * currentpagesize; i < dt.Rows.Count; i++)
{
foreach
(GridDataItem item
in
grChecklist1.MasterTableView.Items)
{
if
(item.ItemIndex + (pagesize * currentpagesize) == i)
{
dt.Rows[i][
"Number"
] = (item.FindControl(
"txtNumber"
)
as
TextBox).Text;
dt.Rows[i][
"TaskDescription"
] = (item.FindControl(
"txtTaskDescription"
)
as
TextBox).Text;
}
}
}
}
Let me know if any concern.
Thanks,
Jayesh Goyani
Thanks, i solved my problem.
I need one more help..when i deploy my code on server , some of the radtextboxes get distorted , size gets increased.
This happens only in IE works perfectly in chrome.
Can you please help?
Thanks,
SK
Please add the height and width property on RadTextBox and check it.
Sometimes it will apply browser's default style.
Let me know if any concern.
Thanks,
Jayesh Goyani
i had set width as 100% fro some of the radtextboxes and had also set the item width in item style...
removing textbox width solved the issue.
Thanks for your timely help.
Thanks,
SK
I have one more issue with radgrid..
I have set enabled=false for radgrid. But i want paging to work on it.
how do i enable paging when radgrid is disabled?
Thanks,
SK
i have one more issue , while sorting data in radgrid.
this is more of a sql query , but thought if you could help.
I have a varchar column- No it has values-1,1b,18,2,2a,11,1a,12,,18a,18b,22,222
i want to sort these values in this order 1,1a,1b,2,2a,11,12,18,18a,18b,22,222
Is there any way?
Please help.
I have a radgrid with a radcombobox. after page index changed for radgrid , when i change the selected index of the rad combobox , it gives me javascript error-
Error: Sys.WebForms.PageRequestManagerParserErrorException: The
message received from the server could not be parsed.
Please help.
Thanks,
SK
I have a radgrid with a radcombobox (autopostback=true for this combobox). after page index changed for radgrid , when i change the selected index of the rad combobox , it gives me javascript error-
Error: Sys.WebForms.PageRequestManagerParserErrorException: The
message received from the server could not be parsed.
Please help.
Thanks,
SK
As per my knowledge this issue is related to UpdatePanel/RadAjaxManager than also could you please provide your code snippet so I will try to resolved your issue.
Thanks,
Jayesh Goyani
Issue is resolved now. I had to add ValidateRequest="false" in the aspx page and in web config for httpruntime section , had to add requestValidationMode="2.0" . This was related to some issue - System.Web.HttpRequestValidationException (0x80004005): A
potentially dangerous Request.Form value was detected from the client.
Thanks,
SK
Jayesh Goyani
I have Telerik Grid With one GridTemplateColumn for <asp:TextBox here when i enter this textbox. I need total amount calculate and show the Footer column using Javascript or Jquery how will do this can you guide me most urgent.
Please try with below code snippet.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TelerikWebApp1.WebForm1" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
script
src
=
"https://code.jquery.com/jquery-1.11.2.min.js"
></
script
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
>
function setfooter() {
var grid = $find("<%= RadGrid1.ClientID %>");
var sum = 0;
if (grid) {
var MasterTable = grid.get_masterTableView();
var Rows = MasterTable.get_dataItems();
for (var i = 0; i <
Rows.length
; i++) {
var
row
=
Rows
[i];
var txt1 = $(row.get_element()).find("input[id*='TextBox1']").get(0)
sum += parseInt(txt1.value);
}
}
$(".gridFooterLabel").get(0)
.innerHTML
=
sum
;
}
</script>
</
telerik:RadCodeBlock
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
ShowFooter
=
"true"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Name"
UniqueName
=
"Name"
HeaderText
=
"Name"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
Text='<%# Eval("ID") %>' onchange="javascript:setfooter();"></
asp:TextBox
>
</
ItemTemplate
>
<
FooterTemplate
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
CssClass
=
"gridFooterLabel"
></
asp:Label
>
</
FooterTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
using
System;
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
TelerikWebApp1
{
public
partial
class
WebForm1 : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
protected
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
dynamic data =
new
[] {
new
{ ID = 1, Name =
"Name1"
},
new
{ ID = 2, Name =
"Name2"
}
};
RadGrid1.DataSource = data;
}
double
sum = 0;
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
sum +=
double
.Parse((dataItem.FindControl(
"TextBox1"
)
as
TextBox).Text);
}
else
if
(e.Item
is
GridFooterItem)
{
GridFooterItem footer = (GridFooterItem)e.Item;
(footer.FindControl(
"Label1"
)
as
Label).Text = sum.ToString();
}
}
}
}
Let me know if any concern.
Thanks,
Jayesh Goyani
hi Jayesh,
need urgent help.
I have a radgrid which has a usercontrol wherein i can attach multiple files as attachments for each row in radgrid.
I also have add new row button which will add a new blank row to the grid.
The issue is that when i add a new row , all the earlier rows which showed attachemnets in the usercontrol , they al;l are lost.I think this is ajax issue. but not able to trace. I also tried adding the usercontrol which is in radgrid for attachmnets to updatedcontrols in ajax , but no luck.Please help.
Hello S,
This is the default behavior of the asp.net. After postback uploaded is removed.
As per my suggestion you have to use radaysncupload control it saves file immediately into temp folder. So after postback you can get the uploaded files from the temp folder.
Let me know if any concern.
Thanks, Jayesh Goyani
hi Jayesh,
am using radasynupload control itself in the usercontrol, it has this radasynupload control as well as a grid to display the files uploaded. but still its not working.
Hi Jayesh,
please refer below scenario-
I have a usercontrol for attachments. The usercontrol has a RadAsyncUpload and a grid to show the uploaded files.But when i use this usercontrol on my main page, and upload a file, it displays the first uploaded file immediately in the grid in usercontrol.But when i upload second time , the file gets uploaded but the UI is not refreshed and the second file is not shown in the grid.Please help.I have added ajax setting to update the usercontrol on my main page on click of the RadAsyncUpload button. <telerik:AjaxSetting AjaxControlID="AsyncUpload1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="usrAttachments" />
</UpdatedControls>
</telerik:AjaxSetting>
How to Implementation AutoCompleteBox with Image for Ex:
My Control this but here i added this DataSourceID="SqlDataSource1" but no need this i need fetch the data from database using c# and list object
can you fixed this
<telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBox1" runat="server" Width="400" Height="400px"
EmptyMessage="Type an E-mail" DataSourceID="SqlDataSource1" DataTextField="ContactName"
OnItemDataBound="RadComboBox1_ItemDataBound">
</telerik:RadComboBox>
But My Need this
In my AutocompleteBox shows like this -> multiple column with image then c# list object using webservices for Data binding.
EMPID EMPNAME EMPIMAGE
100 NAME HERE IMAGE HERE
how will do this any one fixed this
Hi
JEYESH
How to Implementation AutoCompleteBox with Image for Ex:
My Control this but here i added this DataSourceID="SqlDataSource1" but no need this i need fetch the data from database using c# and list object
can you fixed this
<telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBox1" runat="server" Width="400" Height="400px"
EmptyMessage="Type an E-mail" DataSourceID="SqlDataSource1" DataTextField="ContactName"
OnItemDataBound="RadComboBox1_ItemDataBound">
</telerik:RadComboBox>
But My Need this
In my AutocompleteBox shows like this -> multiple column with image then c# list object using webservices for Data binding.
EMPID EMPNAME EMPIMAGE
100 NAME HERE IMAGE HERE
how will do this any one fixed this
Please open a separate ticket/thread for every unrelated query you have. This way the information in the thread will be more consistent. Thus, it will be easier for you to search for information in your past threads.
Also, if someone is facing similar issue they would be able to find the solution faster.
Regards,
Viktor Tachev
Telerik
This is working for only paging but not working for filtering. Can you please help me, how this scenario works for filtering.
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>, </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;
}
Hello,
Your question has been answered in the Paging is not working if I rebind the grid. forum post.
In the future, please ask your questions in existing forum Threads if they are related to the thread's topic/scenario, or create a new Thread in case you can't find a Forum post with related discussion.
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.
Kind regards,
Attila Antal
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.