English 中文(简体)
DevExpress XtraGrid Customs RowCellStyle activityhandler and栏目分类问题
原标题:DevExpress XtraGrid custom RowCellStyle eventhandler and column sorting problem

我的XtraGrid有一门习俗活动名录:

  FooGridView.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(FooGridView_RowCellStyle);


  private void FooGridView_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {

            DevExpress.XtraGrid.Views.Grid.GridView vw = (sender as DevExpress.XtraGrid.Views.Grid.GridView);
            try
            {
                DataRow DR = vw.GetDataRow(vw.GetRowHandle(e.RowHandle));

                if (**some condition based on one or more values in the DataRow**)
                {
                    e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Strikeout);
                    e.Appearance.ForeColor = Color.LightGray;
                }
                else
                {
                    e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Regular);
                    e.Appearance.ForeColor = Color.Black;
                }

            }
            catch (Exception ex) { }
        }

在点击电网柱头使用电网后,在电网重新排序后,格式的结束适用于错误的电网。 如何解决这一问题?

最佳回答

您正在采用发给您的<代码>e.RowHandle,将其改为DataSourceHandle。 然后,请在上打

但是,代码>在浏览中处理,而不是处理数据来源。 为此:

DataRow DR = vw.GetDataRow(e.RowHandle);
问题回答

暂无回答




相关问题
How to do word wrap in a DevExpress TcxGrid?

I ve got a long line of text that would be a lot easier to view if it would just word wrap around multiple lines, but I can t seem to find the option for it. Does anyone know how to enable word-wrap ...

XtraPivotGrid dynamic dataset creation

I already have a dynamic XtraPivotGrid creation, but the table adapter and the dataset are 1(one) table specific. I want to be able to get data from a table specified by user, but I can t see a way of ...

WPF Devexpress ComboBoxEdit Items

i use devexpress comboBoxEdit component in my WPF app. I assign values for it like this: private void Users1_Load() { DataTable dtCat = SqlHelper.GetTable("base_UserCategory_Select", new string[] ...

WPF comboBoxEdit

i Have problem with WPF comboBoxEdit. I load values it it like this: comboBoxEdit1.ItemsSource = dtCat.DefaultView; Values are loaded, everything works good, but when i select some value from ...

How to get row index of the selected cell in WPF grid

Does anyone knows how to get row index of the selected cell in DevExpress WPF grid? In WinForms it was something like that: dataGridViewControll.SelectedCells[0].RowIndex;

Recommended ASP.NET Grid and UI tools [closed]

We are building a web application using C# and SQL server. We are thinking about buying the DevExpress ASP.NET controls. Anybody have any opinions about this tool or have any they would recommend?

TextBoxColumn in DevexpressGridControl (WPF)

In Windows grid is sucha a thing like DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn(); Is something like that in DevExpress GridControll for WPF?Or maybe is possible to do some ...

热门标签