or
| <telerik:RadGrid ID="RadGrid1" runat="server" > |
| </telerik:RadGrid> |
| public void PopulateStoreMenu(Menu ctrlMenu); |
If you insert data in both tables and try to filter by any content in the ForeignDesc column it doesn't return anything, it only works if you use the IDForeign content in the filter. It should be possible to use the ForeignDesc content for filtering the data, no?
What am I doing wrong? Here's what I have.
| <telerik:RadGrid ID="rdTableForeign" runat="server" DataSourceID="sdsTable" AllowPaging="True" |
| ShowFooter="True" AutoGenerateColumns="False" AllowSorting="True" EnableViewState="true" |
| AllowFilteringByColumn="True" AllowAutomaticInserts="False" AllowAutomaticUpdates="True"> |
| <GroupingSettings CaseSensitive="false" /> |
| <MasterTableView DataKeyNames="IDTable" AutoGenerateColumns="false" AllowMultiColumnSorting="True" |
| EnableViewState="true" EnableColumnsViewState="true"> |
| <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" /> |
| <Columns> |
| <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderText="Edit" ButtonType="ImageButton"> |
| <ItemStyle Width="50px" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridBoundColumn DataField="TableDesc" HeaderText="Description" UniqueName="TableDesc" DataType="System.String"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDropDownColumn DataSourceID="dsForeign" ListTextField="ForeignDesc" |
| AllowFiltering="true" ListValueField="IDForeign" UniqueName="GridDropDownColumn" |
| SortExpression="ForeignDesc" HeaderText="Foreign" DropDownControlType="RadComboBox" |
| DataField="IDForeign" DataType="System.String"> |
| </telerik:GridDropDownColumn> |
| </Columns> |
| <EditFormSettings> |
| <EditColumn ButtonType="ImageButton" /> |
| </EditFormSettings> |
| </MasterTableView> |
| <ClientSettings> |
| <Resizing AllowColumnResize="true" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="sdsTable" ConnectionString="<%$ ConnectionStrings:MyConnection %>" |
| SelectCommand="SELECT * FROM [Table]" runat="server" UpdateCommand="wcspTableUpdate" |
| UpdateCommandType="StoredProcedure"> |
| <UpdateParameters> |
| <asp:Parameter Name="IDTable" Type="Int32" /> |
| <asp:Parameter Name="TableDesc" Type="Int32" /> |
| </UpdateParameters> |
| </asp:SqlDataSource> |
| <asp:SqlDataSource runat="server" ID="dsForeign" ConnectionString="<%$ ConnectionStrings:MyConnection %>" |
| SelectCommand="SELECT [IDForeign], [ForeignDesc] FROM [Foreign]"></asp:SqlDataSource> |
Thanks for any help!
Tauz
| <telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="IdPost" |
| DataSourceID="EntityDataSourceNews" AllowPaging="True" ItemPlaceholderID="itemPlaceholder" InsertItemPosition="None" |
| OnItemCommand="RadListView1_ItemCommand" PageSize="1"> |
| <LayoutTemplate> |
| <asp:PlaceHolder ID="itemPlaceholder" runat="server" /> |
| <br /> |
| <telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="1"> |
| <Fields> |
| <telerik:RadDataPagerSliderField /> |
| </Fields> |
| </telerik:RadDataPager> |
| <br /> |
| <asp:Button ID="btnInitInsert" runat="server" Text="Ajouter une news" onclick="btnInitInsert_Click" /> |
| </LayoutTemplate> |
| <ItemTemplate> |
| <div id="Historique" class="ui-widget-content ui-corner-all"> |
| <h2 class="ui-widget-header ui-corner-all"> |
| <div style="float:right; font-size:10px"> |
| <img src="/Images/famfamfam/date.png" /><em><%# Eval("Date") %></em> |
| </div> |
| <%# Eval("Titre") %> |
| </h2> |
| <p class="borbot"> |
| <%# Eval("PostContent") %> |
| </p> |
| <div style="float:right; margin-right:5px"> |
| <asp:ImageButton ID="DeleteButton" runat="server" CommandName="Delete" |
| CssClass="rlvBDel" Text="Supprimer" ImageUrl="~/Images/famfamfam/Delete.gif" /> |
| </div> |
| <asp:ImageButton ID="EditButton" runat="server" CommandName="Edit" |
| CssClass="rlvBEdit" Text="Editer" ImageUrl="~/Images/famfamfam/Edit.gif" /> |
| <br /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadListView> |
| <asp:EntityDataSource ID="EntityDataSourceNews" runat="server" |
| ConnectionString="name=PortailEntrepriseEntities" |
| DefaultContainerName="PortailEntrepriseEntities" EnableDelete="True" |
| EnableFlattening="False" EnableInsert="True" EnableUpdate="True" |
| EntitySetName="Posts" OnInserting="EntityDataSourceNews_Inserting" |
| OrderBy="it.Date DESC"> |
| </asp:EntityDataSource> |
| div.Ironwood.RadGrid_Default .rgFooter td |
| { |
| border-bottom:0px; |
| padding-left:4px!important; |
| padding-right:4px!important; |
| } |
| div.ManagersInTheNews.RadGrid_Default .rgRow, |
| div.ManagersInTheNews.RadGrid_Default .rgAltRow, |
| div.ManagersInTheNews.RadGrid_Default .rgRow td, |
| div.ManagersInTheNews.RadGrid_Default .rgAltRow td |
| { |
| font-family:Arial; |
| font-size:11px; |
| border-bottom:0px!important; |
| vertical-align:middle!important; |
| padding-left:4px!important; |
| padding-right:4px!important; |
| } |
| <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="CollectionModifyProblem._Default" %> |
| <%@ 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> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <%="Select a Brand (norally I use a var here):"%> |
| <telerik:RadListBox ID="lstbBrands" runat="server"></telerik:RadListBox> |
| <%="Select a Type: (norally I use a var here)"%> |
| <telerik:RadListBox ID="lstbCarTypes" runat="server"></telerik:RadListBox> |
| </div> |
| <telerik:RadAjaxManager runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="lstbBrands"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lstbCarTypes" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| </form> |
| </body> |
| </html> |
After a while I replaced the two code-blocks with labels:
| <%="Select a Brand (norally I use a var here):"%> |
| to |
| <asp:Label runat="server" ID="lblTitle_Brands">Select a Brand (noraly I fill this by code):</asp:Label> |
and
| <%="Select a Type (norally I use a var here):"%> |
| to |
| <asp:Label runat="server" ID="lblTitle_Type">Select a Type (noraly I fill this by code):</asp:Label> |
That's all you have to do!
Maybe this will help also others!
Freundliche Grüsse
Marcel