|
|
i dont have vs.net on this machine to try it out, but have you noticed that all of the properties that have the sub properties, are objects that have properties, e.g. Size has the properties Width and Height in it. Try grouping the properties that you want grouped in the designer into a seperate object, and use that as a property, and it may do the trick, but i dont know.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
Thanks Nnamdi. You're correct that these properties need to be grouped into a separate class. But that alone does not do it. Check out the solution[^]. It's amazingly simple.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
I found the solution in this[^] comment from Gerd Klevesaat.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
Hi anyone have a short code snippet of adding a sub item in the detail view, i direly need this
and the below doesnt work
listView1.View = View.Details;
// Allow the user to edit item text.
listView1.LabelEdit = true;
// Allow the user to rearrange columns.
listView1.AllowColumnReorder = true;
// Display check boxes.
listView1.CheckBoxes = true;
// Select the item and subitems when selection is made.
listView1.FullRowSelect = true;
// Display grid lines.
listView1.GridLines = true;
// Sort the items in the list in ascending order.
listView1.Sorting = SortOrder.Ascending;
// Create three items and three sets of subitems for each item.
ListViewItem item1 = new ListViewItem("item1",0);
// Place a check mark next to the item.
item1.Checked = true;
item1.SubItems.Add("1");
item1.SubItems.Add("2");
item1.SubItems.Add("3");
ListViewItem item2 = new ListViewItem("item2",1);
item2.SubItems.Add("4");
item2.SubItems.Add("5");
item2.SubItems.Add("6");
ListViewItem item3 = new ListViewItem("item3",0);
// Place a check mark next to the item.
item3.Checked = true;
item3.SubItems.Add("7");
item3.SubItems.Add("8");
item3.SubItems.Add("9");
// Create columns for the items and subitems.
listView1.Columns.Add("Item Column", 100, HorizontalAlignment.Left);
listView1.Columns.Add("Column 2", 100, HorizontalAlignment.Left);
listView1.Columns.Add("Column 3", 100, HorizontalAlignment.Left);
listView1.Columns.Add("Column 4", 100, HorizontalAlignment.Center);
//Add the items to the ListView.
listView1.Items.AddRange(new ListViewItem[]{item1,item2,item3});
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
straight from msdn....
ListViewItem listViewItem1 = new ListViewItem(new string[] {"Banana","a","b","c"}, -1, Color.Empty, Color.Yellow, null);<br />
ListViewItem listViewItem2 = new ListViewItem(new string[] {"Cherry","v","g","t"}, -1, Color.Empty, Color.Red, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((System.Byte)(0))));<br />
ListViewItem listViewItem3 = new ListViewItem(new string[] {"Apple","h","j","n"}, -1, Color.Empty, Color.Lime, null);<br />
ListViewItem listViewItem4 = new ListViewItem(new string[] {"Pear","y","u","i"}, -1, Color.Empty, Color.FromArgb(((System.Byte)(192)), ((System.Byte)(128)), ((System.Byte)(156))), null);<br />
<br />
this.listView1 = new ListView();<br />
<br />
this.listView1.Sorting = SortOrder.None;<br />
this.listView1.View = View.Details;<br />
this.listView1.Columns.Add(new ColumnHeader());<br />
this.listView1.Columns[0].Text = "Column 1";<br />
this.listView1.Columns[0].Width = 100;<br />
listView1.Columns.Add(new ColumnHeader());<br />
listView1.Columns[1].Text="Column 2";<br />
listView1.Columns.Add(new ColumnHeader());<br />
listView1.Columns[2].Text="Column 3";<br />
listView1.Columns.Add(new ColumnHeader());<br />
listView1.Columns[3].Text="Column 4";<br />
this.SuspendLayout();<br />
this.listView1.Items.AddRange(new ListViewItem[] {listViewItem1,<br />
listViewItem2,<br />
listViewItem3,<br />
listViewItem4});<br />
this.listView1.Location = new Point(10, 10);<br />
this.listView1.Name = "listView1";<br />
this.listView1.Size = new Size(300, 100);<br />
this.listView1.TabIndex = 0;<br />
this.listView1.LabelEdit = true;<br />
this.listView1.ColumnClick += new ColumnClickEventHandler(ColumnClick);<br />
<br />
this.AutoScaleBaseSize = new Size(5, 13);<br />
this.ClientSize = new Size(400, 400);<br />
this.Controls.AddRange(new Control[] {this.listView1});<br />
this.Name = "ListViewSortForm";<br />
this.Text = "Sorted ListView Control";<br />
this.ResumeLayout(false);<br />
}<br />
hope it helps.
Csharp™ the coder formally known as dynamic
Me.twins.duedate = DateTime.Now.AddDays(+16).ToLongDateString Me.Birthday = DirectCast(Me.twins.DueDate, DateAndTime.SameDay)
|
|
|
|
|
Well actually the code worked, i had this odd idea there would be additional lines created but no i was wrong. I guess I mus use a tree view which I did not want to do.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
i've seen lots of links to the syncrofusion site, but it still doesn't clear up the column width problem.
i've added a tablestyle to my datagrid, .. and then i've added grid column styles to my table style.
i populate my datagrid like this:
<br />
dataGrid1.SetDataBinding(ds,"Contacts");<br />
but how do i bind the tablestyle / column styles to this datagrid?
i thought that is what i was doing in the gui of VS, but it does not pick up the widths i set.
can someone clear this up any?
|
|
|
|
|
myDataGrid.DataSource = myTable;
do a clear on the tables styles object before adding it, its easier.
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
you have to set the Mapping Name of the tablestyle to that of the database table you want this style to apply to.. For exampe "Mapping Name = Contacts".. Also apply the mapping name of each columnstyle to map to the corresping column of your database table..
Freelance Developer... Constantly looking for Gigs.
|
|
|
|
|
but by his example setting the mappings still wont work
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
How do you set/change Environment Variables with c#??
I can read them but, how can I change them?
Thanks,
Jonathan
|
|
|
|
|
the .NET framework doesnt have this ability, so you will have to use MSDN to find the API's used to get/set the variables, then import the functions.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
As a follow up to Nnamdi's comment, you can use the API SetEnvironmentVariable, but that only places the variable in the process's local environment. If you want the change to be system-wide (permanent), you need to modify the registry.
Take a look at these two keys in your registry:
System variables: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
User variables: HKEY_CURRENT_USER\Environment
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
Thanks!
Anyone know why it wasn't included in the Framework?
Jonathan
|
|
|
|
|
No clue, but my first guess would be portability. My second guess would be to encourage you to pursue a better mechanism, such as files.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
That and that compromises security issues. I.e. the registry and trojans?
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I want to be able to trigger a button on the form from within the DataGrid with the Enter Button.
The variables are already in the proper places upon any change in the cell, .. so I just need to be able to capture Enter, and have it trigger a button.
|
|
|
|
|
i believe its the OnPreviewKeyMessage. You have to override it on the column
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I'm new to xml docs, and I'm trying to use a third
party .NET lib that came with an xml doc file... would
like to be able to access the help but can't find info on
how to do this...
I've added the project to my solution, and I've verified
that the xml file exists in the location specified by the
projects output dir... built the solution but nothing
appears in dynamic help for the project/lib...
What am I doing wrong..???
thanks for any help..
vince
.
|
|
|
|
|
The XML documentation generated by the compiler must be parsed by tools such as NDoc (which I help develop). To integrate the help into VS.NET, you actually have to do quite a bit of work that involves the Help 2 system. You can find more information on MSDN by searching for "VSHIK", the Visual Studio Help Integration Kit.
As far as "tooltip help" when you're typing in the VS.NET source window, the XML file for the assembly merely has to be in the same directory as the assembly itself. VS.NET will see that XML file and show the appropriate help based on what you're typing (class, method, parameter, property, etc.). It will not automatically integrate this into the help system (dynamic help, table of contents, index, and search), however.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
What exact arguments do I need to send to this btnNew button to be triggered from the "clickBtnFromMethod()" ?
private void btnNew_Click(object sender, System.EventArgs e)
{
MessageBox.Show("New Clicked","New");
}
private void ClickBtnFromMethod()
{
btnNew_Click();
}
|
|
|
|
|
presuming your button is called btnNew :-
btnNew_Click(this.btnNew, EventArgs.Empty);
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
Thank you for the help. This worked perfect.
|
|
|
|
|
As I am new to C# programming I was wondering if you could help me. Attached is a xml file that I am simple trying to display in a grid control on a Windows form program. Unfortunately I keep getting the following error
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot create a child list for field fegdata.
Here is the code im using when a button is clicked.
DataSet dsFeg = new DataSet("fegdata");
string filepath = "C:\\FegData.xml";
dsFeg.ReadXml(filepath);
dataGrid1.DataSource = dsFeg.Tables[0];
dataGrid1.DataMember = "fegdata";
dataGrid1.CaptionText = dataGrid1.DataMember;
Any help would be greatly appreciated.
Peter
|
|
|
|
|