or
| <telerik:RadGrid ID="conditionsGrid" runat="server" Width="252px" |
| Height="116px" GridLines="None" AllowMultiRowSelection="True" |
| onneeddatasource="conditionsGrid_NeedDataSource" Skin="Sunset" CssClass="addedTablesGrid" |
| AutoGenerateEditColumn="True" onitemupdated="conditionsGrid_ItemUpdated" |
| onupdatecommand="conditionsGrid_UpdateCommand" |
| AllowAutomaticUpdates="true" onitemcommand="conditionsGrid_ItemCommand"> |
| <MasterTableView Width="100%"> |
| <NoRecordsTemplate> |
| Drag columns here. |
| </NoRecordsTemplate> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="Column" UniqueName="columnColumn" DataField="columnName" DataType="System.String" EmptyDataText="Ooops" ReadOnly="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn HeaderText="Value" UniqueName="type1"> |
| <ItemTemplate> |
| <asp:DropDownList runat="server"> |
| <asp:ListItem Text="Equals" Value="="></asp:ListItem> |
| <asp:ListItem Text="Greater than" Value=">"></asp:ListItem> |
| <asp:ListItem Text="Less than" Value="<"></asp:ListItem> |
| <asp:ListItem Text="Not equal to" Value="!="></asp:ListItem> |
| </asp:DropDownList> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn HeaderText="Value" UniqueName="valueColumn" DataField="value" > |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowRowsDragDrop="true"> |
| <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| protected void ColumnTreeView_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e) |
| { |
| if (string.IsNullOrEmpty(e.HtmlElementID)) |
| return; |
| if (e.HtmlElementID == "MainBodyPlaceHolder_conditionsGrid") |
| { |
| List<GridConditionRow> added = AddedTableConditions; |
| foreach (RadTreeNode node in e.DraggedNodes) |
| { |
| GridConditionRow Row = new GridConditionRow(); |
| Row.columnName = node.Value; |
| Row.value = ""; |
| added.Add(Row); |
| } |
| AddedTableConditions = added; |
| conditionsGrid.DataSource = AddedTableConditions; |
| conditionsGrid.DataBind(); |
| } |
| } |
| protected void conditionsGrid_UpdateCommand(object source, GridCommandEventArgs e) |
| { |
| //It's here that I can't seem to find the updated information to alter the List with. |
| } |
You can find information about known issues and important changes for the entire UI for ASP.NET AJAX suite in the following pinned thread: Known Issues and Important Changes in UI for ASP.NET AJAX.
Q1 SP2 2010 (Version number: 2010.1.519 and lower)
| <telerik:RadScriptManager runat="server" EnableScriptCombine="false" /> |
| <telerik:RadScriptManager runat="server"> |
| <Scripts> |
| <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" |
| Name="MicrosoftAjax.js" Path="Scripts-40412/MicrosoftAjax.js" /> |
| <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" |
| Name="MicrosoftAjaxWebForms.js" Path="Scripts-40412/MicrosoftAjaxWebForms.js" /> |
| </Scripts> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="MyComboBox" runat="server" Width="250" CausesValidation="false" AutoPostBack="false" MarkFirstMatch="true" AllowCustomText="false" AutoCompleteSeparator=";" ExpandAnimation-Duration="250" AccessKey="O" /> |
Hi
I have a RadListView with a RadComboBox in the fieldset itemtemplate, and the RadComboBox has a CheckBox ItemTemplate.
What I’m need to do is to change the text of the first item in my combobox and hide the checkbox.
It works fine if I have only one combobox but I need this in a ListView.
Thanks,
Nicole
| protected void RadListView1_ItemDataBound(object sender, RadListViewItemEventArgs e) |
| { |
| RadComboBox cmbColores = (RadComboBox)e.Item.FindControl("cbmColores1"); |
| DataTable dt = CargarCombos(); |
| //Add Item |
| dt.Rows.Add(-1, ""); |
| DataView dv = new DataView(); |
| dv = dt.DefaultView; |
| dv.Sort = "NombreCompleto"; |
| DataTable dt1 = dv.ToTable(); |
| cmbColores.DataSource = dt1; |
| cmbColores.DataTextField = "NombreCompleto"; |
| cmbColores.DataValueField = "SKUID"; |
| cmbColores.DataBind(); |
| //change text: first item combobox |
| cmbColores.FindItemByValue("-1").Text = " -- Seleccione --"; |
| RadComboBoxItem item = cmbColores.FindItemByValue("-1"); |
| CheckBox chk = (CheckBox)item.FindControl("chk1"); |
| //first item combobox |
| chk.Visible = false; |
| } |
| <telerik:RadListView ID="RadListView1" Width="100%" AllowPaging="true" runat="server" |
| ItemPlaceholderID="ProductsHolder" DataKeyNames="SKUID" OnNeedDataSource="RadListView1_NeedDataSource" |
| OnItemDataBound="RadListView1_ItemDataBound" OnItemCommand="RadListView1_ItemCommand"> |
| <ItemTemplate> |
| <fieldset> |
| <telerik:RadComboBox ID="cbmColores1" runat="server" Skin="Windows7" Width="180px" |
| EmptyMessage="Color..." LoadingMessage="Cargando..." OnClientDropDownClosed="onDropDownClosing" |
| AutoPostBack="False"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox runat="server" ID="chk1" Checked="false" /> |
| <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1"> |
| <%# DataBinder.Eval(Container.DataItem, "NombreCompleto")%> |
| </asp:Label> |
| </div> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| </fieldset> |
| </ItemTemplate> |
| <LayoutTemplate> |
| <fieldset id="RadListView1" > |
| </fieldset> |
| </LayoutTemplate> |
| </telerik:RadListView> |
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" |
| Culture="auto" %> |
| <%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" |
| Namespace="System.Web.UI.WebControls" TagPrefix="asp" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Untitled Page</title> |
| <style type="text/css"> |
| </style> |
| </head> |
| <body style="height:100%"> |
| <form id="form1" runat="server" style="height:100%"> |
| <asp:ScriptManager runat="server" ID="Manager1"> |
| </asp:ScriptManager> |
| <telerik:RadGrid ID="RadGrid1" runat="server" Width="95%" ShowStatusBar="true" AutoGenerateColumns="False" |
| PageSize="7" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="False" Height="100%" |
| OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" |
| OnPreRender="RadGrid1_PreRender" onitemcommand="RadGrid1_ItemCommand"> |
| <PagerStyle Mode="NumericPages"></PagerStyle> |
| <MasterTableView Width="100%" DataKeyNames="CustomerID" AllowMultiColumnSorting="True" Name="MasterTable" |
| CommandItemDisplay="Top" HierarchyLoadMode="Client"> |
| <CommandItemTemplate> |
| <div align="left"> |
| <asp:LinkButton ID="initInsertLinkButton" runat="server" CommandName="InitInsert">Add new |
| </asp:LinkButton> |
| <asp:LinkButton ID="editSelectedLinkButton" runat="server" CommandName="EditSelected">Edit Selected |
| </asp:LinkButton> |
| </div> |
| </CommandItemTemplate> |
| <ExpandCollapseColumn Visible="True"> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" HeaderButtonType="TextButton" |
| DataField="CustomerID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn SortExpression="ContactName" HeaderText="Contact Name" HeaderButtonType="TextButton" |
| DataField="ContactName"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="Company" HeaderButtonType="TextButton" |
| DataField="CompanyName"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True"></Selecting> |
| <ClientEvents OnRowSelected="RowSelected"></ClientEvents> |
| <Scrolling AllowScroll="true" ScrollHeight="100%" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </form> |
| </body> |
| </html> |
