HI all,
I've got a grid that uses a web service as a datasource. I've got a method in the web service to retrieve and filter data as needed.
The data retrieves and filter okay but when I select a row from the filter, client-side, then try to retrieve a value from the selected row in the filter it comes up with  & or no value. However it works if I physically click on a row when I set up a row selected event to retrieve the value.
In other words, selecting a row in javascript code doesn't work. Do I need to rebind the grid or something. I've tried many different samples/solutions and nothing seems to work.
Here's the service, Grid, and Javascript from the client.
I've got a grid that uses a web service as a datasource. I've got a method in the web service to retrieve and filter data as needed.
The data retrieves and filter okay but when I select a row from the filter, client-side, then try to retrieve a value from the selected row in the filter it comes up with  & or no value. However it works if I physically click on a row when I set up a row selected event to retrieve the value.
In other words, selecting a row in javascript code doesn't work. Do I need to rebind the grid or something. I've tried many different samples/solutions and nothing seems to work.
Here's the service, Grid, and Javascript from the client.
using System; using System.Linq; using System.Runtime.Serialization; using System.Web.Services; using System.ServiceModel; using System.ServiceModel.Activation; using System.ServiceModel.Web; using System.Collections.Generic; using System.Collections; using Telerik.Web.UI; using System.Reflection; namespace DC { [DataContract] public class POCN_hdr { [DataMember] public int MfgAssocDocID { get; set; } [DataMember] public int? MfgOrderID { get; set; } [DataMember] public string ponumber { get; set; } [DataMember] public string vendname { get; set; } [DataMember] public string vendorid { get; set; } [DataMember] public string country { get; set; } [DataMember] public string vndclsid { get; set; } [DataMember] public DateTime? docdate { get; set; } [DataMember] public string hold { get; set; } [DataMember] public string shipmthd { get; set; } } [DataContract] public class POCN_det { [DataMember] public string ponumber { get; set; } [DataMember] public string itemnmbr { get; set; } [DataMember] public decimal? qtyorder { get; set; } [DataMember] public string itemdesc { get; set; } [DataMember] public string postatus { get; set; } [DataMember] public string shipmthd { get; set; } [DataMember] public DateTime? released_date { get; set; } [DataMember] public DateTime? prmdate { get; set; } [DataMember] public DateTime? reqdate { get; set; } } } public class MyData { public int Count { get; set; } public IList Data { get; set; } } [ServiceContract] [ServiceKnownType("GetKnownTypes")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class POCNAssocDocService { public static IEnumerable<Type> GetKnownTypes(ICustomAttributeProvider provider) { List<Type> knownTypes = new List<System.Type>(); knownTypes.Add(typeof(DC.POCN_hdr)); knownTypes.Add(typeof(DC.POCN_det)); return knownTypes; } [OperationContract] public MyData retrievePOCN_HdrDataAndCount(int startRowIndex, int maximumRows, string sortExpression, string filterExpression) { maximumRows = 20; if (filterExpression != "") { filterExpression = filterExpression.Replace("\"", string.Empty); } else { filterExpression = "MfgOrderID = -1"; } GridBindingData data = RadGrid.GetBindingData("AppDataClassesDataContext", "MOAssocDocuments", startRowIndex, maximumRows, sortExpression, filterExpression); MyData result = new MyData(); result.Data = data.Data.OfType<MOAssocDocument>().Select(c => new DC.POCN_hdr() { MfgAssocDocID = c.MfgAssocDocID, MfgOrderID = c.MfgOrderID, ponumber = c.POHdr.ponumber, vendname = c.POHdr.vendname, vendorid = c.POHdr.vendorid, country = c.POHdr.country, vndclsid = c.POHdr.vndclsid, docdate = c.POHdr.docdate, hold = c.POHdr.hold, shipmthd = c.POHdr.shipmthd }).ToList(); result.Count = data.Count; return result; } [OperationContract] public MyData retrievePOCN_DetDataAndCount(int startRowIndex, int maximumRows, string sortExpression, string filterExpression) { // maximumRows = 50; if (filterExpression == "") { filterExpression = "qtyorder = -999999"; } else { string sPoNumb = filterExpression.Substring(13, 8); AppDataClassesDataContext appDB = new AppDataClassesDataContext(); var dq = from dqr in appDB.PODets where dqr.ponumber == sPoNumb select dqr; if (dq.Count() == 0) { filterExpression = "qtyorder = -999999"; } } GridBindingData data = RadGrid.GetBindingData("AppDataClassesDataContext", "PODets", startRowIndex, maximumRows, sortExpression, filterExpression); MyData result = new MyData(); result.Data = data.Data.OfType<PODet>().Select(o => new DC.POCN_det() { ponumber = o.ponumber, itemnmbr = o.itemnmbr, qtyorder = o.qtyorder, itemdesc = o.itemdesc, postatus = o.postatus, shipmthd = o.shipmthd, released_date = o.released_date, prmdate = o.prmdate, reqdate=o.reqdate }).ToList(); result.Count = data.Count; return result; } }<telerik:RadGrid ID="rdGridAsgPOHdr" runat="server" AllowPaging="false" AllowSorting="false" Height="100px" AllowFilteringByColumn="false" GridLines="None" EnableEmbeddedSkins="false" Skin="WebBlue" AllowMultiRowSelection="false" ItemStyle-Font-Names="'segoe ui',arial,sans-serif;" ItemStyle-Font-Size="9px" AutoGenerateColumns="false" AlternatingItemStyle-Font-Names="'segoe ui',arial,sans-serif;" AlternatingItemStyle-Font-Size="9px" HeaderStyle-Font-Names="'segoe ui',arial,sans-serif;" HeaderStyle-Font-Size="9px"> <MasterTableView ClientDataKeyNames="ponumber" DataKeyNames="ponumber" AllowMultiColumnSorting="false" TableLayout="Fixed" NoMasterRecordsText="<div style='width: 705px; font-size: 9px; font-family: 'segoe ui',arial,sans-serif;'>No assigned po details to display.</div>"> <CommandItemStyle CssClass="commViewCommand" /> <ItemStyle CssClass="comments" /> <AlternatingItemStyle CssClass="comments" /> <Columns> <telerik:GridBoundColumn DataField="ponumber" HeaderText="PO#" UniqueName="ponumber" ItemStyle-Width="40px" HeaderStyle-Width="40px" /> <telerik:GridBoundColumn DataField="vendname" HeaderText="Vendor" UniqueName="vendname" ItemStyle-Width="400px" HeaderStyle-Width="400px" /> <telerik:GridBoundColumn DataField="vendorid" HeaderText="VID" UniqueName="vendorid" ItemStyle-Width="40px" HeaderStyle-Width="40px" /> <telerik:GridBoundColumn DataField="docdate" HeaderText="Doc Dt" UniqueName="docdate" DataFormatString="{0:MM/dd/yy}" ItemStyle-Width="35px" HeaderStyle-Width="35px" /> <telerik:GridBoundColumn DataField="shipmthd" HeaderText="Ship Via" UniqueName="shipmthd" ItemStyle-Width="105px" HeaderStyle-Width="105px" /> <telerik:GridBoundColumn DataField="detCnt" ItemStyle-Width="1px" ItemStyle-BackColor="White" HeaderStyle-Width="1px" ItemStyle-ForeColor="White" UniqueName="detCnt" ItemStyle-CssClass="commViewCommand"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MfgOrderID" DataType="System.Int32" HeaderText="MfgOrderID" HeaderStyle-Width="1px" UniqueName="MfgOrderID" ItemStyle-Width="1px" ItemStyle-CssClass="commViewCommand"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MfgAssocDocID" DataType="System.Int32" HeaderText="MfgAssocDocID" HeaderStyle-Width="1px" UniqueName="MfgAssocDocID" ItemStyle-Width="1px" ItemStyle-CssClass="commViewCommand"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings> <DataBinding Location="../Services/POCNAssocDocService.svc" FilterParameterType="Linq" SelectMethod="retrievePOCN_HdrDataAndCount" SortParameterType="Linq"> </DataBinding> <ClientEvents OnDataBinding="rdGridAsgPOHdr_DataBinding"/> <Selecting AllowRowSelect="true" /> <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" /> </ClientSettings> </telerik:RadGrid>rdGridPOHdr = $find('<%= rlMOView.FindControl("rdGridAsgPOHdr").ClientID %>'); var tableView = rdGridPOHdr.get_masterTableView(); tableView.filter("MfgOrderID", mfgID, "EqualTo"); tableView.clearSelectedItems(); var dataItem = tableView.get_dataItems()[0]; dataItem.set_selected(true); var selectedRows = tableView.get_selectedItems(); for (var i = 0; i < selectedRows.length; i++) { var row = selectedRows[i]; var cell = tableView.getCellByColumnUniqueName(row, "ponumber") //here cell.innerHTML holds the value of the cell }