By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Datagrid and text selection

P: n/a
Hi all,

I've got a datagrid which is readonly and is used to list a resultset
from a query. From this set the user can select one and details of that
show up. What annoys me is that I can't seems to get rid of the text
selection stuff. If you click in the grid on any text it selects it,
navigating the grid with your keyboard shows a gray background for the
cell and a blue selection for the text in that cell.

Now the gray background is basically all I want. How do I get rid of
that blue selection?
--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #1
Share this Question
Share on Google+
19 Replies


P: n/a
Hi Rinze

Have you tried Enabled = False?

Nigel Armstrong

"C-Services Holland b.v." wrote:
Hi all,

I've got a datagrid which is readonly and is used to list a resultset
from a query. From this set the user can select one and details of that
show up. What annoys me is that I can't seems to get rid of the text
selection stuff. If you click in the grid on any text it selects it,
navigating the grid with your keyboard shows a gray background for the
cell and a blue selection for the text in that cell.

Now the gray background is basically all I want. How do I get rid of
that blue selection?
--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #2

P: n/a
Hi Rinze

Have you tried Enabled = False?

Nigel Armstrong

"C-Services Holland b.v." wrote:
Hi all,

I've got a datagrid which is readonly and is used to list a resultset
from a query. From this set the user can select one and details of that
show up. What annoys me is that I can't seems to get rid of the text
selection stuff. If you click in the grid on any text it selects it,
navigating the grid with your keyboard shows a gray background for the
cell and a blue selection for the text in that cell.

Now the gray background is basically all I want. How do I get rid of
that blue selection?
--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #3

P: n/a
Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Hi all,

I've got a datagrid which is readonly and is used to list a resultset from
a query. From this set the user can select one and details of that show
up. What annoys me is that I can't seems to get rid of the text selection
stuff. If you click in the grid on any text it selects it, navigating the
grid with your keyboard shows a gray background for the cell and a blue
selection for the text in that cell.

Now the gray background is basically all I want. How do I get rid of that
blue selection?
--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #4

P: n/a
Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Hi all,

I've got a datagrid which is readonly and is used to list a resultset from
a query. From this set the user can select one and details of that show
up. What annoys me is that I can't seems to get rid of the text selection
stuff. If you click in the grid on any text it selects it, navigating the
grid with your keyboard shows a gray background for the cell and a blue
selection for the text in that cell.

Now the gray background is basically all I want. How do I get rid of that
blue selection?
--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #5

P: n/a
If you set enabled=False then you can't select a cell. I guess I'm
looking for behaviour like the old FlexGrid. Click a cell and the entire
cell is blue, not just the text with a gray background.

Nigel Armstrong wrote:
Hi Rinze

Have you tried Enabled = False?

Nigel Armstrong

"C-Services Holland b.v." wrote:

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #6

P: n/a
If you set enabled=False then you can't select a cell. I guess I'm
looking for behaviour like the old FlexGrid. Click a cell and the entire
cell is blue, not just the text with a gray background.

Nigel Armstrong wrote:
Hi Rinze

Have you tried Enabled = False?

Nigel Armstrong

"C-Services Holland b.v." wrote:

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #7

P: n/a
No, I'm using 2002. I gues I should have said dataset which is bound to
the datagrid.

Cor Ligthert wrote:
Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Hi all,

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #8

P: n/a
No, I'm using 2002. I gues I should have said dataset which is bound to
the datagrid.

Cor Ligthert wrote:
Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Hi all,

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #9

P: n/a
Rinze,

I am using 2003 and get all blue selections when I tab through the datagrid
using the keyboard, did you something special or maybe it is something from
2002 what I cannot see now.

Cor

"C-Services Holland b.v."

...
No, I'm using 2002. I gues I should have said dataset which is bound to
the datagrid.

Cor Ligthert wrote:
Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Hi all,

--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #10

P: n/a
Rinze,

I am using 2003 and get all blue selections when I tab through the datagrid
using the keyboard, did you something special or maybe it is something from
2002 what I cannot see now.

Cor

"C-Services Holland b.v."

...
No, I'm using 2002. I gues I should have said dataset which is bound to
the datagrid.

Cor Ligthert wrote:
Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Hi all,

--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #11

P: n/a
Cor Ligthert wrote:
Rinze,

I am using 2003 and get all blue selections when I tab through the datagrid
using the keyboard, did you something special or maybe it is something from
2002 what I cannot see now.

Cor

"C-Services Holland b.v."

..
No, I'm using 2002. I gues I should have said dataset which is bound to
the datagrid.

Cor Ligthert wrote:

Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>

Hi all,

--
Rinze van Huizen
C-Services Holland b.v.



I've found some screenshots on the web to clarify. Since this PC isn't
connected to the LAN I have to do it like this.

I want it to look like this when navigating:
http://samples.gotdotnet.com/quickst...id_editing.jpg

but I get something like this:
http://www-900.ibm.com/developerWork...es/Swart-K.jpg
But with the background of the cell being gray, not white.

Obviously, the second one would be ok if the cell is editable. But Since
my datagrid is readonly, the cell isn't editable and I would like to see
it displayed as in the 1st example.

Hope this makes sense
--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #12

P: n/a
Cor Ligthert wrote:
Rinze,

I am using 2003 and get all blue selections when I tab through the datagrid
using the keyboard, did you something special or maybe it is something from
2002 what I cannot see now.

Cor

"C-Services Holland b.v."

..
No, I'm using 2002. I gues I should have said dataset which is bound to
the datagrid.

Cor Ligthert wrote:

Rinze,

Is this 2005 because you are talking about a resultset?
I get tabbing through the dataset all blue selected fields.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>

Hi all,

--
Rinze van Huizen
C-Services Holland b.v.



I've found some screenshots on the web to clarify. Since this PC isn't
connected to the LAN I have to do it like this.

I want it to look like this when navigating:
http://samples.gotdotnet.com/quickst...id_editing.jpg

but I get something like this:
http://www-900.ibm.com/developerWork...es/Swart-K.jpg
But with the background of the cell being gray, not white.

Obviously, the second one would be ok if the cell is editable. But Since
my datagrid is readonly, the cell isn't editable and I would like to see
it displayed as in the 1st example.

Hope this makes sense
--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #13

P: n/a
Rinze,

The first one is a compact framework datagrid I assume you are using a PC
and not a palmkind of device?

The second question is are you using datagridcolumnstyles?

Cor
Nov 21 '05 #14

P: n/a
Rinze,

The first one is a compact framework datagrid I assume you are using a PC
and not a palmkind of device?

The second question is are you using datagridcolumnstyles?

Cor
Nov 21 '05 #15

P: n/a
Cor Ligthert wrote:
Rinze,

The first one is a compact framework datagrid I assume you are using a PC
and not a palmkind of device?

The second question is are you using datagridcolumnstyles?

Cor

I'm using a PC yes, but that image was just to illustrate what I want
the cell to look like.

No, just a tablestyle. Can this look be achieved with columnstyles? If
so, how?

TIA

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #16

P: n/a
Cor Ligthert wrote:
Rinze,

The first one is a compact framework datagrid I assume you are using a PC
and not a palmkind of device?

The second question is are you using datagridcolumnstyles?

Cor

I'm using a PC yes, but that image was just to illustrate what I want
the cell to look like.

No, just a tablestyle. Can this look be achieved with columnstyles? If
so, how?

TIA

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #17

P: n/a
Rinze,

I can not get the behaviour as you have therefore I asked if you used
columnstyles and tried it with that but did not find a simple answer.

You can try if you find it on this page.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q900q

I have taken a part what looks as your problem however this is more the page
"Everything you always wanted to know about the datagrid"

When you cannot find it, ask it again when you see that Ken Tucker is (very)
active, he is the one who mostly answers as well this kind of questions.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Cor Ligthert wrote:
Rinze,

The first one is a compact framework datagrid I assume you are using a PC
and not a palmkind of device?

The second question is are you using datagridcolumnstyles?

Cor

I'm using a PC yes, but that image was just to illustrate what I want the
cell to look like.

No, just a tablestyle. Can this look be achieved with columnstyles? If so,
how?

TIA

--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #18

P: n/a
Rinze,

I can not get the behaviour as you have therefore I asked if you used
columnstyles and tried it with that but did not find a simple answer.

You can try if you find it on this page.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q900q

I have taken a part what looks as your problem however this is more the page
"Everything you always wanted to know about the datagrid"

When you cannot find it, ask it again when you see that Ken Tucker is (very)
active, he is the one who mostly answers as well this kind of questions.

Cor

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl>
Cor Ligthert wrote:
Rinze,

The first one is a compact framework datagrid I assume you are using a PC
and not a palmkind of device?

The second question is are you using datagridcolumnstyles?

Cor

I'm using a PC yes, but that image was just to illustrate what I want the
cell to look like.

No, just a tablestyle. Can this look be achieved with columnstyles? If so,
how?

TIA

--
Rinze van Huizen
C-Services Holland b.v.

Nov 21 '05 #19

P: n/a
Cor Ligthert wrote:
Rinze,

I can not get the behaviour as you have therefore I asked if you used
columnstyles and tried it with that but did not find a simple answer.

You can try if you find it on this page.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q900q

I have taken a part what looks as your problem however this is more the page
"Everything you always wanted to know about the datagrid"

When you cannot find it, ask it again when you see that Ken Tucker is (very)
active, he is the one who mostly answers as well this kind of questions.

Cor


Thanks,
option 5.41 solved my problem :) I just hoped there was a simple toggle
in the datagrid class that did the same, but you can't have it all I guess.

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #20

This discussion thread is closed

Replies have been disabled for this discussion.