I have a Stored Procedure in SQL Database as below:
ALTER
PROCEDURE
[General].[usp_tbl_AccountCode_Query_Search]
@CompanyCode nvarchar (255) =
Null
,
@AccountCode nvarchar(50) =
Null
,
@Description nvarchar(1000) =
Null
AS
BEGIN
SET
NOCOUNT
ON
;
If (LTRIM(@CompanyCode) =
''
)
Set
@CompanyCode =
Null
If (LTRIM(@AccountCode) =
''
)
Set
@AccountCode =
Null
If (LTRIM(@Description) =
''
)
Set
@Description =
Null
DECLARE
@GroupId
as
nvarchar(50)=
null
Select
@GroupId = GroupID
FROM
[General].[tbl_Buyer]
where
code = @CompanyCode
IF (@GroupId=
'8000'
)
BEGIN
Select
Distinct
AccountCodeID,
CompanyCode,
AccountCode,
AccountDescription
From
General.tbl_AccountCode (NOLOCK)
Where
IsNull
(AccountCode,
''
)
Like
'%'
+
Coalesce
(@AccountCode, AccountCode,
''
) +
'%'
And
IsNull
(AccountDescription,
''
)
Like
'%'
+
'['
+
Coalesce
(@Description, AccountDescription,
''
) +
']'
+ +
'%'
And
IsNull
(AccountDescription,
''
)
Like
'%'
+
Coalesce
(@Description, AccountDescription,
''
) +
'%'
--And CompanyCode in (Select Code FROM [Sunway_AP].[General].[tbl_Buyer] where GroupID = '8000')
And
CompanyCode =
'8000'
Order
By
AccountCode
END
ELSE
IF (@GroupId=
'9000'
)
BEGIN
Select
Distinct
AccountCodeID,
CompanyCode,
AccountCode,
AccountDescription
From
General.tbl_AccountCode (NOLOCK)
Where
IsNull
(AccountCode,
''
)
Like
'%'
+
Coalesce
(@AccountCode, AccountCode,
''
) +
'%'
And
IsNull
(AccountDescription,
''
)
Like
'%'
+
'['
+
Coalesce
(@Description, AccountDescription,
''
) +
']'
+ +
'%'
And
IsNull
(AccountDescription,
''
)
Like
'%'
+
Coalesce
(@Description, AccountDescription,
''
) +
'%'
--And CompanyCode in (Select Code FROM [Sunway_AP].[General].[tbl_Buyer] where GroupID = '9000')
And
CompanyCode =
'9000'
Order
By
AccountCode
END
else
BEgin
Select
Distinct
AccountCodeID,
CompanyCode,
AccountCode,
AccountDescription
From
General.tbl_AccountCode (NOLOCK)
Where
IsNull
(AccountCode,
''
)
Like
'%'
+
Coalesce
(@AccountCode, AccountCode,
''
) +
'%'
And
IsNull
(AccountDescription,
''
)
Like
'%'
+
'['
+
Coalesce
(@Description, AccountDescription,
''
) +
']'
+ +
'%'
And
IsNull
(AccountDescription,
''
)
Like
'%'
+
Coalesce
(@Description, AccountDescription,
''
) +
'%'
And
CompanyCode =
ISNULL
(@CompanyCode, CompanyCode)
Order
By
AccountCode
END
My requirement is as below:
I have a "Company Dropdown" and a "RadGrid" on Web page with 4 columns inside it:
1) Account Code
2) Description
3) Amount
4) Remark
I want to show only "Account Code(as Dropdown) , Amount(as Textbox), Remark(as Textbox)" column while doing "Edit" and "Add" not "Description" column.
Also, I want that inside "Account Code Dropdown" (which will appear while "edit" and "add") Data for 2 columns: "Account Code" & "Description" should bind together using above Stored Procedure.
and after "adding" records (using Dropdown and textboxes) data should save in DB and visible in RadGrid. Since I want to bind "Account Code Dropdown" together with 2 different DB columns but after "adding" and "editing" records I want to show them in their specific RadGrid columns defined as above.
Also, the binding of "Account Code Dropdown" should be based on Company Dropdown which is outside of RadGrid. i.e., Whatever Company user select from dropdown, data inside "Account Code Dropdown" should be visible based on that particular company.
Data inside Company dropdown is from: 1000 to 9000
RadGrid aspx code is:
<
telerik:RadMultiPage
ID
=
"RadMultiPage6"
runat
=
"server"
SelectedIndex
=
"0"
Width
=
"100%"
>
<
telerik:RadPageView
ID
=
"RadPageView5"
runat
=
"server"
Width
=
"100%"
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel5"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"RGGSTAcCode"
runat
=
"server"
ShowFooter
=
"True"
GroupingEnabled
=
"False"
ShowStatusBar
=
"true"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"true"
AllowAutomaticDeletes
=
"true"
OnNeedDataSource
=
"RGGSTAcCode_NeedDataSource"
OnItemDataBound
=
"RGGSTAcCode_ItemDataBound"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
mastertableview
ShowHeadersWhenNoRecords
=
"true"
commanditemdisplay
=
"Top"
autogeneratecolumns
=
"false"
datakeynames
=
"RequestID"
InsertItemDisplay
=
"Top"
insertitempageindexaction
=
"ShowItemOnCurrentPage"
ShowFooter
=
"True"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"AccountCodeID"
HeaderText
=
"AccountCode ID"
UniqueName
=
"AccountCodeID"
SortExpression
=
"AccountCodeID"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"RequestID"
HeaderText
=
"Request ID"
UniqueName
=
"RequestID"
SortExpression
=
"RequestID"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"AccountCode"
HeaderText
=
"Account Code"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblAcCode"
Text='<%# Eval("AccountCode") %>' runat="server"></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:DropDownList
ID
=
"ddlAcCode"
runat
=
"server"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"AccountDescription"
HeaderText
=
"Description"
UniqueName
=
"AccountDescription"
SortExpression
=
"AccountDescription"
InsertVisiblityMode
=
"AlwaysHidden"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
aggregate
=
"SUM"
DataField
=
"Amount"
HeaderText
=
"Amount"
FooterText
=
"Total : "
UniqueName
=
"Amount"
SortExpression
=
"Amount"
>
<
ItemStyle
HorizontalAlign
=
"Right"
/>
<
FooterStyle
HorizontalAlign
=
"Right"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Remark"
HeaderText
=
"IFCA Remark"
UniqueName
=
"Remark"
SortExpression
=
"Remark"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
<
CommandItemSettings
AddNewRecordText
=
"Add new record"
RefreshText
=
"Refresh"
></
CommandItemSettings
>
</
mastertableview
>
</
telerik:RadGrid
>
</
telerik:RadAjaxPanel
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
Please reply how to achieve it. If Possible guide the solution or create a sample code for my requirement.
I am very new in Telerik please forgive if something is very basic in my defined requirement.
////
I have radbutton on CommandItemTemplate of radgrid and I have put the radgrid inside the update panel. once I clicked on the radbutton it suppose to pop up the radwindow with content. But in my case it is showing up the radwindow but content inside radwindow is not loading. But If I remove the update panel, radwindow loads with correct content. I am not sure why adding update panel is not showing content on radwindow pop up. Can you please provide some help on this?
Thanks
I'm using the scheduler for ASP.NET in a hard-coded permanent timeline view. I need to have 2 levels of resource grouping, as shown in the demo for the Kendo UI Scheduler located at http://demos.telerik.com/kendo-ui/scheduler/timeline where there are room resources, each of which has 3 staff resources per each room resource. Is this possible in the ASP.NET scheduler? We currently have an application written for Silverlight using the Telerik Scheduler in timeline mode, and it too supports this multiple levels of grouping, but I can't seem to make it work in the asp.net control. Is it even possible? I don't see this being done in any of the asp.net demos either.
This might sound a weird issue but I doubt if it's a bug in the RadGrid control. You might want to reference my StackOverflow question I posted before posting on this forum.
So I am using a Telerik RadGrid control in my asp.net application and I have a GridTemplateColumn which has a CheckBox as an ItemTemplate. Now if I use the html input checkbox control then the RadGrid is rendered properly on the UI. However, if I use the asp.net server-side checkbox control then the data is rendered as it is without the table formatting. Please refer the question posted on StackOverflow as it has a detailed description and screenshots of the problem. Early response is highly appreciated.
I am using a form to insert data as well as to edit the data. Insertion of data is fine using telerik controls. But when I try to edit the data,
retrieving values from the database, I am facing problem, with RadComboBox.
My form sample is ::
<table>
<tr>
<td>Date of Birth : </td>
<td>
<telerik:RadDatePicker ID=
"dtp_DOB"
runat=
"server"
></telerik:RadDatePicker>
</td>
</tr>
<tr>
<td>Province : </td>
<td>
<telerik:RadComboBox ID=
"rcb_province"
runat=
"server"
Sort=
"Ascending"
AutoPostBack=
"true"
EmptyMessage=
"---SELECT---"
></telerik:RadComboBox>
</td>
</tr>
</table>
DataTable dt = GetPersonalDetails(p_id);
if
(dt !=
null
&& dt.Rows.Count > 0)
{
DataRow dr = dt.Rows[0];
string
province_ = dr[
"province"
].ToString();
if
(rcb_province.FindItemByValue(province_) !=
null
)
{
rcb_province.FindItemByValue(dr[
"province"
].ToString()).Selected =
true
;
}
}
Here I can get value in province_ from database but also if block is not executed.
I also tried ::
if
(rcb_province.FindItemByValue(dr[
"province"
].ToString()) !=
null
)
{
rcb_province.FindItemByValue(dr[
"province"
].ToString()).Selected =
true
;
}
rcb_province.Text = dr[
"province"
].ToString();
I have a treeview with an expand mode of ServerSideCallBack. I would like to be able to select a node by value and expanding the path via client-side. I'm was trying to get all of the parent nodes and call the expand() method down to the node, but after the first expand it told me "could not call expand of null." Could you help me with this problem?
var count = 0;
$.each(value.list, function (otherkey, othervalue) {
count = count + 1;
var tree = $find("pagesLeftNav_treeView");
var node = tree.findNodeByValue(othervalue.pageid);
if (count != value.list.length) {
node.expand();
}
})
A new feature implemented in ASP.NET 4.0 is the possibility to control the way that controls’ ClientID is generated. At present, RadControls for ASP.NET AJAX expect the ClientID’s of their child controls to be generated by the default method (AutoID). Because of that, if ClientIDMode is set to different method of generation you can experience various problems with RadControls, for example not working dialogs for RadEditor.
Here are some of the errors that you could experience when the ClientIDMode is set to Static:
All RadControls: Invalid JSON primitive:..
RadEditor's dialogs : Error: 'null' is null or not an object
RadEditor's dialogs : Sys.ArgumentNullException: Dialog Parameters for the FindAndReplace dialog do not exist Parameter name: dialogueName.
RadFileExplorer: might not display the files in the folder
RadGrid : calling get_masterTableView() returns null
"Microsoft JScript runtime error: 'get_postBackElement().id' is null or not an object"
This problem is already added to our TODO list and it should be fixed for RadControls for ASP.NET AJAX Q2 2010. For the time being, we recommend to use ClientIDMode="AutoID" or if you have to use different method you should set the ClientIDMode property’s value explicitly to AutoID to the specific RadControl.
Additional information regarding this new .NET4.0 feature is available in the following article:
ASP.NET 4.0 ClientID Overview
Please note that Microsoft does not recommend setting ClientIDMode="Static" on pages which do contain dynamic controls.
Best regards,
The Telerik team
Default.aspx
<
telerik:RadAjaxManager
ID
=
"radManager"
runat
=
"server"
/>
<
telerik:RadTabStrip
ID
=
"rtsSheet"
runat
=
"server"
MultiPageID
=
"radMultiPage"
CausesValidation
=
"false"
>
<
Tabs
>
<
telerik:RadTab
PageViewID
=
"rpvTradeName"
ToolTip="<%$ Resources: General, TradeNameTitle %>">
<
TabTemplate
>
<
asp:Literal
ID
=
"ltrlTradeName"
runat
=
"server"
Text="<%$ Resources: General, TradeName %>" />
</
TabTemplate
>
</
telerik:RadTab
>
<
telerik:RadTab
PageViewID
=
"rpvViewAll"
ToolTip="<%$ Resources: General, ViewAll %>">
<
TabTemplate
>
<
asp:Literal
ID
=
"ltrlViewAll"
runat
=
"server"
Text="<%$ Resources: General, ViewAll %>" />
</
TabTemplate
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
Width
=
"900"
ID
=
"radMultiPage"
runat
=
"server"
SelectedIndex
=
"0"
>
<
telerik:RadPageView
ID
=
"rpvTradeName"
runat
=
"server"
>
<
MyUserControl:TradeName
ID
=
"ucTradeName"
runat
=
"server"
/>
</
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"rpvViewAll"
runat
=
"server"
>
<
MyUserControl:ViewAll
ID
=
"ucViewAll"
runat
=
"server"
/>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
TradeName.ascx
<
telerik:RadAjaxManagerProxy
ID
=
"radManager
"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"rgTradeName"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgTradeName"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgvaTradeName"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadGrid
runat
=
"server"
AllowSorting
=
"true"
ID
=
"rgTradeName"
AutoGenerateColumns
=
"false"
OnNeedDataSource
=
"SheetNeedDataSource"
OnItemCommand
=
"SheetItemCommand"
OnDeleteCommand
=
"SheetDeleteCommand"
AllowPaging
=
"true"
PageSize
=
"10"
/>
ViewAll.ascx
<
telerik:RadGrid
ID
=
"rgvaTradeName"
runat
=
"server"
/>