I am getting error while implement this supposedly very simple looking sceanrio using 2 radbutton.
I have 2 rad buttons on the form as below.
- First I wanted to set the property visiblity to false to one of them based on the session variable set.
- & then alternate the visiblity between the 2 rad buttons when either one is clicked.
The problem is as below. When I set the visiblity=false on click of one button. It works first time. On the next click (of the current visible button),I recieve an error, returns a null error while trying to make the previously made invisible buttom visible.
<telerik:RadButton ID="rb1" runat="server" skin="Vista" Text="Switch to 2" OnClientClicking="OnClick_1" OnClick="OnClicked_1" GroupName="GroupName1" ButtonType="ToggleButton" Visible="false"> </telerik:RadButton> <telerik:RadButton ID="rb2" runat="server" skin="Vista" Text="Switch to 1" OnClientClicking="OnClick_2" OnClick="OnClicked_2" GroupName="GroupName1" ButtonType="ToggleButton"> </telerik:RadButton>var radButton1 = $find("rb1"); radButton1.set_visible(false); var radButton2 = $find("rb2"); radButton1.set_visible(true); Note: There is a another conditional snippet which sets rb1 visiblity to false & rb2 to true.
here rb2 is throwing null (because its visiblity is already set to false), the reason why throwign errror while setting the visibility to true.
Thank you
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.FilterCommandName)
{
Pair filterPair = (Pair)e.CommandArgument;
if (filterPair.First.ToString() == "EqualTo" && filterPair.Second.ToString() == "OrderDate")
{
e.Canceled = true;
RadDatePicker filterBox = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0] as RadDatePicker;
string newFilter = String.Format("((it.[{0}] >= DATETIME'{1}') AND (it.[{0}] <= DATETIME'{2}'))", filterPair.Second, filterBox.SelectedDate.Value.ToString("yyyy-MM-dd" + " 00:00:00"), filterBox.SelectedDate.Value.ToString("yyyy-MM-dd") + " 23:59:59");
if (RadGrid1.MasterTableView.FilterExpression == "")
{
RadGrid1.MasterTableView.FilterExpression = newFilter;
}
else
{
RadGrid1.MasterTableView.FilterExpression = String.Format("(({0}) AND ({1}))", RadGrid1.MasterTableView.FilterExpression, newFilter);
}
GridBoundColumn dateColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("OrderDate");
dateColumn.CurrentFilterValue = filterBox.SelectedDate.Value.ToString();
dateColumn.CurrentFilterFunction = GridKnownFunction.EqualTo;
}
RadGrid1.Rebind();
}
}
However, the problem I have is this.
Hi,
I have extended GridBoundColumn to create a column where filtering can be done by selecting a value in a RadComboBox in the filtering row.
The filtering is triggered in the combobox's index changed event handler:
private void combo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { var combo = (RadComboBox)sender; GridKnownFunction currentFilterFunction = combo.SelectedItem != null && combo.SelectedValue != allValue ? GridKnownFunction.Contains : GridKnownFunction.NoFilter; var filterItem = (GridFilteringItem)(combo.Parent.Parent); filterItem.FireCommandEvent(RadGrid.FilterCommandName, new Pair(currentFilterFunction.ToString(), this.UniqueName)); }protected override string GetCurrentFilterValueFromControl(TableCell cell) { var combo = (RadComboBox)cell.Controls[0]; return combo.SelectedItem != null ? combo.SelectedValue : combo.Text; }I'm thankful for any help!
The RadComboBox now supports multiple selections with its "Checkboxes" property. I would therefore like to implement this functionality to this filtering column as well.
The issue I am having is that I do not know how to filter on multiple values.
In the above example, a filter command is fired containing the filter function and the column's uniquename. TheGetCurrentFilterValueFromControl function then returns what filter value to use. How can I here return multiple values? Or should I attack this issue in a whole different way perhaps? :)
<?xml version="1.0"?><configuration> <configSections> <section name="iconHandler" type="Mvolo.ShellIcons.Web.ShellIconHandlerConfigurationSection" /> <section name="Getron.DBInterface" type="Getron.DBInterface.Config.SectionHandler,Getron.DBInterface.V.1.1.3.1" requirePermission="false" allowDefinition="Everywhere" /> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="GCL.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> <sectionGroup name="Miron.web"> <section name="CompressorSettings" type="Miron.Web.MbCompression.SettingsConfigSection" /> </sectionGroup> </configSections> <Miron.web> <!-- cachingStorage="OutputCache / FileSystem" <CompressorSettings compressCSS="true" Indicate if the module will compress the css files compressJavaScript="true" Indicate if the module will compress the js files compressPage="true" Indicate if the module will compress the HTML content (not minifind!) compressWebResource="true" Indicate if the module will compress the webresources.axd minifyContent="true" Indicate if the module will minify js & css files combineCSS="true" Indicate if the module will combine the css files and place them in the page header combineHeaderScripts="true" Indicate if the module will combine the js files that are in the page header cachingStorage="OutputCache" Indicate if the module will use OutputCache of the Filesystem as a cache. (See details below) autoMode="true" Set to true to tell the module to do all it's magic without having the programmer to change his code. scriptsVersion="1" Append this value to the end of the script include. Change this value will force updating the server and all the client to reload all the script files cssVersion="1"> Append this value to the end of the css include. Change this value will force updating the server and all the client to reload all the css files --> <CompressorSettings compressCSS="true" compressJavaScript="true" compressPage="true" compressWebResource="true" minifyContent="true" combineCSS="true" combineHeaderScripts="true" cachingStorage="OutputCache" autoMode="true" scriptsVersion="1" cssVersion="1"> <excludePaths> <add key="~/DontCompressMe.aspx" /> // Example how to exclude the file DontCompressMe.aspx from being proccessed </excludePaths> <excludeFromMinifyPaths> <add key="~/style.css" /> // Example how to exclude the file ~/style.css from minifing </excludeFromMinifyPaths> <disableByPostParams> <add key="DXScript" /> // Example how to exclude DevExpress ajax async calls from being compressed </disableByPostParams> </CompressorSettings> </Miron.web> <Getron.DBInterface> <provider name="GBH_Default" type="Sql" encrypted="false" connectionString="Server=98.188.101.251,2443;Database=GBHR2;Uid=tt;Pwd=ttt;Persist Security Info=true;"/> </Getron.DBInterface> <system.web> <httpRuntime requestValidationMode="2.0" /> <trace pageOutput="false" requestLimit="10" enabled="false" localOnly="false" traceMode="SortByTime" mostRecent="true" /> <httpHandlers> <remove path="*.asmx" verb="*" /> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <!--<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />--> <add path="css.axd" verb="*" type="Miron.Web.MbCompression.CssCompressionHandler, MbCompression" validate="false" /> <add path="jslib.axd" verb="*" type="Miron.Web.MbCompression.JavaScriptCompressionHandler, MbCompression" validate="false" /> <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" /> <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" /> <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" /> <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" /> <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" /> <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121FAE78165BA3D4" validate="false" /> <add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=5.1.11.713, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" /> <add path="geticon.axd" verb="GET" type="Mvolo.ShellIcons.Web.ShellIconHandler" /> </httpHandlers> <httpModules> <!--<add name="MbCompressionModule" type="Miron.Web.MbCompression.MbCompressionModule, MbCompression"/> Testtt--> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" /> <add name="WebResourceCompressionModule" type="Miron.Web.MbCompression.WebResourceCompressionModule, MbCompression" /> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="Session" type="System.Web.SessionState.SessionStateModule" /> </httpModules> <globalization culture="TR-tr" /> <authentication mode="Forms"> <forms name=".GBH" timeout="60" loginUrl="~/Sections/Common/Login/" defaultUrl="~/Section/User/Default.aspx" protection="All" /> </authentication> <authorization> <allow users="*" /> </authorization> <compilation debug="false" targetFramework="4.0"> <assemblies> <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="Telerik.Reporting, Version=5.1.11.713, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/> <add assembly="Telerik.Reporting.OpenXmlRendering, Version=5.1.11.713, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/> <add assembly="Telerik.ReportViewer.WebForms, Version=5.1.11.713, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/> <add assembly="Telerik.Web.Design, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/></assemblies> </compilation> <pages enableEventValidation="true" validateRequest="false" > <!--<pages enableSessionState="true" pageBaseType="BasePage" userControlBaseType="BaseUserControl" enableEventValidation="false" />--> <controls> <add namespace="Getron.Core.Base.Web.Resource" tagPrefix="GBH" assembly="Getron.Core"/> <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/> <add tagPrefix="telerik" namespace="Telerik.ReportViewer.WebForms" assembly="Telerik.ReportViewer.WebForms"/> <!--<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>--> </controls> <tagMapping> <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0" /> <add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0" /> <add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0" /> <add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0" /> <add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0" /> <add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0" /> </tagMapping> </pages> <customErrors mode="Off"/> </system.web> <iconHandler enabled="true" alwaysUseExtension="true" enableClientCaching="true" enableServerCaching="true" /> <appSettings> <add key="GlobalResourceClassName" value="PDFComboBoxItems,GridCommentItems,GlobalWebPage"/> <add key="MailComposerService.MailComposerService" value="http://abc.abc.com.tr/MailComposer/MailComposerService.asmx"/> <add key="IsJustMainCompany" value="false"/> <add key="AllowCustomProgress" value="false"/> </appSettings> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true"> <remove name="RadUploadModule" /> <remove name="RadCompression" /> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" /> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="managedHandler" /> </modules> <handlers> <remove name="ChartImage_axd" /> <remove name="Telerik_Web_UI_SpellCheckHandler_axd" /> <remove name="Telerik_Web_UI_DialogHandler_aspx" /> <remove name="Telerik_RadUploadProgressHandler_ashx" /> <remove name="Telerik_Web_UI_WebResource_axd" /> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /><add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2011.3.1115.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/> <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" /> <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" /> <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" /> <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" /> <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" /> <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=5.1.11.713, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode" /> <add name="iconhandler" path="geticon.axd" verb="GET" type="Mvolo.ShellIcons.Web.ShellIconHandler" /> </handlers> <security> <requestFiltering> <requestLimits maxAllowedContentLength="33554432"/> </requestFiltering> </security> </system.webServer> <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="50000000"/> </webServices> </scripting> </system.web.extensions></configuration>Hi all,
I have a user control that contains a RadAjaxManagerProxy configured thus:
<telerik:RadAjaxManagerProxy ID="radajaxmanagerproxy1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="linkRefreshCCCLogos"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rCCCLogos" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManagerProxy>I have a repeater that is to be refreshed when a record is edited via RadWindow, which in turn triggers a postback OnClientClose against a hidden linkbutton: (refreshPage is the function I've assigned to OnClientClose, and it does get called and passes the correct argument to refreshBrandingOptions)...
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script language="javascript" type="text/javascript"> function refreshPage(sender, args) { if (args.get_argument() != null) { refreshBrandingOptions(args.get_argument()); } else { } } function refreshBrandingOptions(ElementTypeID) { switch (ElementTypeID) { case 52: // __doPostBack('linkRefreshCCCLogos', ''); break; case 1: __doPostBack('linkRefreshAssets', ''); break; default: alert('Trying to refresh for ElementTypeID: ' + ElementTypeID); //Do nothing } } </script></telerik:RadScriptBlock>If the OnClientClose function is called and triggers the postback, the whole page refreshes.
If I add some dummy text to the linkbutton, stop the OnClientClose event from firing and then manually click the linkbutton, the repeater updates via ajax as it should.
The linkbutton and repeater code:
<asp:LinkButton ID="linkRefreshCCCLogos" runat="server" Text="dddd"></asp:LinkButton><div class="titleDiv" style="padding-left: 24px;"> <asp:Repeater ID="rCCCLogos" runat="server"> <HeaderTemplate> <div style="height: 10px;"> </div> <div class="defaultText" style="width: 100px; display: inline-block; font-weight: bold;"> Process</div> <div class="defaultText" style="width: 180px; display: inline-block; font-weight: bold;"> Asset Name</div> <div class="defaultText" style="width: 140px; display: inline-block; font-weight: bold;"> Position</div> <div class="defaultText" style="width: 120px; display: inline-block; font-weight: bold;"> Size</div> <div class="defaultText" style="width: 170px; display: inline-block; font-weight: bold;"> Colour</div> <div class="defaultText" style="width: 170px; display: inline-block; font-weight: bold;"> Colour 2</div> <div class="defaultText" style="width: 16px; display: inline-block;"> </div> <div class="defaultText" style="width: 16px; display: inline-block;"> </div> <br /> </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblOrderGarmentBrandingID" runat="server" Visible="false" Text=' <%# DataBinder.Eval(Container.DataItem, "OrderGarmentBrandingID")%>'></asp:Label> <div class="defaultText" style="width: 100px; display: inline-block;"> <%# DataBinder.Eval(Container.DataItem, "ProcessName")%></div> <div class="defaultText" style="width: 180px; display: inline-block;"> <%# DataBinder.Eval(Container.DataItem, "AssetName")%></div> <div class="defaultText" style="width: 140px; display: inline-block;"> <%# DataBinder.Eval(Container.DataItem, "PositionName")%></div> <div class="defaultText" style="width: 120px; display: inline-block;"> <%# DataBinder.Eval(Container.DataItem, "SizeName")%></div> <div class="defaultText" style="width: 170px; display: inline-block;"> <%# DataBinder.Eval(Container.DataItem, "Colour1Name")%></div> <div class="defaultText" style="width: 170px; display: inline-block;"> <%# DataBinder.Eval(Container.DataItem, "Colour2Name")%></div> <div class="defaultText" style="width: 16px; display: inline-block; padding-left: 10px;"> <asp:ImageButton ID="btnEditOption" runat="server" ImageUrl="/assets/images/application/icons/small/edit.gif" ImageAlign="Bottom" /></div> <div class="defaultText" style="width: 16px; display: inline-block; padding-left: 10px;"> <asp:ImageButton ID="btnDeleteCCCLogoOption" runat="server" ImageUrl="/assets/images/application/icons/small/delete.gif" ImageAlign="Bottom" /></div> <div style="width: 970px; border-top: 1px dotted #ccc;"> </div> </ItemTemplate> </asp:Repeater></div>
Can anyone shed some light on what's going on here?
Cheers
Rich