currently using Telerik WebUI VSExtensions 2011.02.915.0
Regards,
K
If TypeOf e.Item Is GridDataItem AndAlso e.Item.OwnerTableView.Name = "myReIssueGrid" Then
If (e.CommandName = "Cancel") Then
Dim ReIssueId As Integer = e.CommandArgument
sql = "Execute sp_ReIssueCancel " & ReIssueId & ", " & Convert.ToInt32(HFPersId.Value)
insertUpdateDelete(sql)
'FillIssue(HFPersId.Value)
myIssueGrid.Rebind()
End If
End If
Protected Sub myIssueGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myIssueGrid.NeedDataSource
sql = "Select dr.strSN, dr.intTranstypeId, dm.strManufacturer + ' ' + mm.strMake + ' - ' + m.strModel Item, tt.strTransaction, i.intIssuedId, CONVERT(varchar(10), i.dtIssued, 111) DT_Issued, " _
& "p.strFullname + '\' + p.strRank IssuedTo, ftQTY From Drat_Issued i INNER JOIN Drat_Received dr on dr.intRecId = i.intRecId INNER JOIN Drat_TransactionType tt on tt.intTransTypeId = dr.intTransTypeId " _
& "INNER JOIN Drat_Model m on m.intModelId = dr.intModelID INNER JOIN Drat_Make mm on mm.intMakeId = m.intMakeId INNER JOIN Drat_Manufacturer dm on dm.intManufacturerId = mm.intManufacturerID INNER JOIN " _
& "MnNgPersonnel.dbo.tblMNNatPersonnel p on p.intPersonnelId = i.intIssuedTo Where bitSigned Is Not NULL And bitTakeOffHR Is NULL And bitTransfer Is NULL and intIssuedto = " & HFPersId.Value & ""
myIssueGrid.DataSource = getData(sql)
End Sub
Protected Sub myIssueGrid_DetailTableDataBind(sender As Object, e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles myIssueGrid.DetailTableDataBind
If e.DetailTableView.Name = "myReIssueGrid" Then
sql = "Select ri.intReIssueId, ri.intIssuedId, CONVERT(varchar(10), ri.dtIssue, 111) DT_Issue, intReIssueBy, p.strFullname + '\' + p.strRank IssuedBy, mn.strFullname + '\' + mn.strRank IssuedTo " _
& "From Drat_ReIssue ri LEFT JOIN Drat_Issued i on i.intIssuedId = ri.intIssuedId LEFT JOIN drat_Received dr on dr.intRecId = i.intRecId LEFT JOIN MnNgPersonnel.dbo.tblMNNatPersonnel p on " _
& "p.intPersonnelId = ri.intReIssueBy INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel mn on mn.intPersonnelId = ri.intReIssueTo Where i.bitReIssue = 1 And ri.bitAccepted Is NULL AND " _
& "ri.intIssuedId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intIssuedID")
e.DetailTableView.DataSource = getData(sql)
End If
End Sub
intReIssueId is neither a DataColumn nor a DataRelation for table Table.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: intReIssueId is neither a DataColumn nor a DataRelation for table Table.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: intReIssueId is neither a DataColumn nor a DataRelation for table Table.]
System.Data.DataRowView.get_Item(String property) +2725340
Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +238
[GridException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.]
Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +1220
Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +431
Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +161
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1450
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +858
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +94
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +182
Telerik.Web.UI.GridTableView.PerformSelect() +206
Telerik.Web.UI.GridTableView.DataBind() +441
Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +2337
Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +158
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +50
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +102
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
I’m creating a radgrid like this, I bound the data to first four columns, in the last column, I create a GridTemplateColumn, and want to do like this: when click “action”, it will generate a dropdown list let you to choose edit, delete or email. The question is, how can I achieve the row data(especially the quote ID) when clicking the GridTemplateColumn cell, I can’t get it through, please help. Thank you!
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Default"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
PageSize
=
"26"
Height
=
"720px"
AllowSorting
=
"True"
AllowPaging
=
"True"
AllowFilteringByColumn
=
"True"
Skin
=
"Office2010Blue"
CellSpacing
=
"0"
GridLines
=
"None"
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
Selecting
CellSelectionMode
=
"None"
AllowRowSelect
=
"true"
></
Selecting
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
ScrollHeight
=
"686px"
/>
<
ClientEvents
OnRowMouseOver
=
"quotes_DataGridRowMouseOverV2"
OnRowSelected
=
"quotes_DataGridFunction_V2"
/>
<
Resizing
AllowColumnResize
=
"true"
AllowResizeToFit
=
"true"
ResizeGridOnColumnResize
=
"true"
EnableRealTimeResize
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"ID"
ClientDataKeyNames
=
"ID,Bill_CompanyName"
DataSourceID
=
"SqlDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ID column"
HeaderText
=
"Quote #"
ReadOnly
=
"True"
SortExpression
=
"ID"
UniqueName
=
"ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CreateDateTime"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter CreateDateTime column"
HeaderText
=
"Create Date&Time"
SortExpression
=
"CreateDateTime"
UniqueName
=
"CreateDateTime"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Bill_CompanyName"
FilterControlAltText
=
"Filter Bill_CompanyName column"
HeaderText
=
"Customer Name"
SortExpression
=
"Bill_CompanyName"
UniqueName
=
"Bill_CompanyName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"QuoteTotal"
FilterControlAltText
=
"Filter QuoteTotal column"
HeaderText
=
"Quote Total"
SortExpression
=
"QuoteTotal"
UniqueName
=
"QuoteTotal"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Action"
UniqueName
=
"TemplateColumn"
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"HyperLink1"
runat
=
"server"
>Action</
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString
=
"Data Source=192.168.1.92,32071;Initial Catalog=EZPricing2;Persist Security Info=True;User ID=tem;Password=sim32071#@)&!"
ProviderName
=
"System.Data.SqlClient"
SelectCommand
=
"SELECT ID, Bill_CompanyName, CreateDateTime, QuoteTotal FROM tb_Quote WHERE (SalesRepId = @SalesRepId)"
>
<
SelectParameters
>
<
asp:Parameter
DefaultValue
=
"97"
Name
=
"SalesRepId"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
</
div
>
</
form
>
</
body
>
I have a RadComboBox and I am attempting to retrieve the selected item in JavaScript. Using .NET 4.0. in FireFox 11.0.
The RadComboBox is as follows:
<
telerik:RadComboBox
ID
=
"ddlBillingState"
runat
=
"server"
AppendDataBoundItems
=
"True"
DataTextField
=
"Name"
DataValueField
=
"StateProvinceID"
ondatabinding
=
"ddlBillingState_DataBinding"
ondatabound
=
"ddlBillingState_DataBound"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Select a State"
/>
</
Items
>
</
telerik:RadComboBox
>
The above RadComboBox resides inside a FormView ID=VendorFormView.
When I use the following code the JavaScript terminates before the second alert is issued. The statement with the get_selectedItem call seems to be failing. The following JavaScript is contained with the Header section of the page in which the RadComboBox resides. This JavaScript runs when the user clicks a CheckBox on the page. The ddlBillingState control does have a selected item, which was selected by the user, but when I attempt to retrieve the selected item the JavaScript terminates.
Any help would be greatly appreciated.
var ddlBillingState = document.getElementById('<%=VendorFormView.FindControl("ddlBillingState").ClientID%>');
var ddlShippingState = document.getElementById('<%=VendorFormView.FindControl("ddlShippingState").ClientID%>');
if (ddlBillingState != null && ddlShippingState != null)
{
alert("Assigning selected billing state");
var selectedBillingItem = ddlBillingState.get_selectedItem();
alert("selectedBillingItem assigned");
var shippingItem = ddlShippingState.findItemByText(selectedBillingItem.get_text());
alert("Shipping Item assigned");
shippingItem.select();
alert("Done");
}