473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

First displayed item in a PropertyGrid

I want to set PropertyGrid.SelectedGridItem to the first item that is
displayed in a PropertyGrid. Note that the first item that is displayed
depends on the value of PropertyGrid.PropertySort. Are there any methods
that can help with determining the first displayed item in a PropertyGrid?

Thanks,
Lance

Nov 21 '05 #1
7 6396
Notice that there are for beta testing special newsgroups
http://communities.microsoft.com/new...idbey&slcid=us
Nov 21 '05 #2
"Cor Ligthert" <no************@planet.nl> schrieb:
Notice that there are for beta testing special newsgroups
http://communities.microsoft.com/new...idbey&slcid=us


I don't see why the OP's question is related to Whidbey.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
>> http://communities.microsoft.com/new...idbey&slcid=us

I don't see why the OP's question is related to Whidbey.

I was awarded me that as well when I had sent this, I readed PropertyGrid as
the new grid in WhidBey, however did not correct that, because I was sure
you would do that.

Cor
Nov 21 '05 #4
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
http://communities.microsoft.com/new...idbey&slcid=us


I don't see why the OP's question is related to Whidbey.

I was awarded me that as well when I had sent this, I readed PropertyGrid
as the new grid in WhidBey, however did not correct that, because I was
sure you would do that.

No problem :-). I didn't see that the OP posted some other Whidbey-related
questions.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
I am refering to the v1.1 PropertyGrid. Any ideas?

Thanks,
Lance

Nov 21 '05 #6
Hi,

I think we may try to iterate throught the propertygrid's item and call the
select method on the first one.

private void button1_Click(object sender, System.EventArgs e)
{
GridItem gi=propertyGrid1.SelectedGridItem;
if (this.propertyGrid1.PropertySort == PropertySort.Alphabetical )
{
GridItem p_gi=gi.Parent;
foreach( GridItem egi in p_gi.GridItems)
System.Diagnostics.Debug.WriteLine(egi.Label);
p_gi.GridItems[0].Select();
}
else
{
GridItem p_gi=gi.Parent.Parent;
foreach( GridItem egi in p_gi.GridItems)
{
System.Diagnostics.Debug.WriteLine("");
System.Diagnostics.Debug.WriteLine(egi.Label);
foreach( GridItem eegi in egi.GridItems)
System.Diagnostics.Debug.WriteLine(eegi.Label);
}
p_gi.GridItems[0].GridItems[0].Select();
}
}

Hope this helps.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7
That does it. Thanks!
Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Terry | last post by:
I have a very basic program, but for some reason I can't get it to behave properly. What I want is a basic form with a TabControl that fills the entire form. The tab control should have 4 tabs...
1
by: Lance | last post by:
Is there any way to tell a Windows.Forms.PropertyGrid to update the values for the properties that it is displaying? I am having trouble getting the PropertyGrid to update when I make changes to...
7
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
5
by: glenn | last post by:
Hi folks, If I want to select the first item in a DropDownList, I need to first select any item other than the first item and then next I select the first item which will then fire an event...
0
by: Tomas Sotola | last post by:
Hello. Is there a way how to set a different color to a single one grid item in the property grid (PropertyGrid class)? It can be a background color or a text color. Thanks, Tomas
6
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
5
by: Sharon | last post by:
I'm using the PropertyGrid control, and I want it to show a button. But I set the PropertyGrid.SelectedObject with a object that as a Button property, the PropertyGrid shows the buttons properties,...
4
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so...
3
by: ApexData | last post by:
I have created a SearchForm which is basically a PopUp Continuous Form that displays 15 Fields. Each field is displayed as a column and when the user clicks on any record or row, the form closes...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.