RadGrid with filters is bound to a collection of objects. When filter changes, there is an async postback during which I can determine the filters by examining FilterExpression property which has the values like this:
(iif(CatalogNumber == null, \"\", CatalogNumber).ToString().ToUpper().StartsWith(\"na\".ToUpper()))
What I want to do with this is filter the collection of object on server which the grid is bound to and looks like this:
private List<LineItem> _lineItems = new List<LineItem>
{
new LineItem { Id="4300", CatalogNumber="ab" },
new LineItem { Id="4301", CatalogNumber="naf-1"}
}
};
I am not sure how FilterExpression can be used in this situation and why it has these "iif" and so on. I don't want brute force method of parsing it out and thinking that there maybe a reason why it has this format. How can I plug it in to the custom collection to filter it?
-Stan
protected void Page_Load(object sender, EventArgs e) { } protected void subMenu_ItemClick(object sender, RadMenuEventArgs e) { switch (e.Item.Value) { case "Window1": { if (!ClientScript.IsStartupScriptRegistered("OpenStartupWindow1")) ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenStartupWindow1", "Sys.Application.add_load(OpenWindow1);", true); } break; case "Window2": { if (!ClientScript.IsStartupScriptRegistered("OpenStartupWindow2")) ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenStartupWindow2", "Sys.Application.add_load(OpenWindow2);", true); } break; } }}<body> <div id="div1" runat="server"> <script type="text/javascript"> function OpenWindow1() { var oWnd = radopen("WebForm1.aspx", "wndWebForm1"); } function OpenWindow2() { var oWnd = radopen("WebForm2.aspx", "wndWebForm2"); } </script> </div> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadWindowManager ID="RadWindowManagerEmails" ShowContentDuringLoad="false" VisibleStatusbar="false" runat="server" EnableShadow="true"> <Windows> <telerik:RadWindow ID="wndWebForm1" runat="server" Behaviors="Close,Move,Resize" Width="1100" Height="600" NavigateUrl="WebForm1.aspx"> </telerik:RadWindow> <telerik:RadWindow ID="wndWebForm2" runat="server" Behaviors="Close,Move,Resize" Width="600" Height="600" NavigateUrl="WebForm2.aspx"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> <telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1" > <AjaxSettings> <telerik:AjaxSetting AjaxControlID="subMenu"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="txt1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <div style="display: block; width: 100%; height: 30px;"> <telerik:RadMenu ID="subMenu" runat="server" EnableViewState="false" Orientation="Horizontal" SkipLinkText="" CausesValidation="true" OnItemClick="subMenu_ItemClick"> <Items> <telerik:RadMenuItem Text="Open Window 1" Value="Window1" /> <telerik:RadMenuItem Text="Open Window 2" Value="Window2" /> </Items> </telerik:RadMenu> </div> <telerik:RadTextBox ID="txt1" runat="server" Width="400px"> </telerik:RadTextBox> </form></body>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> <ItemStyle CssClass="MyImageButton" /> </telerik:GridEditCommandColumn>
But when I click on edit ImageButton it dose not preserve the selected row states and all checkBox return to unchecked State.Is there any way to preserve the state in edit mode?
I tried to add eventHandler in ItemCreated like this
if (e.Item is GridDataItem) { e.Item.PreRender += new EventHandler(RadGrid1_ItemPreRender); }
and
private void RadGrid1_ItemPreRender(object sender, EventArgs e) { ((sender as GridDataItem)["CheckBoxTemplateColumn"].FindControl("CheckBox1") as CheckBox).Checked = (sender as GridDataItem).Selected; } but it didnt fire at edit time.
Sincerely yours,
Bahram.
<telerik:RadComboBox runat="server" ID="comboBoxAddress" AllowCustomText="True" DataSourceID="objDataSourceAddress" EnableLoadOnDemand="True" Filter="Contains" DataTextField="FirstName" EmptyMessage="Suchen nach Adressen..." Width="289px" MaxHeight="100px"></telerik:RadComboBox><asp:ObjectDataSource ID="objDataSourceAddress" runat="server" TypeName="Logic.AddressBll" SelectMethod="Select"></asp:ObjectDataSource>| protected void OnExportContentEvent( object sender,EditorExportingArgs e ) { |
| string rtf = e.ExportOutput; |
| SaveNote( rtf ); |
| ... |
| } |
