การทำ Custom Validation สำหรับ ASPxTextBox กำหนด Properties ปรับ Validation Settings ให้ Enable CustomValidation = true และใน ASPxTextBox ให้กำหนดในส่วนของ ClientSide Event
Category: Devexpress
DevExpress ASPxGridViewExporter เมื่อทำการ Export ข้อมูลภาษาไทยจะไม่แสดง
ASPxGridViewExporter เมื่อทำการ Export ข้อมูลภาษาไทยจะไม่แสดง จะขึ้นตัวอักษรยึกยือ ดังนั้นเมื่อเราต้องการที่จะแก้ไขจะต้องแก้ไขที่ ASPxGridViewExporter แล้วเลือก Properties ->Styles->Default แล้วปรับตรง Font Names เป็น Arial Unicode MS ตัวอย่างปัญหาที่เกิดขึ้นเมื่อ pdf ที่ได้ไม่แสดงภาษาไทย หลังจากนั้นทำการแก้ไขดังภาพ
DevExpress : Get ID from Detail Gridview
เมื่อเราใช้ Master Grid แล้วมี Detail Grid ซ้อนอยู่ในส่วนของ Master Grid เวลาจะเรียกใช้จะต้องทำภายใต้ OnInit protected void ASPxGridView2_Init(object sender, EventArgs e) { GridViewDataTextColumn colTotal
DevExpress : Mask Decimal & Symbol style
ปรับรูปแบบตัวเลขใน textbox ใช้ Mask เป็นตัวจัดการบางทีจะ Error ถ้าเป็นตัวเลขแล้วไม่กำหนดให้ Decimal Symbol ต้องปรับตามภาพด้านล่างในส่วน Properties ของ Mask
ตัวอย่าง Devexpress ถ้า Detail Gridview ไม่มีข้อมูล ให้ยกเลิกปุมที่กดดู Detail
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using DevExpress.Web.ASPxGridView; using DevExpress.Web.Data; using System.Drawing; using System.Collections;
DevExpress AspxGridview ทำให้ Detail Row ขยายออก
เริ่มจากปรับในส่วนของ Events ของ Gridview แล้วใส่ Code protected void ASPxGridView2_DataBound(object sender, EventArgs e) { //if (Convert.ToBoolean(Session[“expandAll”])) //((ASPxGridView)sender).DetailRows.ExpandAllRows(); ((ASPxGridView)sender).ExpandAll(); ((ASPxGridView)sender).SettingsDetail.ShowDetailButtons = true;
DevExpress AspxGridview ให้ Focused Textbox เวลา Edit ข้อมูล
เมื่อปรับแต่ง Gridview และปรับให้สามารถ Edit ข้อมูลใน Gridview ได้แล้วแต่ถ้าข้อมูลมีเยอะแล้วอาจจะทำให้เวลากด New แทนที่หน้าจอจะไป Focus ที่บรรทัดที่เพิ่มข้อมูลมันดันไม่เป็นแบบนั้นให้ทำการแก้ไขดังนี้เริ่มจากปรับ Properties ของ Gridview ในส่วนของ Events ของ Gridview ดังรูป แล้วใส่โค้ดลงไปในส่วนของ
