Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Usually small questions that occur while using the DevExpress controls can be answered quickly. This article contains a list of frequently asked, and short answers provided with additional information required to solve an issue.
                                    It is planned to enlarge the Knowledge Base article constantly. If the available information becomes very large, it will be divided into several articles for easier navigation.

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                General ASP.NET Questions

                                Q: When a website that uses the DevExpress controls is validated using W3C Markup Validation Service, results show that it does not have valid XHTML layout. Why?
                                A:
                                It is possible that you check the website using the Validate by URI option. Since we render different layout for different browsers (to provide the same look-and-feel), we check which browser tries to open a page. However, the validator does not have an appropriate User Agent string, and thus we cannot generate HTML code for it correctly.
                                The only option that will give you correct results is the Validate by direct input option. You should open a web page that you want to validate in a required browser, then open its source code, and copy the code to the validator text area.
                                A similar issue was reviewed in the ASPxRoundPanel does not pass the W3C validation report.

                                Q: A page looks normal in a local machine, but it is broken on deployed site for IE9/IE8 browser. Why?
                                A:
                                If the deployment machine operates with Windows Server 2003 with IIS6, the issue can be caused by the fact that the IIS6 initially has a setting that forces a browser to display a page in the IE7 Compatibility mode. Please see the Force IE7 Compatibility Mode in IE8 with IIS settings article that demonstrates the setting. If the setting is set, we recommend you remove it to allow browsers display a page in their native mode.

                                jQuery / jQuery UI Questions

                                Using jQuery / jQuery UI libraries with DevExpress ASP.NET Controls / MVC Extensions

                                ASPxEditor Suite Questions

                                Q: When an editor (for example, ASPxCheckBox) is bound to a field using its "main" property (the ASPxCheckBox.Checked property), the server throws NullReferenceException when the New (sometimes Edit) button is clicked.
                                A:
                                This happens because the edited data item provides a property with the Null value. The property of the simple type cannot use null values, and thus the server throws the exception. If you want to bind editors to database fields, you should use the ASPxEdit.Value property.
                                ASPxGridView - How to implement a two-way data-binding with editors located on Edit Form
                                ASPxGridView - How to use two-way data-binding expressions with the ASPxCheckBox control

                                Q: Why it is not possible to get selected items of the ASPxListBox control on the server side?
                                A: Usually, the issue happens when the ASPxListBox.ValueType property is not set to a correct value. For example, if the ASPxListBox.ValueField property uses an integer DB field, the value of the ASPxListBox.ValueType should have the System.Int32 value. If the type is set to a proper value, check the ASPxListBox.Items.Count property value. Zero result means that the listbox does not have items, and thus you should bind it to a datasource in the control's Init event handler. In rare cases, the Items collection might have items that did not exist on the client side (e.g. if you use selection command with different parameters). In this case, you should check each item in the listbox to be sure that the control has same values which were selected on the client side.

                                Q: In some times, it is not possible to get a selected item of ASPxComboBox (e.g. NullReferenceException is thrown for the SelectedItem.Value property). How to process such issue?
                                A:
                                There are similar steps to check what goes wrong as for ASPxListBox. You should check that the ValueField includes a correct value (System.Int32, System.Decimal, etc). Also, you should check that the combo box has an appropriate item (if a datasource changes between requests, the selected item might disappear).

                                Q: Why does a multi column ASPxListBox/ASPxComboBox have the Items collection empty when it is bound using the IsPostBack "if" condition?
                                A:
                                Due to performance reasons, a multi-column control does not store items in ViewState. If you have the control with the disabled ViewState (or have at least a column in the Columns collection), you should bind it to a datasource during each page request.

                                Q: I have just created a new web site, dragged your controls from the Toolbox and drop on a page. When the web site is opened in the browser, I see that the ASPxClientXXX object is undefined.
                                A: The issue happened because you dropped our controls on the Source page and did not switch it to Designer. Our controls require the HttpHandler Module registered in the web.config file.
                                Please read the How to: Manually Register a HttpHandler Module help article to see how the module should be registered.

                                Q: When a browser zoom level does not equal to 100%, some controls are displayed incorrectly.
                                A:
                                The Zoom level that is not equal to 100% might return incorrect values for standard functions used in JavaScript. For example, some browsers return dimensions multiplied by a zoom level, but others do not. There is a suggestion article in our Support Center aimed for non-100% zoom level support: Support browsers zoom feature.

                                Q: When a data-binding expression is used for the ClientSideEvents object the following exception is thrown: Databinding expressions are only supported on objects that have a DataBinding event.
                                A:
                                Data-binding expressions can be used for objects, which have the DataBinding event. Since our controls have nested objects, it is possible to use expressions in the root tag only. Additional information regarding the issue is provided in the Databinding expressions are only supported on objects that have a DataBinding event report.

                                Q: I use one of your control with the server-side Visible property set to false. Why I cannot manipulate its visibility via the client-side SetVisible method?
                                A:
                                If you set the server-side Visible property to false, it is impossible to manipulate a control on the client side, because it is not rendered on the page. Use the ClientVisible property instead. Then, the control is rendered on the web page, but it is initially hidden on the client side, so you will be able to manage the control visibility via JavaScript.

                                Q: Why are the ASPxListBox.Callback and ASPxComboBox.Callback events raised automatically when a postback is performed?
                                A: These events are required to change the Items collection for ASPxListBox/ASPxComboBox. Often a control uses the latest collection (for example, a selected item is chosen from the latest Items collection, which was populated via a callback). However, since it is not possible to retrieve items from ViewState (because ViewState is not updated during callbacks: The Concept of Callbacks), they will not be persisted. For your convenience, these controls check a request type. If a user clicks a postback button (performs a postback), ASPxListBox/ASPxComboBox restore their previous Items collections by raising a corresponding event with a previously remembered parameter. When the Items collection is restored, a control will be able to apply postback data correctly.
                                Nevertheless, selected items might be lost when the control is empty. This might happen when a non listbox or combobox callback is performed (for example, when the user clicks the Update button of ASPxGridView). In this case, the user would need to fill the control with actual items using its Init event handler). The control does not always raise this event because this approach helps make code faster: often it is required to get a selected item Text and Value property values.

                                ASPxGridView Suite Questions

                                Q: Is it possible to copy selected/focused row values to the clipboard using JavaScript?
                                A:
                                For security reasons, it is not possible to operate the clipboard using JavaScript. However, you can examine a possible solution, which is available on the Web: How to Copy to Clipboard in JavaScript.

                                Q: Why does not the asp:FileUpload control send files to the server during the update operation if it is placed on the Edit Form?
                                A:
                                When you work with callbacks, the FileUpload control does not transfer files to the server side. You should disable the EnableCallBacks property to make the code work.
                                It is possible to upload files using grid's callbacks and the ASPxUploadControl component. In this case, two requests are required: one should be sent to upload a file and store it somewhere on the server and the other one to perform an update:
                                Image Upload in ASPxGridView
                                How to upload files from the EditForm
                                Inserting of a new row in ASPxGridView with the image preview enabled

                                Q: Why should ImageButton be clicked twice to send a command to the server when the button is used in ASPxGridView?
                                A:
                                ImageButton does not work during callbacks, and thus you should either use the grid in postback mode or replace ImageButton with the ASPxButton control. The same issue is already reviewed in the The ImageButton does not send a command in the RowClick when the page index is changed in the ASPxGridView report.
                                You will find a more detailed explanation of the issue in our forum thread.

                                Q: How to make a Boolean editor checked when the New button is clicked?
                                A:
                                It is possible to initialize values in the Edit Form using the ASPxGridView.InitNewRow event in the following manner:

                                [C#]
                                e.NewValues["checkedField"] = true;
                                [VB.NET]
                                e.NewValues("checkedField") = True
                                Q: How to change text of a total summary
                                A:
                                It is possible to change a total summary caption using the ASPxSummaryItem.DisplayFormat property.

                                Q: Why two-way data-binding expressions do not work for editors placed into some container in grid templates?
                                A:
                                This issue occurs because an editor container (e.g. ASPxPanel, ASPxRoundPanel, ASPxPageControl, even asp:Wizard) implements the INamingContainer interface. That is why in ASP.NET framework all expressions work in one and the same way.
                                A possible and reliable resolution is described in the ASPxGridView - Two-way data-binding expressions stop working for editors placed within a container thread.

                                Q: How to align hyperlinks in the GridViewDataHyperLink column?
                                A:
                                It is possible to do this via the CellStyle.HorizontalAlign style property.
                                ASPxGridView - How to change a horizontal alignment for GridViewDataHyperLinkColumn

                                Q: If I cast any IEnumerable collection to the IQueryable type and use it in the LinqServerModeDataSource.Selecting event handler, the grid filters records in case-sensitive mode. Why?
                                A: When you have a collection of objects, the LINQ-To-Objects provider is used for LINQ expressions. The string filtering feature uses the String.Contains method, which is case-sensitive. Server Mode should be used for data which is not stored in server memory (for example, you have a data source which is able to provide the IQueryable object). In the opposite case, when all records are stored in memory, Server Mode degrades server performance.
                                If you want to have a case-insensitive filtration for a collection of objects, you can assign them directly to the ASPxGridView.DataSource property.

                                Q: How to deal with the "Specified Method Not Supported" exception when the Update button is pressed?
                                A:
                                This exception is thrown because the grid cannot update a datasource using some public interface (this exception is applied for all editing operations including the Delete command). This means that this interface does not exist in this object. For example, if the DataTable is used, this exception is thrown because the object is simple and cannot be edited as a regular datasource (e.g. SqlDataSource).
                                A possible solution is to handle the following events manually and use the manual updating:
                                ASPxGridView.RowInserting
                                ASPxGridView.RowUpdating
                                ASPxGridView.RowDeleting
                                In this case, the e.Cancel property should have the True value.
                                Editing an in-memory dataset

                                Q: When I define custom images for GridViewDataCheckColumn I do not see them on the page, but they are loaded by the browser?
                                A:
                                Since v2011 vol 1, ASPxCheckBox uses images instead of the <input> tag. Now, all images are rendered as background images. To make the code work, you should define the Width and the Height properties.
                                See note from the CheckBoxProperties.DisplayImageChecked help article.
                                BC1218: GridViewDataCheckColumn - The DisplayImageChecked/DisplayImageUnchecked/DisplayImageGrayed image rendering mechanism has been changed.

                                Q: I use a button inside the DataItemTemplate. Why the button Click event is not fired after performing a grid callback (e.g. sorting, filtering, etc.)?
                                A:
                                This problem usually occurs when a control located inside the DataItemTemplate has a static ID. In this case, multiple control instances are created with the same ID. Thus, it is impossible to determine which button performs a postback to the server and PostData cannot be loaded correctly when processing a grid callback. To overcome this issue, define a unique ID for each template control. For instance, you can do this in the control’s Init event handler based on a row key value:

                                [ASPx]
                                <DataItemTemplate> <asp:Button ID="btn1" runat="server" onclick="btn1_Click" onInit="tbItemNo_Init"> </asp:Button> </DataItemTemplate>
                                [C#]
                                protected void btn1_Init(object sender, EventArgs e) { Button btn = sender as Button; GridViewDataItemTemplateContainer container = btn.NamingContainer as GridViewDataItemTemplateContainer; btn.ID = "btn1" + container.KeyValue; }
                                Q: How to refresh a master grid when a detail grid is updated?
                                A:
                                By default, ASPxGridView operates via callbacks. It means that the grid can update its own rendering, but not the rendering of outside controls. When the master and detail grids have a common record, you will not see changes in the master grid after modifying the detail grid. It is necessary to refresh the master grid forcibly by calling the Refresh method.
                                The sample code is illustrated in the ASPxGridView - How to refresh a master grid when updating a detail grid thread.

                                Q: How to use ASPxGridLookup in the ASPxGridView edit item template? Because when data-binding expressions are used the "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control" exception is thrown during ASPxGridLookup editing.
                                A:
                                The exception can be overcome if the data-binding expression is replaced with the runtime binding code (ASPxGridView - Using ASPxGridLookup with the editing functionality inside EditItemTemplate causes an exception).
                                When it is not required to edit grid lookup records, two-way data-binding expressions will make code simpler: How to use two-way data-bound ASPxGridLookup in edit form of ASPxGridView to edit data.

                                Q: How to change the default filter condition in the Filter Row popup menu?
                                A:
                                To change the filter condition for an individual column, use the GridViewDataColumnSettings.AutoFilterCondition property.

                                Q: Why are all editors rendered ReadOnly when the grid is bound to a collection of objects?
                                A:
                                The grid takes information about fields from properties of an edited object. If the property does not have a setter or is marked as read-only by some attributes, the grid will render all editors read-only. For example, when a collection of anonymous objects is bound to the grid (this usually happens in LINQ queries), this effect will be achieved (anonymous objects do not allow changing their properties).
                                There are two possible solutions:
                                - do not use anonymous objects (use strongly typed queries);
                                - disable the e.Editor.ReadOnly property in the ASPxGridView.CellEditorInitialize event handler.

                                ASPxperience Suite Questions

                                Q: How to hide borders for a splitter pane content of the ASPxSplitter control?
                                A:
                                To hide the borders, you should change the SplitterPane.PaneStyle property styles.
                                We also have a report, where a similar functionality is demonstrated: ASPxSplitter - How to append a top header to a page with a splitter if both the page and the splitter have width and height equal to 100% .

                                Q: How to change tabs/tab pages height in ASPxTabControl?
                                A:
                                If tabs are aligned horizontally, you should change the ASPxTabControlBase.TabStyle.Height style property. For vertical tabs, the TabStyle.Width property should be changed. The tab control does not allow tabs with different heights (horizontal alignment) or widths (vertical alignment). Unnecessary content will be truncated.

                                Q: How to show a popup control via code?
                                A:
                                There are many ways to show a popup control. Please examine the following samples located in our Code Central:
                                How to show the ASPxPopupControl
                                How to show and hide a popup window via server side code

                                Q: I have changed ASPxPopupControl properties at runtime, when clicking a button for example. Why the click event is no more raised for ASPxButton that is located inside ASPxPopupControl?
                                A:
                                The button Click event is raised after loading the ViewState. If the ASPxPopupControl settings are modified, its hierarchy should be recreated again after the ViewState is loaded. For this, set the EnableHierarchyRecreation property to true.

                                ASPxTreeList Suite Questions

                                Q: Is it possible to have several command buttons (e.g. two New buttons)?
                                A:
                                ASPxTreeList does not allow several New buttons. However, you can create more than one Custom Command button. To process a button's clicks, handle the ASPxClientTreeList.CustomButtonClick event.
                                This approach is described in the following Help article: How to: Create Custom Command Buttons

                                Q: How to make a Boolean editor checked when the New button is clicked?
                                A:
                                It is possible to initialize values in the Edit Form using the ASPxTreeList.InitNewNode event in the following manner:

                                [C#]
                                e.NewValues["checkedField"] = true;
                                [VB.NET]
                                e.NewValues("checkedField") = True

                                MVC Extensions Questions

                                Q: Is it possible to use routes in the NavigateUrlFormatString property?
                                A: You can use the Url.Action property to format a route to an appropriate link:

                                [C#]
                                String urlFormatString = Url.Action("Home", "SomeAction", new RouteValueDictionary(new { id = "{0}" })); properties.NavigateUrlFormatString = HttpUtility.UrlDecode(urlFormatString);

                                Q: How to get a value of an editor extension in the Controller's Action
                                A:
                                Use the EditorExtension.GetValue[T] method for this purpose. For instance:

                                [C#]
                                ViewData["History"] = CheckBoxExtension.GetValue<Boolean>("cbHistory"); ViewBag.Message = String.Format("ComboBox's value is{0}", ComboBoxExtension.GetValue<System.Int32>("MyComboBox"));

                                Q: When I submit a value from ComboBox to a Controller's Action, my Model retrieves a displayed item text instead of a selected Value
                                A:
                                This usually happens when the DevExpressEditorsBinder binder is not defined. In this case, a default Model binder cannot determine how to get necessary values from our input tags.
                                Check that you use DevExpress Model Binder object either in a Controller's Action, or in Global.asax.cs (as a replacement of the default binder).
                                Without the proper binder, other extensions with a complex layout (such as DateEdit) might return incorrect values.

                                to be continued...

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners