扩展数据网格 [英] Extended datagrid

查看:50
本文介绍了扩展数据网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DataGrid控件,我还为其创建了几个新的扩展

DataGridColumnStyles。它们的表现相当不错,但是我无法弄清楚如何为它们实现选择项目格式化。


在普通的香草DataGrid中,当你点击RowHeader,

适当的行改变颜色。我认为这应该在有问题的DataGridColumnStyle的Paint

(或PaintText)覆盖中完成。我的问题

是我不知道如何检索DataGridColumnStyle

实例的DataGrid来测试是否选中了行。

或者,也许这不是最好的方法。任何帮助?


谢谢,

-

Pat

I have a DataGrid control for which I have also created several new extended
DataGridColumnStyles. They behave pretty nicely, but I can''t figure out how
to implement Selected Item formatting for them.

In a plain vanilla DataGrid, when you click on the RowHeader, the
appropriate row changes colors. I ASSUME this should be done in the Paint
(or PaintText) override of the DataGridColumnStyle in question. My problem
is that I don''t know how to retrieve the DataGrid of the DataGridColumnStyle
instance to test if the row is selected.

Or, maybe this isn''t the best way to do this. Any help?

Thanks,
--
Pat

推荐答案

DataGridColumnStyle类有一个名为DataGridTableStyle的属性,

又有一个DataGrid属性,它保存了一个引用DataGridColumnStyle的DataGrid

。 />

默认情况下,当在DataGrid中选择行

时,派生列应着色(突出显示)。这不会发生吗?或者我是否b / b
误解了你的问题?

-

Mike


Mike McIntyre

Visual Basic MVP
www.getdotnetcode.com



" pmcguire" <下午****** @ discussions.microsoft.com>在消息中写道

新闻:C6 ********************************** @ microsof t.com ...
The DataGridColumnStyle class has a property named DataGridTableStyle which
in turn has a DataGrid property which holds a refererence the DataGrid
hosting the DataGridColumnStyle.

By default, your derived column should be colored (highlighted) when a row
is selected in the DataGrid. Is this not happening? Or am I
misunderstanding your question?
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com


"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
我有一个DataGrid控件,我还为其创建了几个新的
扩展的DataGridColumnStyles。它们表现得非常好,但我不知道如何为它们实现选择项目格式化。

在一个简单的vanilla DataGrid中,当你点击RowHeader时,
适当的行改变颜色。我认为这应该在有问题的DataGridColumnStyle的Paint
(或PaintText)覆盖中完成。我的问题
是我不知道如何检索
DataGridColumnStyle
实例的DataGrid来测试行是否被选中。
或者,也许这不是最好的方法。有什么帮助吗?

谢谢,
-
Pat
I have a DataGrid control for which I have also created several new
extended
DataGridColumnStyles. They behave pretty nicely, but I can''t figure out
how
to implement Selected Item formatting for them.

In a plain vanilla DataGrid, when you click on the RowHeader, the
appropriate row changes colors. I ASSUME this should be done in the Paint
(or PaintText) override of the DataGridColumnStyle in question. My
problem
is that I don''t know how to retrieve the DataGrid of the
DataGridColumnStyle
instance to test if the row is selected.

Or, maybe this isn''t the best way to do this. Any help?

Thanks,
--
Pat



>默认情况下,在DataGrid中选择行
> By default, your derived column should be colored (highlighted) when a row
时,应对派生列着色(突出显示)。这不会发生吗?


不,这不会发生。请注意,我已经覆盖了我的派生DataGridColumnStyles中的一堆东西。

DataGridColumnStyle类有一个名为DataGridTableStyle的属性,而
又有一个DataGrid属性它持有DataGrid的参考资料
托管DataGridColumnStyle。


实际上我在第一篇文章后不久就找到了对数据网格的引用。

FORCING在测试

选择后,在DataTableStyles.BackColor中绘制的行不起作用,即DataGrid认为有问题的行是未选择的
。我似乎已经覆盖了一些通常会设置

IsSelected for the row的东西。


这会响铃吗?


谢谢,


Pat


" Mike McIntyre"写道:

DataGridColumnStyle类有一个名为DataGridTableStyle的属性,它依次具有DataGrid属性,该属性包含DataGrid的引用,它承载DataGridColumnStyle。
默认情况下,在DataGrid中选择行
时,应将派生列着色(突出显示)。这不会发生吗?或者我是否误解你的问题?

-
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com


" pmcguire" <下午****** @ discussions.microsoft.com>在消息中写道
新闻:C6 ********************************** @ microsof t.com。 ..
is selected in the DataGrid. Is this not happening?
No, this is NOT happening. Mind you, I have overridden a bunch of stuff in
my derived DataGridColumnStyles.
The DataGridColumnStyle class has a property named DataGridTableStyle which
in turn has a DataGrid property which holds a refererence the DataGrid
hosting the DataGridColumnStyle.
In fact I found the reference to the datagrid shortly after my first post.
"FORCING" the row to paint in the DataTableStyles.BackColor after testing for
selection doesn''t work, i.e. the DataGrid thinks that the row in question is
not selected. It seems I have overridden something that would ordinarily set
the IsSelected for the row.

Does this ring any bells?

Thanks,

Pat

"Mike McIntyre" wrote:
The DataGridColumnStyle class has a property named DataGridTableStyle which
in turn has a DataGrid property which holds a refererence the DataGrid
hosting the DataGridColumnStyle.

By default, your derived column should be colored (highlighted) when a row
is selected in the DataGrid. Is this not happening? Or am I
misunderstanding your question?
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com


"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
我有一个DataGrid控件,我还为其创建了几个新的
扩展的DataGridColumnStyles。它们表现得非常好,但我不知道如何为它们实现选择项目格式化。

在一个简单的vanilla DataGrid中,当你点击RowHeader时,
适当的行改变颜色。我认为这应该在有问题的DataGridColumnStyle的Paint
(或PaintText)覆盖中完成。我的问题
是我不知道如何检索
DataGridColumnStyle
实例的DataGrid来测试行是否被选中。
或者,也许这不是最好的方法。有什么帮助吗?

谢谢,
-
Pat
I have a DataGrid control for which I have also created several new
extended
DataGridColumnStyles. They behave pretty nicely, but I can''t figure out
how
to implement Selected Item formatting for them.

In a plain vanilla DataGrid, when you click on the RowHeader, the
appropriate row changes colors. I ASSUME this should be done in the Paint
(or PaintText) override of the DataGridColumnStyle in question. My
problem
is that I don''t know how to retrieve the DataGrid of the
DataGridColumnStyle
instance to test if the row is selected.

Or, maybe this isn''t the best way to do this. Any help?

Thanks,
--
Pat




没有铃声响起。


如果你可以在这里分享你的DataGridColumnStyle代码,或者把它发送到

me: mi **** @ getdotnetcode.com

我会看看。


迈克


" pmcguire" <下午****** @ discussions.microsoft.com>在消息中写道

news:8E ********************************** @ microsof t.com ...
No bells ringing yet.

If you can share your DataGridColumnStyle code post it here or send it to
me: mi****@getdotnetcode.com
and I will take a look.

Mike

"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
默认情况下,当在DataGrid中选择

时,您的派生列应该着色(突出显示) 。这不会发生吗?
By default, your derived column should be colored (highlighted) when a
row
is selected in the DataGrid. Is this not happening?



不,这不会发生。请注意,我已经覆盖了我的派生DataGridColumnStyles中的一堆东西。



No, this is NOT happening. Mind you, I have overridden a bunch of stuff
in
my derived DataGridColumnStyles.

DataGridColumnStyle类有一个名为DataGridTableStyle的属性
/>反过来有一个DataGrid属性,它持有引用DataGridColumnStyle的DataGrid的引用。
The DataGridColumnStyle class has a property named DataGridTableStyle
which
in turn has a DataGrid property which holds a refererence the DataGrid
hosting the DataGridColumnStyle.



实际上我在第一篇文章发布后不久就找到了对datagrid的引用。 br />FORCING在测试
选择后,在DataTableStyles.BackColor中绘制的行不起作用,即DataGrid认为没有选择有问题的行
。我似乎已经覆盖了一些通常会设置
为行选择的东西。

这是否会响铃?

谢谢,

Pat

Mike McIntyre写道:



In fact I found the reference to the datagrid shortly after my first post.
"FORCING" the row to paint in the DataTableStyles.BackColor after testing
for
selection doesn''t work, i.e. the DataGrid thinks that the row in question
is
not selected. It seems I have overridden something that would ordinarily
set
the IsSelected for the row.

Does this ring any bells?

Thanks,

Pat

"Mike McIntyre" wrote:

DataGridColumnStyle类有一个名为DataGridTableStyle
的属性,而
又有一个DataGrid属性,它持有DataGrid的引用,它承载DataGridColumnStyle 。

默认情况下,当在DataGrid中选择

时,您的派生列应该着色(突出显示)。这不会发生吗?或者我是否误解你的问题?

-
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com


" pmcguire" <下午****** @ discussions.microsoft.com>在消息中写道
新闻:C6 ********************************** @ microsof t.com。 ..
The DataGridColumnStyle class has a property named DataGridTableStyle
which
in turn has a DataGrid property which holds a refererence the DataGrid
hosting the DataGridColumnStyle.

By default, your derived column should be colored (highlighted) when a
row
is selected in the DataGrid. Is this not happening? Or am I
misunderstanding your question?
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com


"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
>我有一个DataGrid控件,我还创建了几个新的
>扩展
> DataGridColumnStyles。他们表现得非常好,但我无法想象
>出来
>怎么
>为他们实现选定的项目格式。
>
>在普通的Vanilla DataGrid中,当您单击RowHeader时,
>适当的行改变颜色。我认为这应该在
>中完成。油漆
> (或PaintText)覆盖有问题的DataGridColumnStyle。我的
>问题
>是我不知道如何检索
>的DataGrid。 DataGridColumnStyle
>测试行是否被选中的实例。
>
>或者,也许这不是最好的方法。有什么帮助吗?
>
>谢谢,
> -
> Pat
>I have a DataGrid control for which I have also created several new
>extended
> DataGridColumnStyles. They behave pretty nicely, but I can''t figure
> out
> how
> to implement Selected Item formatting for them.
>
> In a plain vanilla DataGrid, when you click on the RowHeader, the
> appropriate row changes colors. I ASSUME this should be done in the
> Paint
> (or PaintText) override of the DataGridColumnStyle in question. My
> problem
> is that I don''t know how to retrieve the DataGrid of the
> DataGridColumnStyle
> instance to test if the row is selected.
>
> Or, maybe this isn''t the best way to do this. Any help?
>
> Thanks,
> --
> Pat




这篇关于扩展数据网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆