<telerik:GridDropDownColumn DataField="MondayId" DataSourceID="oOdsPoste" HeaderText="Monday" ListTextField="Code" ListValueField="Id" UniqueName="Monday"> </telerik:GridDropDownColumn>Hi,
I am working on a page which shows hirarchical records through RadTreeList control. Everything looks fine except records with parent id which didnt exists in list. Not sure if this is a limitation of RadTreeList control or if there is any flag which allow to display these kind of records.
I have many records in the table with parent id which didn't exists in the table but we still want to show those records in TreeList control.
To explain the issue, there is test page. As you can see in result, first record ("Appetizers") is not rendering on the page as parent id "Y", didn't exists in list.
Thank you in advance for your help.
Default.aspx
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel> <telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource" ParentDataKeyNames="ParentID" DataKeyNames="ID" AllowPaging="true" PageSize="5" AutoGenerateColumns="false" AllowSorting="true"> <Columns> <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="Category ID" /> <telerik:TreeListTemplateColumn DataField="ProductName" UniqueName="ProductName" HeaderText="Product"> <ItemTemplate> <%# Eval("ProductName")%> </ItemTemplate> <HeaderStyle Width="300px" /> </telerik:TreeListTemplateColumn> <telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" HeaderText="Parent Category ID" /> </Columns> </telerik:RadTreeList>public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadTreeList1_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e) { RadTreeList1.DataSource = MyData.GetData(); } } public class MyData { public static List<MyItem> GetData() { List<MyItem> list = new List<MyItem>(); list.Add(new MyItem("A", "Appetizers", "Y")); list.Add(new MyItem("B", "Beverages", "")); list.Add(new MyItem("C", "Cheese", "")); return list; } } public class MyItem { public string ID { get; set; } public string ProductName { get; set; } public string ParentID { get; set; } public MyItem(string id, string productName, string parentID) { ID = id; ProductName = productName; ParentID = parentID; } }I am receiving records from a web service that are displayed in a
RadGrid. I need to mark certain records as selected based on the
existence of matching records in a database table. The records in
the table were produced from the web service at one time and contain
only matching records. The records are matched via the "AccDesc"
DataKeyNames. Any suggestions would be appreciated.
<radControls:RadGrid ID="AccessoriesGrd" runat="server" Width="780px" AllowMultiRowSelection="true" Visible="true"> <MasterTableView DataKeyNames="AccDesc, Retail, TradeIn" AutoGenerateColumns="false" EnableHeaderContextMenu="true"> <Columns> <radControls:GridClientSelectColumn HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="55px" UniqueName="SelectColumn" ItemStyle-VerticalAlign="Top" /> <radControls:GridBoundColumn DataField="AccDesc" AllowSorting="true" HeaderText="Description" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="350px" ItemStyle-VerticalAlign="Top" /> <radControls:GridTemplateColumn HeaderText="Retail" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="55px" SortExpression="Retail" ItemStyle-HorizontalAlign="Right" ItemStyle-VerticalAlign="Top"> <ItemTemplate> <%#Consumers.StandardFunctions.FormatCurrency(Eval("Retail"))%> </ItemTemplate> </radControls:GridTemplateColumn> <radControls:GridTemplateColumn HeaderText="Trade-In" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="55px" SortExpression="TradeIn" ItemStyle-HorizontalAlign="Right" ItemStyle-VerticalAlign="Top"> <ItemTemplate> <%#Consumers.StandardFunctions.FormatCurrency(Eval("TradeIn"))%> </ItemTemplate> </radControls:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder"> <Selecting AllowRowSelect="true" /> </ClientSettings> </radControls:RadGrid>
Hello
I'm having a bit of a problem with an AJAX update from within a RadTree, I've had a look around the forums and can't find a proper answer to my prolem although I have stumbled across a couple of posts that given me a couple of ideas. Anyway, here is my problem, I hope someone can help.
What I'm effectivly trying to do is differentiate between clicking on a node in a RadTreeVew (to update the main panel) and dragging a node in a RadTreeView (to update a graph) during an AJAX update, unfortuately it seems that the EventName property of the RadAjaxManager AjaxSetting does not work as mentioned in this post (http://www.telerik.com/community/forums/aspnet-ajax/ajax/ajax-manager-event-filter.aspx) reading on on this post Nicholas Walker (10th post) suggests a workaround in which you use the OnClientNodeClicked and OnClientNodeDropped properties of the RadTreeView to fire some JavaScript which modifies(?) the RadAjaxManager. I can get one or the other to work and I'm not really sure how the JavaScript fits in, ideally for one or the other, I want to disable the opposite manager update but I'm not sure how this could be done with javascript, or whether it could be done at all.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="radTree" EventName="onTreeViewNodeDrop"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="divWatchMeasureChart1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="lbMeasureName" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="radTree" EventName="onTreeViewNodeClicked"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="mainRight" LoadingPanelID="RadAjaxLoadingPanel1"/> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <div class="treeHolder"> <telerik:RadTreeView ID="radTree" Runat="server" Skin="Windows7" onclientnodedatabound="OnClientNodeDataBoundHandler" onnodeclick="radTree_NodeClick" EnableDragAndDrop="True" OnNodeDrop="RadTreeView1_NodeDrop" OnClientNodeClicked="onTreeViewNodeClicked" OnClientNodeDropped="onTreeViewNodeDrop"> <WebServiceSettings Path="~\Controls\WebController.aspx" Method="GetChildren" /> </telerik:RadTreeView> <div> <telerik:RadScriptBlock runat="server"> <script language="javascript"> function OnClientNodeDataBoundHandler(sender, e) { var node = e.get_node(); node.set_toolTip(node.get_attributes().getAttribute("ToolTip")); } function onTreeViewNodeClicked(sender, eventArgs) { var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); if (ajaxManager != null) { var settings = ajaxManager.get_ajaxSettings(); for (setting in settings) { var initiatingControl = settings[setting].InitControlID; var controls = settings[setting].UpdatedControls; if (initiatingControl == '<%= radTree.ClientID %>') { for (control in controls) { if (controls[control].ControlID != "mainRight") {//disable all other updates perhaps? } } } } ajaxManager.set_ajaxSettings(settings); } } function onTreeViewNodeDrop(sender, eventArgs) { var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); if (ajaxManager != null) { var settings = ajaxManager.get_ajaxSettings(); for (setting in settings) { var initiatingControl = settings[setting].InitControlID; var controls = settings[setting].UpdatedControls; if (initiatingControl == '<%= radTree.ClientID %>') { for (control in controls) { if (controls[control].ControlID != "CntrlViewOverview1_divWatchMeasureChart1") {//disable all other updates perhaps? } } } } ajaxManager.set_ajaxSettings(settings); } } </script> </telerik:RadScriptBlock>
Hi,
I am using Radgrid to display/retrieve/update data in an Access database.
Although I am able to delete and addd records, I cannot update.
There are no errors being displayed....I update the field(s) and press OK to accept the changes...but the new changes are not saved..the listing shows again the previous record/field...
As I said, no errors are shown after pressing ok.
Here is the code below (not all, but I assume is where the problem might be?)
II have not changed or added anything manual to the code.
Thank you in advance
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Registro_Planchas_be.mdb" DeleteCommand="DELETE FROM [Tabla Registro Planchas] WHERE [Nº] = ?" InsertCommand="INSERT INTO [Tabla Registro Planchas] ([FECHA], [REFERENCIA], [PROVEEDOR], [REFERENCIA PEDIDO], [MAQUINA], [MARCA], [MEDIDA], [TROQUEL], [DISEÑO]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" SelectCommand="SELECT * FROM [Tabla Registro Planchas]" UpdateCommand="UPDATE [Tabla Registro Planchas] SET [FECHA] = ?, [REFERENCIA] = ?, [PROVEEDOR] = ?, [REFERENCIA PEDIDO] = ?, [MAQUINA] = ?, [MARCA] = ?, [MEDIDA] = ?, [TROQUEL] = ?, [DISEÑO] = ? WHERE [Nº] = ?"> <DeleteParameters> <asp:Parameter Name="Nº" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="FECHA" Type="DateTime" /> <asp:Parameter Name="REFERENCIA" Type="String" /> <asp:Parameter Name="PROVEEDOR" Type="String" /> <asp:Parameter Name="REFERENCIA_PEDIDO" Type="String" /> <asp:Parameter Name="MAQUINA" Type="String" /> <asp:Parameter Name="MARCA" Type="String" /> <asp:Parameter Name="MEDIDA" Type="String" /> <asp:Parameter Name="TROQUEL" Type="String" /> <asp:Parameter Name="DISEÑO" Type="String" /> </UpdateParameters> <br> </UpdateParameters>