精华内容
下载资源
问答
  • Devexpress MVC Gridview

    2019-08-13 01:24:08
    column.EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.True; column.SetDataItemTemplateContent(container => { if (container.VisibleIndex ) return; var ls_Url = DataBinder.Eval...

    1. 根据选中的KeyValue 来获取其他field的value

    // Gridview settings
    settings.CustomJSProperties = (s, e) => { Dictionary<object, int> visibleIndices = new Dictionary<object, int>(); for (int i = 0; i < ((MVCxGridView)s).VisibleRowCount; i++) visibleIndices.Add(((MVCxGridView)s).GetRowValues(i, ((MVCxGridView)s).KeyFieldName), i); e.Properties["cpIndices"] = visibleIndices; }; //javascript调用 GridView.cpIndices[Key,"fieldName")

      

    2. 根据某些field的value来改变cell的backcolor

    //Gridview settings
    
     settings.HtmlDataCellPrepared = (sender, e) =>
                {
                    var gv = sender as MVCxGridView;
                    string ls_Status = gv.GetRowValues(e.VisibleIndex, "Status") == null ? "" : gv.GetRowValues(e.VisibleIndex, "Status").ToString();
                    string[] la_EditorField = new string[] { "TaxInvCust", "IseVAT", "TaxInvRemark" };
                    if (ls_Status != "1" && la_EditorField.Contains(e.DataColumn.FieldName))
                    {
                        e.Cell.BackColor = System.Drawing.Color.Transparent;
                    }
                };
    

     

    3.通过jquery获取gridview cell的value. 

    //Gridview settings, id format =  gridviewname_fieldname_visableIndex
    
       settings.HtmlDataCellPrepared = (sender, e) =>
                {
                    e.Cell.Attributes.Add("id", string.Format("{0}_{1}_{2}", settings.Name, e.DataColumn.FieldName, e.VisibleIndex));
                };


    //JavaScript function 
    function GetCellText(as_GridViewName,as_fieldName,ai_Index)
        {
            var ls_Amt = "";
            var ls_text = $("#" + as_GridViewName + "_" + as_fieldName + "_" + ai_Index).text();
            ls_Amt = parseFloat(ls_text.substring(0, ls_text.indexOf(".") + 3).replace(/\,/g,"")).toFixed(2);
            return ls_Amt;
        }
    

      

      

    4.设置hyperlink column

    //Gridview settings
    settings.Columns.Add(column => { column.FieldName = "TaxInvNo"; column.Caption ="Tax Inv. No."; column.Width = 90; column.EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.True; column.SetDataItemTemplateContent(container => { if (container.VisibleIndex < 0) return; var ls_Url = DataBinder.Eval(container.DataItem, "Url").ToString(); if (ls_Url != null && ls_Url != "") { helper.DevExpress().HyperLink(hyperlink => { var li_VisibleIndex = container.VisibleIndex; var ls_KeyValue = container.KeyValue; hyperlink.Name = "h1" + ls_KeyValue; hyperlink.Properties.Text = DataBinder.Eval(container.DataItem, "TaxInvNo").ToString(); hyperlink.Properties.TextField = "TaxInvNo"; hyperlink.NavigateUrl = ls_Url.ToString(); hyperlink.Properties.Target = "_blank"; }).Render(); } else { if (DataBinder.Eval(container.DataItem, "TaxInvNo") != null) helper.ViewContext.Writer.Write(DataBinder.Eval(container.DataItem, "TaxInvNo").ToString()); } }); });//Tax Inv. No

      

     

    转载于:https://www.cnblogs.com/hesijian/p/8630578.html

    展开全文
  • devexpress mvc4页面布局

    热门讨论 2012-12-15 20:29:23
    iframe页面布局,分为头部,左边,和main展示页面mvc4
  • = "") { helper.DevExpress().HyperLink(hyperlink => { var li_VisibleIndex = container.VisibleIndex; var ls_KeyValue = container.KeyValue; hyperlink.Name = "h1" + ls_KeyValue; hyperlink.Properties.Text ...
    1. 根据选中的KeyValue 来获取其他field的value
    // Gridview settings<br>  settings.CustomJSProperties = (s, e) =>
                {
                    Dictionary<object, int> visibleIndices = new Dictionary<object, int>();
                    for (int i = 0; i < ((MVCxGridView)s).VisibleRowCount; i++)
                        visibleIndices.Add(((MVCxGridView)s).GetRowValues(i, ((MVCxGridView)s).KeyFieldName), i);
                    e.Properties["cpIndices"] = visibleIndices;
                };
     
    //javascript调用
     
    GridView.cpIndices[Key,"fieldName")
    
    1. 根据某些field的value来改变cell的backcolor
    //Gridview settings
     
     settings.HtmlDataCellPrepared = (sender, e) =>
                {
                    var gv = sender as MVCxGridView;
                    string ls_Status = gv.GetRowValues(e.VisibleIndex, "Status") == null ? "" : gv.GetRowValues(e.VisibleIndex, "Status").ToString();
                    string[] la_EditorField = new string[] { "TaxInvCust", "IseVAT", "TaxInvRemark" };
                    if (ls_Status != "1" && la_EditorField.Contains(e.DataColumn.FieldName))
                    {
                        e.Cell.BackColor = System.Drawing.Color.Transparent;
                    }
                };
    

    3.通过jquery获取gridview cell的value.

    //Gridview settings, id format =  gridviewname_fieldname_visableIndex
     
       settings.HtmlDataCellPrepared = (sender, e) =>
                {
                    e.Cell.Attributes.Add("id", string.Format("{0}_{1}_{2}", settings.Name, e.DataColumn.FieldName, e.VisibleIndex));
                };<br><br><br>
    
    //JavaScript function
    function GetCellText(as_GridViewName,as_fieldName,ai_Index)
        {
            var ls_Amt = "";
            var ls_text = $("#" + as_GridViewName + "_" + as_fieldName + "_" + ai_Index).text();
            ls_Amt = parseFloat(ls_text.substring(0, ls_text.indexOf(".") + 3).replace(/\,/g,"")).toFixed(2);
            return ls_Amt;
        }
    

    4.设置hyperlink column

    //Gridview settings<br>  settings.Columns.Add(column =>
                {
                    column.FieldName = "TaxInvNo";
                    column.Caption ="Tax Inv. No.";
                    column.Width = 90;
                    column.EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.True;
                    column.SetDataItemTemplateContent(container =>
                    {
                        if (container.VisibleIndex < 0)
                            return;
     
                        var ls_Url = DataBinder.Eval(container.DataItem, "Url").ToString();
                        if (ls_Url != null && ls_Url != "")
                        {
                            helper.DevExpress().HyperLink(hyperlink =>
                            {
                                var li_VisibleIndex = container.VisibleIndex;
                                var ls_KeyValue = container.KeyValue;
                                hyperlink.Name = "h1" + ls_KeyValue;
                                hyperlink.Properties.Text = DataBinder.Eval(container.DataItem, "TaxInvNo").ToString();
                                hyperlink.Properties.TextField = "TaxInvNo";
                                hyperlink.NavigateUrl = ls_Url.ToString();
                                hyperlink.Properties.Target = "_blank";
                            }).Render();
                        }
                        else
                        {
                            if (DataBinder.Eval(container.DataItem, "TaxInvNo") != null)
                                helper.ViewContext.Writer.Write(DataBinder.Eval(container.DataItem, "TaxInvNo").ToString());
                        }
                    });
                });//Tax Inv. No
    

    //获取gridview里面的combo box 显示的文本

    //获取某个column在gridview的 index
     RightGridView.GetColumnByField("FunUID").index
    //获取gridview里面的combo box 显示的文本
    RightGridView.batchEditHelper.GetCellTextContainer(visibleindex ,columnIndex).textContent
    
    Double Click event里面. 获取当前鼠标选择的值
    //s.GetFocusedCell().rowVisibleIndex 获取当前选中行的index
    //s.GetFocusedCell().column.fieldName 获取当前选中行的field
    s.batchEditApi.GetCellValue(s.GetFocusedCell().rowVisibleIndex,s.GetFocusedCell().column.fieldName)
    

    在Double Click event里面. 获取当前鼠标选择的列的值

    //自定义计算footer的summary
    //首先将需要自定义计算的field 设置为 DevExpress.Data.SummaryItemType.Custom
     
    settings.CustomSummaryCalculate = (s, e) =>
            {
     
                ASPxSummaryItem summary = e.Item as ASPxSummaryItem;
                if (e.IsTotalSummary)
                {
     
                    int li_totalValue = 0;
                    decimal ld_totalValue = 0;
                    for (int i = 0; i < ((MVCxGridView)s).VisibleRowCount; i++)
                    {
                        if (summary.FieldName == "QTY")
                        {
                            if ((((MVCxGridView)s).GetRowValues(i, "TranType") == DBNull.Value ? "" : ((MVCxGridView)s).GetRowValues(i, "TranType").ToString()) == "IN")
                                li_totalValue += Convert.ToInt32(((MVCxGridView)s).GetRowValues(i, "QTY"));
                            else
                                li_totalValue -= Convert.ToInt32(((MVCxGridView)s).GetRowValues(i, "QTY"));
                            e.TotalValue = li_totalValue;
                        }
                    }
                    e.TotalValueReady = true;
                }
            };
    

    //在Column里面显示Button(包含当添加新行时无法触发onclick event)

    //在Column里面显示Button(包含当添加新行时无法触发onclick event)
    partial view
     
       settings.Columns.Add(column =>
            {
                column.Caption = "...";
                column.FieldName = "btnDlvAddress";
                column.UnboundType = DevExpress.Data.UnboundColumnType.String;
                column.Width = 50;
                column.SetDataItemTemplateContent(container =>
                {
     
                    Html.DevExpress().Button(b =>
                    {
                        b.Name = "btnDlvAddress" + container.KeyValue;
                        b.Text = "...";
                        b.Width = Unit.Percentage(100);
                        b.ClientSideEvents.Click = "function(s,e){ OnSearchDlvAddress(); }";
                        b.ClientEnabled = true;
                        b.EnableClientSideAPI = true;
                        b.ClientVisible = true;
                    }).Render();
     
                });
            });
     
    <br><br>
    
    Index.cshtml
     
    function OnSearchDlvAddress()
    {
     
    }
     
    //使用Gridview的StartEdit event 处理当时新行的时候 call function
     function OnTruReqGridView_BatchStartEdit(s,e)
        {
            e.cancel = true;
        if(e.focusedColumn.fieldName == "btnDlvAddress")
            {
                e.cancel = true;
                if(ModalTruReqGridView.batchEditApi.IsNewRow(e.visibleIndex))
                    OnSearchDlvAddress();
            }
    }
    

    //判断Gridview里面某行的某列是否有修改

    //agdv_Grid.batchEditApi.HasChanges(行号, 列名orID)
    var lb_IsEdit = Gridview.batchEditApi.HasChanges(0, "ColumnName");
     
    //lb_IsEdit 将返回true or false
    
    展开全文
  • 之前的devExpress控件产生的一张pivotGrid在上一张chart在下的布局 然后一次性导出这俩到一个excel文件中。现在在mvc下 列表是可以像之前一样产生 问题就是mvc下这2个控件都有自己的导出excel方法,也就是说会分别...
  • @Html.DevExpress().DropDownEdit(settings => { settings.Name = "psBankCharge"; ...

     

         @Html.DevExpress().DropDownEdit(settings =>
                                       {
                                           settings.Name = "psBankCharge";
                                           settings.ControlStyle.Border.BorderColor = System.Drawing.Color.LightGray;
                                           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                                           settings.Height = System.Web.UI.WebControls.Unit.Pixel(34);
                                           settings.ControlStyle.CssClass = "form-control dx-dropdown";
                                           settings.Properties.NullText = @Utils.GetTranslation("Select") + " " + @Utils.GetTranslation("Bank Charge");
                                           settings.Properties.NullTextStyle.CssClass = ":-moz-placeholder";
                                           settings.Properties.DropDownWindowStyle.BackColor = System.Drawing.Color.FromArgb(0xEDEDED);
    
                                           settings.SetDropDownWindowTemplateContent(c =>
                                           {
                                               @Html.DevExpress().ListBox(
                                                       listBoxSettings =>
                                                       {
                                                           listBoxSettings.Name = "lbBankCharge";
                                                           listBoxSettings.ControlStyle.Border.BorderWidth = 0;
                                                           listBoxSettings.ControlStyle.BorderBottom.BorderWidth = 1;
                                                           listBoxSettings.ControlStyle.Border.BorderColor = System.Drawing.Color.LightGray;
                                                           listBoxSettings.ControlStyle.BorderBottom.BorderColor = System.Drawing.Color.FromArgb(0xDCDCDC);
                                                           listBoxSettings.Height = System.Web.UI.WebControls.Unit.Pixel(200);
                                                           listBoxSettings.Width = System.Web.UI.WebControls.Unit.Percentage(99.99);
                                                           listBoxSettings.Properties.SelectionMode = ListEditSelectionMode.CheckColumn;
                                                           listBoxSettings.Properties.ClientSideEvents.SelectedIndexChanged = "function(s, e){ ListBoxMultipleSelectionChanged(psBankCharge, s, e);}";
                                                           listBoxSettings.Properties.ValueType = typeof(string);
                                                           listBoxSettings.Properties.Items.Add("(Select all)");
                                                           foreach (ListEditItem item in (System.Collections.IEnumerable)ViewData["BankCharge"])
                                                           {
                                                               listBoxSettings.Properties.Items.Add(item.Text, item.Value);
                                                           }
                                                       }
                                                   ).Render();
                                               ViewContext.Writer.Write("<div style=\"margin: 6px; overflow hidden;\">");
                                               @Html.DevExpress().Button(
                                                   buttonSettings =>
                                                   {
                                                       buttonSettings.Name = "btnCloseBankCharge";
                                                       buttonSettings.Text = "Close";
                                                       buttonSettings.ControlStyle.CssClass = "btn btn-default";
                                                       buttonSettings.ClientSideEvents.Click = "function(s, e){ psBankCharge.HideDropDown(); }";
                                                   }
                                               ).Render();
                                               ViewContext.Writer.Write("</div>");
                                           });
    
                                           settings.DisabledStyle.BackColor = System.Drawing.Color.FromArgb(0xEEEEEE);
                                           settings.Properties.AnimationType = DevExpress.Web.AnimationType.None;
                                           settings.Properties.ClientSideEvents.TextChanged = "function(s, e){ SynchronizeListBoxMultipleValues(s, lbBankCharge); }";
                                           settings.Properties.ClientSideEvents.DropDown = "function(s, e){ SynchronizeListBoxMultipleValues(s, lbBankCharge); }";
                                       }).GetHtml()
    

      

    //选中指定的Item, 
    SelectItemByValue(cboModalDepCode,lboModalDepCode,Value);

    全部取消选中(多选)

    ResetListBox(cboSearchDepCode, lboSearchDepCode);

    全部取消选中(单选)

     ResetSingleListBox(cboSearchDateOption,lboSearchDateOption);

    获取选中的值(单选)

    GetValuesByTexts(GetSelectedItemsText_Single(lboModalPackType.GetSelectedItems()), lboModalPackType);

    获取选中的值(多选)

    GetValuesByTexts(GetSelectedItemsText(lbBraCode.GetSelectedItems()).split(gs_TextSeparator),lbBraCode)

     

     

    var gs_TextSeparator = ",";
    
    function UpdateSelectAllItemState(ao_lbListBox) {
        IsAllSelected(ao_lbListBox) ? ao_lbListBox.SelectIndices([0]) : ao_lbListBox.UnselectIndices([0]);
    }
    
    function IsAllSelected(ao_lbListBox) {
        for (var i = 1; i < ao_lbListBox.GetItemCount() ; i++)
            if (!ao_lbListBox.GetItem(i).selected)
                return false;
        return true;
    }
    
    function UpdateText(ao_lbListBox, ao_ddlDropDown, ab_IsSingle) {
        if (ab_IsSingle)
            ao_ddlDropDown.SetText(GetSelectedItemsText_Single(ao_lbListBox.GetSelectedItems()));
        else
            ao_ddlDropDown.SetText(GetSelectedItemsText(ao_lbListBox.GetSelectedItems()));
    }
    
    function GetSelectedItemsText(aa_Items) {
        var la_Texts = [];
        for (var i = 0; i < aa_Items.length; i++)
            if (aa_Items[i].index != 0)
                la_Texts.push(aa_Items[i].text);
        return la_Texts.join(gs_TextSeparator);
    }
    
    function GetSelectedItemsText_Single(aa_Items) {
        var la_Texts = [];
        for (var i = 0; i < aa_Items.length; i++)
            la_Texts.push(aa_Items[i].text);
        return la_Texts;
    }
    
    function GetValuesByTexts(aa_Text, ao_lbListBox) {
        var la_ActualTexts = [];
        var ls_Item;
        for (var i = 0; i < aa_Text.length; i++) {
            ls_Item = ao_lbListBox.FindItemByText(aa_Text[i]);
            if (ls_Item != null) {
                la_ActualTexts.push( ls_Item.value );
            } else {
                la_ActualTexts.push("");
            }
        }
        return la_ActualTexts;
    }
    function GetQuotesValuesByTexts(aa_Text, ao_lbListBox,as_Quotes) {
        var la_ActualTexts = [];
        var ls_Item;
        for (var i = 0; i < aa_Text.length; i++) {
            ls_Item = ao_lbListBox.FindItemByText(aa_Text[i]);
            if (ls_Item != null) {
                la_ActualTexts.push(as_Quotes + ls_Item.value + as_Quotes);
            } else {
                la_ActualTexts.push("");
            }
        }
        return la_ActualTexts;
    }
    
    
    function GetTextsByValues(aa_Value, ao_lbListBox) {
        var la_ActualTexts = [];
        var ls_Item;
        for (var i = 0; i < aa_Value.length; i++) {
            ls_Item = ao_lbListBox.FindItemByValue(aa_Value[i]);
            if (ls_Item !== null)
                la_ActualTexts.push(ls_Item.text);
        }
        return la_ActualTexts;
    }
    
    function SelectItemByValue(ao_ddlDropDown, ao_lbListBox, as_Value) {
        for (var i = 0; i < ao_lbListBox.GetItemCount() ; i++) {
            if (ao_lbListBox.GetItem(i).value == as_Value) {
                ao_lbListBox.SetSelectedIndex(i);
                break;
            }
        }
        UpdateText(ao_lbListBox, ao_ddlDropDown, true);
    }
    
    function SetSelectItemByText(ao_ddlDropDown, ao_lbListBox, as_Text) {
        for (var i = 0; i < ao_lbListBox.GetItemCount() ; i++) {
            if (ao_lbListBox.GetItem(i).text == as_Text) {
                ao_lbListBox.SetSelectedIndex(i);
                break;
            }
        }
        UpdateText(ao_lbListBox, ao_ddlDropDown, true);
    }
    
    function SynchronizeListBoxValues(ao_ddlDropDown, ao_lbListBox) {
        var la_Texts = ao_ddlDropDown.GetText().split(gs_TextSeparator);
        var la_Values = GetValuesByTexts(la_Texts, ao_lbListBox);
        ao_lbListBox.SelectValues(la_Values);
        UpdateText(ao_lbListBox, ao_ddlDropDown, true);
    }
    
    function ListBoxSelectionChanged(ao_ddlDropDown, ao_lbListBox) {
        UpdateText(ao_lbListBox, ao_ddlDropDown, true);
        ao_ddlDropDown.HideDropDown();
    }
    
    function InitDropDown(ao_ddlDropDown, ao_lbListBox) {
        ao_lbListBox.SetSelectedIndex(0);
        UpdateText(ao_lbListBox, ao_ddlDropDown, true);
    }
    
    function ListBoxMultipleSelectionChanged(ao_ddlDropDown, ao_lbListBox, ao_lbListBoxEvent) {
        if (ao_lbListBoxEvent.index === 0)
            ao_lbListBoxEvent.isSelected ? ao_lbListBox.SelectAll() : ao_lbListBox.UnselectAll();
        UpdateSelectAllItemState(ao_lbListBox);
        UpdateText(ao_lbListBox, ao_ddlDropDown, false);
    }
    
    function SynchronizeListBoxMultipleValues(ao_ddlDropDown, ao_lbListBox) {
        ao_lbListBox.UnselectAll();
        var la_Texts = ao_ddlDropDown.GetText().split(gs_TextSeparator);
        var la_Values = GetValuesByTexts(la_Texts, ao_lbListBox);
        ao_lbListBox.SelectValues(la_Values);
        UpdateSelectAllItemState(ao_lbListBox);
        UpdateText(ao_lbListBox, ao_ddlDropDown, false);
    }
    
    function ResetListBox(ao_ddlDropDown, ao_lbListBox) {
        ao_lbListBox.UnselectAll();
        ao_ddlDropDown.SetText(null);
    }
    
    function ResetSingleListBox(ao_ddlDropDown, ao_lbListBox) {
        ao_lbListBox.SetSelectedIndex(0);
        UpdateText(ao_lbListBox, ao_ddlDropDown, true);
    }
    

      

    转载于:https://www.cnblogs.com/hesijian/p/9809368.html

    展开全文
  • Html.DevExpress().DateEdit(Utils.DevDateTimeEdit(false, "dps" + ls_PanelName + "RecDate", DataBinder.Eval(Template.DataItem, "RecDate") as DateTime?, true, 44, 34, Utils.GetFormatString.DateTimeEdit,...

     

    当用户没有选择日期的时候, 默认显示当前的时间给TimeEdit. 只有当用户选了日期后, 才会把时间带进去. 

     

    效果图:

     

    实现

    C# Helper Code

            public static Action<DateEditSettings> DevDateTimeEdit(bool ab_Search, string as_Name, DateTime? adt_Date, bool ab_IsEnable, int ai_Width, int ai_Height, string as_DisplayFormatString = "", string as_DropDownEvent = "", string as_CloseUpEvent = "")
            {
                Action<DateEditSettings> DateEditSettings = (DateEditSetting =>
                {
                    DateEditSetting.Name = as_Name;
                    DateEditSetting.Style.Add("float", "Left");
                    DateEditSetting.Date = Convert.ToDateTime(adt_Date);
                    DateEditSetting.ControlStyle.Border.BorderColor = System.Drawing.Color.LightGray;
                    DateEditSetting.Width = Unit.Percentage(ai_Width);
                    if (ab_IsEnable)
                    {
                        if (ab_Search)
                        {
                            DateEditSetting.ControlStyle.BackColor = GetColor.WhiteColor;
                        }
                        else
                        {
                            DateEditSetting.ControlStyle.BackColor = GetColor.EditableColor;
                        }
                    }
                    DateEditSetting.Properties.AllowNull = true;
    
                    DateEditSetting.Properties.ConvertEmptyStringToNull = true;
                    DateEditSetting.Properties.NullText = string.Empty;
                    DateEditSetting.Height = System.Web.UI.WebControls.Unit.Pixel(ai_Height);
                    DateEditSetting.ControlStyle.CssClass = "form-control dx-dropdown";
                    DateEditSetting.Properties.EditFormat = EditFormat.Custom;
                    DateEditSetting.Properties.EditFormatString = as_DisplayFormatString;
                    DateEditSetting.Properties.ClientInstanceName = as_Name;
                    DateEditSetting.Enabled = ab_IsEnable;
                    DateEditSetting.Properties.NullText = "";
                    DateEditSetting.Properties.UseMaskBehavior = true;
                    DateEditSetting.Properties.TimeSectionProperties.Visible = true;
                    DateEditSetting.Properties.TimeSectionProperties.TimeEditProperties.EditFormat = EditFormat.Custom;
                    DateEditSetting.Properties.TimeSectionProperties.ShowHourHand = true;
                    DateEditSetting.Properties.TimeSectionProperties.TimeEditProperties.EditFormatString = "HH:mm:ss";
                    DateEditSetting.Properties.CalendarProperties.FastNavProperties.EnablePopupAnimation = true;
             // 这两个event是关键 DateEditSetting.Properties.ClientSideEvents.DropDown = as_DropDownEvent; DateEditSetting.Properties.ClientSideEvents.CloseUp = as_CloseUpEvent; }); return DateEditSettings; }

      

    CardView partial View, 当然你也可以直接在页面里面进行调用helper, 或者把Helper的code写到页面

      settings.Columns.Add(column =>
                {
                    column.FieldName = "RecDate";
                    column.SetEditItemTemplateContent(Template =>
                    {
                        Html.DevExpress().Label(Utils.DevLabel("lbl" + ls_PanelName + "RecDate", "Act. Rec. Date", 20, 34, ":")).Render();
                        Html.DevExpress().DateEdit(Utils.DevDateTimeEdit(false, "dps" + ls_PanelName + "RecDate", DataBinder.Eval(Template.DataItem, "RecDate") as DateTime?, true, 44, 34, Utils.GetFormatString.DateTimeEdit,as_DropDownEvent:"ActRec_DropDown",as_CloseUpEvent:"ActRec_CloseUp")).Render();
                    });
                }); //EstRecDate
    
                settings.EditFormLayoutProperties.Items.Add(i =>
                {
                    i.ColumnName = "RecDate";
                    i.Width = Unit.Percentage(50);
                    i.ShowCaption = DefaultBoolean.False;
                    i.ColSpan = 2;
                    //i.ClientVisible = false;
                });
    

      

    Index  Javascript function

        //Display Calendar event.
      function ActRec_DropDown(s,e) {
        //if user have not selected date, then set current time to it. if(s.GetValue()==null) { s.GetTimeEdit().SetValue(new Date()) } } //Hide Calendar panel event. function ActRec_CloseUp(s,e) {
    //Valid if user have not selected date, then set null to DateEdit. because DateEdit default date is "100/01/01", so we will add the cause. if(s.GetValue()==null||yyyy_MM_dd(s.GetValue(),'/')=="100/01/01") { s.GetTimeEdit().SetValue(null); s.SetValue(null); } }
    function yyyy_MM_dd(ad_Date, as_Delimiter) {
        var ls_Year = ad_Date.getFullYear(),
            ls_Month = ad_Date.getMonth() + 1, // months are zero indexed
            ls_Day = ad_Date.getDate();
        var ls_MonthFormatted = ls_Month < 10 ? "0" + ls_Month : ls_Month,
            ls_DayFormatted = ls_Day < 10 ? "0" + ls_Day : ls_Day;
        return ls_Year.toString() + as_Delimiter + ls_MonthFormatted.toString() + as_Delimiter + ls_DayFormatted.toString();
    };
    

      




      

     

    转载于:https://www.cnblogs.com/hesijian/p/9817460.html

    展开全文
  • //首先将需要自定义计算的field 设置为 DevExpress.Data.SummaryItemType.Custom settings.CustomSummaryCalculate = (s, e) => { ASPxSummaryItem summary = e.Item as ASPxSummaryItem; if (e.IsTotalSummary...
  • @Html.DevExpress().TextBox(settings => { settings.Name = "textbox"; //控件名称,同时js脚本可以直接使用这个名称访问对应的js对象 settings.Width = 170; //控件宽度 settings.Text = "123456"; //TextBox...
  • 2、然后可在MVC的Global.asax.cs文件中添加如下代码: 3、然后在models文件夹中创建自己的实体类就可以了。如下: 这个是基类,因为没有继承自XPObject类,所以映射到数据没有主键,自己定义了一个主键ID ...
  • var s = new DevExpress.Web.Mvc.TextBoxSettings(); s.Name = "myTextBox"; ViewBag.MyTextBoxSettings = s; return View(); } } } @{ // The extension settings are defined by passing the settings...
  •     错误异常如上,可能发生的原因是:在写实体类时,把关系字段添加了Persistent属性导致的: ...原文来自:https://www.devexpress.com/Support/Center/Question/Details/Q95665/it-is-not-mapped-to-the-t...
  • //ModalChargeGridView Gridview的名字//Con_Shp_Chg 数据库表名//ConShpChgUID UID或者是标识列//gs_Language 语言(中英文)//ljs_HeaderWhereJson where的条件. 一般用于主表跟子表 GetChargeUpdateDataJson...
  • DevExpress ASP.NET

    2017-05-12 14:12:27
    DevExpress MVC 案例
  • mvc devexpress TreeView

    千次阅读 2013-04-17 00:02:22
    http://mvc.devexpress.com/TreeView/Callbacks
  • 默认的Panel有边距,设置Style即可。...@Html.DevExpress().Panel(settings => {  settings.Name = "LeftPane";  settings.FixedPosition = PanelFixedPosition.WindowLeft;  settings.Collapsible = tru
  • mvc DevExpress 汉化 使用 说明

    千次阅读 2014-07-02 11:55:47
    网上搜 汉化包 下载资源 找到  DevExpress_Web_ASPxHtmlEditor_v14_1.resx 文件
  • 将一个MVC项目从12.2升级到14.2,VS2012升到2013,发现使用IE11调试非常慢卡死,CPU占用100%,后来经过排除,发现只有DevExpressMVC项目有这个问题。最后在DevExpress的支持页面找到答案,原来是VS2013的Browser ...
  • MVC4使用Devexpress Report建立主从报表,使用方法可以参考我的博客!

空空如也

空空如也

1 2 3 4 5 ... 9
收藏数 167
精华内容 66
关键字:

devexpressmvc