Hello,
Im trying to achieve a column chart that shows the sum of activities for 3 types of activities and per date. Checked your examples but this case is not very well explained. I'm sure I'm doing something wrong. Besides getting the same result for each serie they also have the same color.
HTML
<
telerik:RadHtmlChart
runat
=
"server"
ID
=
"ColumnChartActivitiesByDate"
Width
=
"100%"
Transitions
=
"true"
Skin
=
"Bootstrap"
>
<
Pan
Enabled
=
"true"
/>
<
Legend
>
<
Appearance
Position
=
"Bottom"
></
Appearance
>
</
Legend
>
<
PlotArea
>
<
YAxis
MaxValue
=
"200"
MinValue
=
"0"
>
<
TitleAppearance
Text
=
"Atividades"
></
TitleAppearance
>
</
YAxis
>
<
XAxis
DataLabelsField
=
"Date"
></
XAxis
>
<
Series
>
</
Series
>
</
PlotArea
>
</
telerik:RadHtmlChart
>
C# - Getdata method
protected
DataTable GetData()
{
DataTable dt =
new
DataTable();
dt.Columns.Add(
"ID"
,
typeof
(
int
));
dt.Columns.Add(
"CategoryName"
,
typeof
(
string
));
dt.Columns.Add(
"TotalActivities"
,
typeof
(
int
));
dt.Columns.Add(
"CategoryColor"
,
typeof
(
string
));
dt.Columns.Add(
"Date"
,
typeof
(DateTime));
dt.Rows.Add(1,
"Run"
, 0,
"#ff0000"
,
new
DateTime(2019, 09, 1));
dt.Rows.Add(2,
"Walk"
, 18,
"#00ff00"
,
new
DateTime(2019, 09, 1));
dt.Rows.Add(3,
"Swim"
, 0,
"#0000ff"
,
new
DateTime(2019, 09, 1));
dt.Rows.Add(4,
"Run"
, 1,
"#ff0000"
,
new
DateTime(2019, 10, 1));
dt.Rows.Add(5,
"Walk"
, 29,
"#00ff00"
,
new
DateTime(2019, 10, 1));
dt.Rows.Add(6,
"Swim"
, 0,
"#0000ff"
,
new
DateTime(2019, 10, 1));
dt.Rows.Add(7,
"Run"
, 0,
"#ff0000"
,
new
DateTime(2019, 11, 1));
dt.Rows.Add(8,
"Walk"
, 9,
"#00ff00"
,
new
DateTime(2019, 11, 1));
dt.Rows.Add(9,
"Swim"
, 0,
"#0000ff"
,
new
DateTime(2019, 11, 1));
dt.Rows.Add(10,
"Run"
, 0,
"#ff0000"
,
new
DateTime(2019, 12, 1));
dt.Rows.Add(11,
"Walk"
, 5,
"#00ff00"
,
new
DateTime(2019, 12, 1));
dt.Rows.Add(12,
"Swim"
, 0,
"#0000ff"
,
new
DateTime(2019, 12, 1));
dt.Rows.Add(13,
"Run"
, 0,
"#ff0000"
,
new
DateTime(2020, 01, 1));
dt.Rows.Add(14,
"Walk"
, 7,
"#00ff00"
,
new
DateTime(2020, 01, 1));
dt.Rows.Add(15,
"Swim"
, 1,
"#0000ff"
,
new
DateTime(2020, 01, 1));
dt.Rows.Add(16,
"Run"
, 0,
"#ff0000"
,
new
DateTime(2020, 02, 1));
dt.Rows.Add(17,
"Walk"
, 11,
"#00ff00"
,
new
DateTime(2020, 02, 1));
dt.Rows.Add(18,
"Swim"
, 3,
"#0000ff"
,
new
DateTime(2020, 02, 1));
return
dt;
}
c# - Chart config
ColumnSeries RunColumnSeries =
new
ColumnSeries();
RunColumnSeries.Name =
"Run"
;
RunColumnSeries.DataFieldY =
"TotalActivities"
;
RunColumnSeries.ColorField =
"CategoryColor"
;
ColumnChartActivitiesByDate.PlotArea.Series.Add(RunColumnSeries);
ColumnSeries WalkColumnSeries =
new
ColumnSeries();
WalkColumnSeries.Name =
"Walk"
;
WalkColumnSeries.DataFieldY =
"TotalActivities"
;
WalkColumnSeries.ColorField =
"CategoryColor"
;
ColumnChartActivitiesByDate.PlotArea.Series.Add(WalkColumnSeries);
ColumnSeries SwimColumnSeries =
new
ColumnSeries();
SwimColumnSeries.Name =
"Swim"
;
SwimColumnSeries.DataFieldY =
"TotalActivities"
;
SwimColumnSeries.ColorField =
"CategoryColor"
;
ColumnChartActivitiesByDate.PlotArea.Series.Add(SwimColumnSeries);
ColumnChartActivitiesByDate.DataSource = GetData();
ColumnChartActivitiesByDate.DataBind();
Hope I can get some light on this.
Thank you!
I am experimenting with dynamically creating chart series using the RadHtmlChart and as long as I I just make a normal column series everything works just fine creating the series dynamically. However once I change the code to try to make the series stack on each other by setting series.stacked = true in the code dynamically creating the series the chart data really messes up. The last series created takes up the entire chart height and if the value was say 70, the y-axis value now says 700000 but the column tooltip still says the data is 70 for the series. The two series created before the last series do not display at all.
Attached are example pictures of my issue and the code I am using to dynamically create the series
I have RichTextEditor and process paste function witch in Internet Explorer 11 not working correct, copied text get triplicated. Event that handles pasting is fired three times in IE 11. In Chrome everything is working fine.
/**
* Set the pasted data back into the RadEditor
*/
ns.RichText.RichTextEditor.prototype.processPaste = function () {
this.editor.get_document().body.innerHTML = Telerik.Web.UI.Editor.Utils.convertWordLists(this.editor.get_html());
this.editor.fire("FormatStripper", { value: "WORD" });
// Set the original content back and insert the newly pasted content at the caret position
var pastedHTML = this.editor.get_html(true);
// Reposition the cursor where it was before pasting and then paste the formated html there
if (this.editorContent === "") {
this.editorContent = "<br>";
}
this.editor.get_document().body.innerHTML = this.editorContent;
this.restoreSelection();
var range = this.editor.getSelection().getRange();
range.deleteContents();
var frag = range.createContextualFragment(pastedHTML);
range.insertNode(frag);
this.pasting = false;
};
I think this line of code are problem
range.deleteContents();
var frag = range.createContextualFragment(pastedHTML);
range.insertNode(frag);
they cause event on pasting to fire three times.
Is there any way to handle inserting pasted text different in IE in code?
For my company, the rad editor is currently used and the users are required to enter all the data in one session. Now the users would like to be able to save their changes in several sessions and not generate the document until all the data has been entered.
I see that the rad editor has 'track changes'. However I am not certain this is exactly what they want to see.
Is there a way for a user to 'save' changes and another way for the user to actually submit their changes so that a document can be generated when needed using the radeditor and/or some other Telerik tool? If so, would you tell me what you recommend and how would I accomplish that goal?
If not, would the 'track changes' or some other feature accomplish my goal?
Thanks for letting me know what you recommend?
Currently I am trying to use teleriks automatic CRUD on the front-end. I am currently using batch edit mode, and the editing/updating works great. However, whenever I try to insert a record it does not work. I get an error of to many arguments specified, which is not true. When I look at the values, it seems like it is trying to insert data from the previous row and not the new.
<%@ Page Title="" Language="C#" MasterPageFile="~/BPO.Master" AutoEventWireup="true" CodeBehind="frmCCP.aspx.cs" Inherits="BPO.frmCCP" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"server"
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
PostBackControls
=
"btnExport, AddNewRecordButton, SaveChangesIcon"
>
</
telerik:RadAjaxManager
>
<
h1
class
=
"text-Center"
style
=
"text-align:center; color:red;"
>CCP Information</
h1
>
<
br
/>
<
br
/>
<
div
class
=
"myGridClass"
>
<
telerik:RadGrid
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"grdCCP"
AllowPaging
=
"True"
PageSize
=
"10"
FilterType
=
"HeaderContext"
AllowFilteringByColumn
=
"true"
AllowAutomaticInserts
=
"true"
DataSourceID
=
"grdCCPSource"
AllowAutomaticUpdates
=
"true"
EnableHeaderContextFilterMenu
=
"true"
EnableHeaderContextMenu
=
"true"
OnItemInserted
=
"grdCCP_ItemInserted"
OnItemUpdated
=
"grdCCP_ItemUpdated"
>
<
ExportSettings
Excel-Format
=
"ExcelML"
OpenInNewWindow
=
"true"
ExportOnlyData
=
"true"
FileName
=
"CCPReport"
IgnorePaging
=
"true"
></
ExportSettings
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
SaveScrollPosition
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"CPP_ID"
Width
=
"100%"
Height
=
"100%"
CssClass
=
"myGridClass"
AutoGenerateColumns
=
"false"
AllowFilteringByColumn
=
"True"
CommandItemDisplay
=
"Top"
AllowAutomaticUpdates
=
"true"
EditMode
=
"Batch"
BatchEditingSettings-EditType
=
"Cell"
>
<
CommandItemSettings
ShowExportToExcelButton
=
"true"
ShowAddNewRecordButton
=
"true"
ShowRefreshButton
=
"false"
/>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"Created_Date"
SortOrder
=
"Descending"
/>
</
SortExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"CPP_ID"
HeaderText
=
"CCP ID"
InsertVisiblityMode
=
"AlwaysHidden"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Customer"
ItemStyle-CssClass
=
"customerddl"
DataField
=
"Customer"
FilterControlAltText
=
"Filter Customer"
SortExpression
=
"Customer"
FilterCheckListEnableLoadOnDemand
=
"true"
AutoPostBackOnFilter
=
"true"
GroupByExpression
=
"Customer Group By Customer"
CurrentFilterFunction
=
"Contains"
>
<
HeaderStyle
Width
=
"125px"
/>
<
ItemTemplate
>
<
telerik:RadLabel
runat
=
"server"
ID
=
"lblCustomer"
Text='<%# DataBinder.Eval(Container.DataItem, "Customer") %>' DefaultInsertValue="NULL"></
telerik:RadLabel
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDropDownList
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"Update_Customer"
DataSourceID
=
"CustomerDataSource"
DataTextField
=
"Name"
DataValueField
=
"Name"
DefaultMessage
=
"-Select-"
CssClass
=
"req-field"
></
telerik:RadDropDownList
>
</
EditItemTemplate
>
<
InsertItemTemplate
>
<
telerik:RadDropDownList
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"Insert_Customer"
DataSourceID
=
"CustomerDataSource"
DataTextField
=
"Name"
DataValueField
=
"Name"
DefaultMessage
=
"-Select-"
CssClass
=
"req-field"
></
telerik:RadDropDownList
>
</
InsertItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Cust_NAMC_ID"
CurrentFilterFunction
=
"Contains"
HeaderText
=
"Customer NAMC"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"115px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Program"
CurrentFilterFunction
=
"Contains"
HeaderText
=
"Program"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"CCP"
ItemStyle-CssClass
=
"customerddl"
DataField
=
"Po_Type_ID"
FilterControlAltText
=
"Filter CCP"
FilterCheckListEnableLoadOnDemand
=
"true"
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"Contains"
>
<
HeaderStyle
Width
=
"125px"
/>
<
ItemTemplate
>
<
telerik:RadLabel
runat
=
"server"
ID
=
"lblCCP"
Text='<%# DataBinder.Eval(Container.DataItem, "Po_Type_ID") %>'></
telerik:RadLabel
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDropDownList
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"Update_CCP"
DataSourceID
=
"CCPDataSource"
DataTextField
=
"Name"
DataValueField
=
"Name"
DefaultMessage
=
"-Select-"
CssClass
=
"req-field"
></
telerik:RadDropDownList
>
</
EditItemTemplate
>
<
InsertItemTemplate
>
<
telerik:RadDropDownList
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"Insert_CCP"
DataSourceID
=
"CCPDataSource"
DataTextField
=
"Name"
DataValueField
=
"Name"
DefaultMessage
=
"-Select-"
CssClass
=
"req-field"
></
telerik:RadDropDownList
>
</
InsertItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Part_No"
HeaderText
=
"Component PN"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"110px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Part_Name"
HeaderText
=
"Component Name"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"175px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Date_Rcvd"
HeaderText
=
"Date Rec'd"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"New_Price"
HeaderText
=
"New Price"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Tooling_Price"
HeaderText
=
"Tooling"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"RFQ_Num"
HeaderText
=
"Toyota Letter Reference RFQ #"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"150px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Eff_From"
HeaderText
=
"Effective From"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Eff_To"
HeaderText
=
"Effective To"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FG_Part_No"
HeaderText
=
"Finished Good PN"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"150px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FG_Part_Name"
HeaderText
=
"Finished Good Name"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"200px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Ship_From"
HeaderText
=
"Ship From"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"175px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Ship_To"
HeaderText
=
"Ship To"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"175px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"TG_NAMC"
HeaderText
=
"TG NAMC"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Vendor_CD"
HeaderText
=
"TG Vendor Code"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PO_NUM"
HeaderText
=
"PO NO"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"REV_NO"
HeaderText
=
"Rev"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Buyer_Name"
HeaderText
=
"Buyer"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"135px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Manager_Name"
HeaderText
=
"Manager"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"125px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"BU"
HeaderText
=
"Business Unit"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SAM"
HeaderText
=
"SAM"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"125px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"RFQ_To_CUST"
HeaderText
=
"RFQ to Customer"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Quoted_Date"
HeaderText
=
"Quoted Date"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PO_From_FG"
HeaderText
=
"PO from FG"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PO_RCVD_Date"
HeaderText
=
"PO Received Date"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PO_Eff_Date"
HeaderText
=
"Effective Date"
CurrentFilterFunction
=
"Contains"
DefaultInsertValue
=
"NULL"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Created_Date"
HeaderText
=
"Created Date"
CurrentFilterFunction
=
"Contains"
>
<
HeaderStyle
Width
=
"100px"
/>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
<
asp:SqlDataSource
ID
=
"grdCCPSource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:SalesTest %>"
SelectCommand="BPO.Get_CPP_Data" SelectCommandType="StoredProcedure" UpdateCommand="BPO.Update_CPP_Data" UpdateCommandType="StoredProcedure" InsertCommand="BPO.Inserts_CPP_Data" OnInserting="grdCCPSource_Inserting" InsertCommandType="StoredProcedure">
<
UpdateParameters
>
<
asp:Parameter
Name
=
"CPP_ID"
DbType
=
"Int32"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Customer"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Cust_NAMC_ID"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Program"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_Type_ID"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Part_No"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Part_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Date_Rcvd"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"New_Price"
DbType
=
"Decimal"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Tooling_Price"
DbType
=
"Decimal"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"RFQ_Num"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Eff_From"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Eff_To"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"FG_Part_No"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"FG_Part_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Ship_From"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Ship_To"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"TG_NAMC"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Vendor_CD"
DbType
=
"Int32"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_NUM"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"REV_NO"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Buyer_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Manager_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"BU"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"SAM"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"RFQ_To_CUST"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Quoted_Date"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_From_FG"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_RCVD_Date"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_Eff_Date"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Created_Date"
Type
=
"DateTime"
/>
</
UpdateParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"Customer"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Cust_NAMC_ID"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Program"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_Type_ID"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Part_No"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Part_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Date_Rcvd"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"New_Price"
DbType
=
"Decimal"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Tooling_Price"
DbType
=
"Decimal"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"RFQ_Num"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Eff_From"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Eff_To"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"FG_Part_No"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"FG_Part_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Ship_From"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Ship_To"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"TG_NAMC"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Vendor_CD"
DbType
=
"Int32"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_NUM"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"REV_NO"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Buyer_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Manager_Name"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"BU"
DbType
=
"AnsiStringFixedLength"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"SAM"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"RFQ_To_CUST"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"Quoted_Date"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_From_FG"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_RCVD_Date"
DbType
=
"String"
Direction
=
"Input"
/>
<
asp:Parameter
Name
=
"PO_Eff_Date"
DbType
=
"String"
Direction
=
"Input"
/>
</
InsertParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"CustomerDataSource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:SalesTest %>"
SelectCommand="SELECT DISTINCT [Name] FROM [BPO].[M_Code] WHERE Type_ID = '1' ORDER BY [Name] ASC"></
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"CCPDataSource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:SalesTest %>"
SelectCommand="SELECT DISTINCT [Name], [PO_Type_ID] FROM [SPIRE].[M_PO_TYPE] WHERE Po_Type_ID in (4,5,6,7,8) ORDER BY [Name] ASC"></
asp:SqlDataSource
>
</
asp:Content
>
My stored Proc is as follows:
USE [Sales]
GO
/****** Object: StoredProcedure [BPO].[Inserts_CPP_Data] Script
Date
: 10/29/2019 11:44:10 AM ******/
SET
ANSI_NULLS
ON
GO
SET
QUOTED_IDENTIFIER
ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER
PROCEDURE
[BPO].[Inserts_CPP_Data]
-- Add the parameters for the stored procedure here
@Customer
varchar
(20),
@Cust_NAMC_ID
varchar
(10),
@Program
varchar
(10),
@PO_Type_ID
varchar
(10),
@Part_No
varchar
(20),
@Part_Name
varchar
(50),
@Date_Rcvd
varchar
(50),
@New_Price
decimal
(18,4),
@Tooling_Price
decimal
(18,4),
@RFQ_Num
varchar
(20),
@Eff_From
varchar
(50),
@Eff_To
varchar
(50),
@FG_Part_No
varchar
(20),
@FG_Part_Name
varchar
(50),
@Ship_From
varchar
(50),
@Ship_To
varchar
(50),
@TG_NAMC
varchar
(50),
@Vendor_CD
int
,
@PO_NUM
varchar
(50),
@REV_NO
varchar
(20),
@Buyer_Name
varchar
(200),
@Manager_Name
varchar
(200),
@BU
char
(2),
@SAM
varchar
(50),
@RFQ_To_CUST
varchar
(50),
@Quoted_Date
varchar
(50),
@PO_From_FG
varchar
(50),
@PO_RCVD_Date
varchar
(50),
@PO_Eff_Date
varchar
(50)
AS
BEGIN
SET
@PO_Type_ID = (
Select
[PO_Type_ID]
from
[SPIRE].M_PO_TYPE
where
[
Name
] = @PO_Type_ID)
Insert
Into
[SPIRE].T_CPP
(
[Cust_NAMC_ID],
[Customer],
[Program],
[PO_Type_ID],
[Part_No],
[Part_Name],
[Date_Rcvd],
[New_Price],
[Tooling_Price],
[RFQ_Num] ,
[Eff_From],
[Eff_To],
[FG_Part_No],
[FG_Part_Name],
[Ship_From],
[Ship_To],
[TG_NAMC],
[Vendor_CD],
[PO_NUM],
[REV_NO],
[Buyer_Name],
[Manager_Name],
[BU],
[SAM],
[RFQ_To_CUST],
[Quoted_Date],
[PO_From_FG],
[PO_RCVD_Date],
[PO_Eff_Date] ,
[Created_Date]
)
VALUES
(
@Cust_NAMC_ID,
@Customer,
@Program,
@PO_Type_ID,
@Part_No,
@Part_Name,
@Date_Rcvd,
@New_Price,
@Tooling_Price,
@RFQ_Num,
@Eff_From,
@Eff_To,
@FG_Part_No,
@FG_Part_Name,
@Ship_From,
@Ship_To,
@TG_NAMC,
@Vendor_CD,
@PO_NUM,
@REV_NO,
@Buyer_Name,
@Manager_Name,
@BU,
@SAM,
@RFQ_To_CUST,
@Quoted_Date,
@PO_From_FG,
@PO_RCVD_Date,
@PO_Eff_Date,
GETDATE()
)
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
END
Hello, i have a radcombobox that load filtered data using Web service. The aspx page is like this :
<
telerik:RadComboBox
runat
=
"server"
ID
=
"rcbCustomer"
Width
=
"350px"
EmptyMessage
=
"Select Customer"
Visible
=
"true"
Filter
=
"Contains"
MinFilterLength
=
"3"
EnableAutomaticLoadOnDemand
=
"true"
EnableLoadOnDemand
=
"true"
AllowCustomText
=
"true"
Height
=
"100px"
ShowMoreResultsBox
=
"true"
OnItemsRequested
=
"rcbCustomer_ItemsRequested"
EnableVirtualScrolling
=
"true"
EnableViewState
=
"true"
OnSelectedIndexChanged
=
"rcbCustomer_SelectedIndexChanged"
AutoPostBack
=
"true"
CausesValidation
=
"false"
>
<
WebServiceSettings
Method
=
"GetCustomerName"
Path
=
"SalesOrderWebService.asmx"
></
WebServiceSettings
</telerik:RadComboBox>
and on my .asmx.cs is like this :
/// <summary>
/// Summary description for SalesOrderWebService
/// </summary>
[WebService(Namespace =
"SO.Web.UI"
)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(
false
)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public
class
SalesOrderWebService : System.Web.Services.WebService
{
[WebMethod]
public
RadComboBoxData GetCustomerName(RadComboBoxContext context)
{
List<RadComboBoxItemData> result =
new
List<RadComboBoxItemData>(context.NumberOfItems);
RadComboBoxData comboData =
new
RadComboBoxData();
CustomerCollection colCustomer =
new
CustomerCollection();
colCustomer.ListAutoSuggest(context.Text);
if
(colCustomer.Count>0)
{
int
itemsPerRequest = 10;
int
itemOffset = context.NumberOfItems;
int
endOffset = itemOffset + itemsPerRequest;
if
(endOffset > colCustomer.Count)
{
endOffset = colCustomer.Count;
}
if
(endOffset == colCustomer.Count)
{
comboData.EndOfItems =
true
;
}
else
{
comboData.EndOfItems =
false
;
}
result =
new
List<RadComboBoxItemData>(endOffset - itemOffset);
for
(
int
i=0;i<=colCustomer.Count-1;i++)
{
RadComboBoxItemData itemData =
new
RadComboBoxItemData();
itemData.Attributes.Add(
"CompanyID"
, colCustomer[i].CustomerId);
itemData.Attributes.Add(
"CompanyName"
, colCustomer[i].CustomerName);
itemData.Value = colCustomer[i].CustomerId.ToString();
itemData.Text = colCustomer[i].CustomerName;
result.Add(itemData);
}
comboData.Message = String.Format(
"Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>"
, endOffset.ToString(), colCustomer.Count.ToString());
}
else
{
comboData.Message =
"No matches"
;
}
comboData.Items = result.ToArray();
return
comboData;
}
}
When i try to debug on page load after i select an item on rcbCustomer it always show as null.
What should i do to fix this ?
I'm using telerik.web.ui version 2016.3.1027.45.
Thank you in advance.