Here is the Asp part: <label for=”chkCondition”> <asp:CheckBox ID=”chkCondition” Text=”Should i show the div?” runat=”server” onclick=”ShowHideDiv(this)” /> </label> <hr /> <div id=”divToShowOrHide” style=”display: none”> this div will be shown regarding the checkbox checked status. <asp:TextBox ID=”myTextBox” runat=”server” /> </div> And here is the Javascript part: <script type=”text/javascript”> function ShowHideDiv(chkCondition) { var divToShowOrHide = document.getElementById(“divToShowOrHide”); divToShowOrHide.style.display […]
Tag: devexpress
How to create the ShowBlanksValue and ShowNonBlanksValue items in Devex Grid
By design, GridViewDataComboBoxColumn does not render (Blank) and (NonBlank) items if the HeaderFilterMode property is set to CheckedList. However, you can add these items in the HeaderFilterFillItems event handler. Just call the FilterValue.CreateShowBlanksValue and FilterValue.CreateShowNonBlanksValue methods. <dx:ASPxGridView ID=”grid” runat=”server” AutoGenerateColumns=”False” DataSourceID=”dsCategories” KeyFieldName=”CategoryID” OnHeaderFilterFillItems=”grid_HeaderFilterFillItems”> <Columns> <dx:GridViewDataTextColumn FieldName=”CategoryID”> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn FieldName=”Description”> </dx:GridViewDataTextColumn> <dx:GridViewDataComboBoxColumn FieldName=”CategoryNameNull” Caption=”Category Name”> <Settings HeaderFilterMode=”CheckedList” /> <PropertiesComboBox DataSourceID=”dsCategories” ValueField=”CategoryNameNull” TextField=”CategoryNameNull” /> </dx:GridViewDataComboBoxColumn> </Columns> […]
Add default value to Devex Grid Columns in C#
protected void grid_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e) { e.NewValues[“BirthDate”] = new DateTime(1970, 1, 10); e.NewValues[“Title”] = “Sales Representative”; } Here is the result:
How to apply a custom CSS class to Devexpress components
For all the Devex Components, you can use ControlStyle > CssClass property to apply your custom CSS class (Example 1 and 2) or you can do it with parameter (if it is allowed – as in Example 3). Here is 3 examples for MVC: @Html.DevExpress().SpinEditFor(m => m.Books.Rating, settings => { settings.Properties.SpinButtons.ShowIncrementButtons = true; settings.Properties.Increment = […]
How to Solve The ‘Object reference not set to an instance of an object’ error in Batch Edit mode for ASPxGridView
The issue occurs in Batch Edit Mode, because in this mode an empty invisible row is created and used for further grid editing. Since the Eval method returns a value type of an object, your attempt to call the ToString() method to the null value can lead to an exception. If you remove this conversion and use <%# […]
Confirm before process with ASPxButton in Devexpress
If you want to confirm before process with ASPxButton in Devexpress, then you can try the code below:
How to set Tooltip for a particular Devexpress Gridview Column
You can use code below:
Devexpress ASPxGridview Column Grouping in Code
The following code shows how to group by two columns (“Country” and “City”).
How to solve “Response.Redirect cannot be called in a Page callback” for DevExpress Components
DevExpress.Web.ASPxClasses.ASPxWebControl.RedirectOnCallback(“the_redirect_page.aspx”);