I have a BAQ Data View on a Dashboard and a text box is bound to the Ship Date field. I would like for that textbox to be formatted with just the date and not the time.
epiTextBox11.Text is the one that is bound. I have tried setting Extended Properties and it isn’t working. This is that code:
private void SetExtendedProperties()
{
// Begin Wizard Added EpiDataView Initialization
EpiDataView edvGS_Order_Detail_DataView = ((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"]));
// End Wizard Added EpiDataView Initialization
// Begin Wizard Added Conditional Block
if (edvGS_Order_Detail_DataView.dataView.Table.Columns.Contains("OrderDtl_RequestDate"))
{
// Begin Wizard Added ExtendedProperty Settings: edvGS_Order_Detail_DataView-OrderDtl_RequestDate
edvGS_Order_Detail_DataView.dataView.Table.Columns["OrderDtl_RequestDate"].ExtendedProperties["Format"] = "shortyeardate";
// End Wizard Added ExtendedProperty Settings: edvGS_Order_Detail_DataView-OrderDtl_RequestDate
}
Okay, I’m sorry, I’m not understanding what I do with what you sent me. I tried this but it isn’t working.
{
// Begin Wizard Added EpiDataView Initialization
EpiDataView edvGS_Order_Detail_DataView = ((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"]));
// End Wizard Added EpiDataView Initialization
// Begin Wizard Added Conditional Block
if (edvGS_Order_Detail_DataView.dataView.Table.Columns.Contains("OrderDtl_RequestDate"))
{
// Begin Wizard Added ExtendedProperty Settings: edvGS_Order_Detail_DataView-OrderDtl_RequestDate
edvGS_Order_Detail_DataView.dataView.Table.Columns["OrderDtl_RequestDate"].ExtendedProperties["Format"] = "dd-MM-yyyy";
// End Wizard Added ExtendedProperty Settings: edvGS_Order_Detail_DataView-OrderDtl_RequestDate
}
And this epiTextBox11.Text.ToString(dd-MM-yyyy);
And I get errors about Error: CS0103 - line 757 (11524) - The name ‘dd’ does not exist in the current context
Error: CS0103 - line 757 (11524) - The name ‘MM’ does not exist in the current context
Error: CS0103 - line 757 (11524) - The name ‘yyyy’ does not exist in the current context
I am calling it when after I publish an order number to the BAQ Data View. It then brings all my order information into text boxes. I want that text box to format as a date and not show the time.
I dont understand this issue. The solution to your problem is definitely best solved by using that DateTime control. You would use that control and set the binding to EDVName.FieldName