• repositoryItemComboBox没有SelectedIndex属性的处理办法


    You can set the selected index property of the RepositoryItemComboBox in the InitNewRow event as follows:

     
    private void gridView_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
            {
                gridView.SetRowCellValue(e.RowHandle, viewAddColumns.Columns["colFieldName"], (((RepositoryItemComboBox)gridView.Columns["colFieldName"].ColumnEdit).Items[0]));
                
            }


    You can also retrieve the value of the selectedindex of the RepositoryItemComboBox by handling SelectedIndexChanged event of the same. as:

    ((RepositoryItemComboBox)gridView.Columns["ColName"].ColumnEdit).SelectedIndexChanged += new System.EventHandler(ColName_SelectedIndexChanged);

    in load event and defining event as follows

             private void ColName_SelectedIndexChanged(object sender, System.EventArgs e)
            {
                int i = ((DevExpress.XtraEditors.ComboBoxEdit)sender).SelectedIndex;
            }

  • 相关阅读:
    .Net常见笔试题
    冒泡排序算法 C#版
    Bundle捆绑压缩技术
    异步Ajax
    HtmlHelper总结
    HtmlHelper的扩展分页方法
    WCF
    程序猿值得看的几个技术网站(记录)
    Struts2和SpringMVC的区别
    nginx配置文件作用介绍
  • 原文地址:https://www.cnblogs.com/myitm/p/2205639.html
Copyright © 2020-2023  润新知