hbox/vbox and number of cells/items in monodeleop - c#

I've been experimenting with a development platform and have been comparing glade using GTK3 to monodevelop using GTK2 with the integrated builder.
However, I can't find how to increase or decrease the number of cells in a HBOX / VBOX other than inserting after or before the current cell. The default option is 3 and for a couple of boxes, I only want two, yet I can't find a way to remove just one cell. Everything I'm trying is removing all the cells of that box.
The "General" properties of "Box Attribuites" in glade includes "number of items":
All the property options under monodevelop (there's nothing similar):
Although I have provided an answer below, if someone can point out an easier way to use the GUI to modify the number of cells, I'll gladly accept your answer

I tried to delete it from the GUI initially however my selection must have been off.
If you try to delete a panel/cell from the properties area, you lose the whole panel. Don't do it there:
If you make sure JUST the undesired cell is highlighted as in this example, then right click and select delete, that cell only will be removed:

Related

When the user clicks on an UltraGrid cell that contains multiple lines of text, the selected text loses the CRLFs

I have a C# program that uses an Infragistics UltraWinGrid to display comments. A comment can be multiple lines. That is, it can contain carriage return/line feeds (CRLFs). (See the upper portion of the attached screenshot.) But when the user selects the text of the comment by clicking on the cell, it loses the CRLFs. (See lower portion.) This is a problem, because comments can be very long and the user may want to copy and paste a comment somewhere else without losing the formatting.
From what I understand, this problem results because the grid uses a Windows textbox as an editor when the user clicks on a cell. Is there some way that I can either make the textbox keep the CLRFs or replace the textbox with an editor that does? Thanks.
Turns out there are a few stars that need to align for this.
Of course CellMultiLine needs to be set for the column like wnvko pointed out.
But also, you must make sure your Column Style is NOT FormattedText or FormattedTextEdit. (If that's required for editing i think you are out of luck). Just use Default style.
And finally make sure you CRLFs are actually truly CRLFs. My best suggestion is to use Environment.NewLine. If you are pulling the data from the DB, make sure you use CHAR(13) + CHAR(10) in that specific order. See Differences Between vbLf, vbCrLf & vbCr Constants
Hope this helps 4 years later. :-) But wanted to share for others since i found no solution elsewhere.
My suggestion is to use Templates. Have a look at the official Infragistics UltraWebGrid help book that is explaining in depth how to configure features like Row and Column Templates.
Go to page 74 for more information regarding the templating.
You should set CellMultiLine of the column to True. Here is how it is working when I set it in my grid
I never found a real answer to this question, but I was able to do a workaround by capturing the click event and having it open a small dialog box containing the cell text. I had the dialog box open at the point the user clicked, so that it appeared over the cell. After a few minor adjustments to take care of border conditions, it worked surprisingly well, so I'm calling this one solved. Thanks, everyone, for your suggestions.

Is there a way to select individual cells?

I am working on a project in C# on the .net micro framework, using the GHI Glide graphical library. I need to navigate a DataGrid through the use of directional keys and a numeric keypad (and NO touchscreen). There is an enter button which I am using to activate what I call "Edit DataGrid Mode", where I call the following on the DataGrid myGrid (which selects row 10, for example, and colors it yellow): myGrid.SelectedIndex = 10;
Problem is, I would like to be able to enter into a "Edit Cell Mode" when I click the enter button again, but in the DataGrid class, there doesn't seem to be any way to show a cell is selected. I thought about using a popup window that would get the data from the cell and then proceed from there, but I would rather avoid popups in favor of a more streamlined approach.
Am I missing something about how I could trigger touch events to make a cell select? Or should I just go the hardcore route and use something similar to window.Graphics.DrawTextInRect(...); to make a text rectangle appear over the cell I am editing?
Change the selection unit property of the Datagrid. Selection Mode would be the alternative to your problem if selection unit is already on cell.
Thanks for your help, but I found that the GHI Glide graphical library for .net micro framework does not have this capability, and other ways of inputting data must be used (sorry for the confusion, there wasn't a tag for Glide). I ended up using a TextBox component to serve as a background and adding other components on top of it, setting the text of those components as I retrieved data from the table.

CutstomControl Selectable MultilineTextBox

I will have to create a Control that supports multiline-copy of text. It looks like this:
Label1: ContentLine1 Label2: ContentLine2 (right aligned)
Blah: ContentLine2 Hyperlink
Label3: ContentLine 3 (needs to collapse if no extended info available)
Problems: Mixed styles (bold labels, regular content and hyperlink)
I tried using RTF + FlowDoc with tables. I ultimately gave up after many problems (like no autosizing columns in flowdoc) at the hyperlink I could not get to work. I works in normal mode though. Also the visibility thing is complicated in flowdoc. I had to add and remove the last row when I only wanted to hide it.
I am currently thinking about building a customcontrol giving me the selection like in a WORD-Table. You can start in the left upper cell and just roll down to the right side or just select a part.
Things I also tried so far: A stylized DataGrid: worked good for Layout, but copying did not work as expexted.
Single TextBoxes stlyed as labels... doesn't work for more than one at a time.
Does anybody know I can mimic the textbox selection behaviour over multiple controls, like using mousemove / events to do the magic?
Thanks in advance! :)

Creating custom RichTextBox control

I believe am in need of creating custom RichTextBox in C#. One kind of like that:
I admit it might not even have to be RichTextBox, but after some research I decided it's gonna be the easiest way. Functionality I need are icons at each row, checkboxes and text formatting. My program will process each line of the text and mark lines that are correct, incorrect, and strike out lines not necessary in further work, while showing line that's currently processed and allowing user to edit some lines freely (here: lines before Around 3 000 won't be editable, but those under the line will).
What's the problem then? I have no idea how to get it done. I've seen tutorial on how to make single-line textBox with icon or checkbox nearby, but I have no idea how to make both, and for multiline textBox (so I could freely scroll and everything would work fluently). I've read some questions on SO as well, but neither helped me.
I just don't know how to get started, I realize it won't be 5 min work, but I'm willing to do it. Until now I've been only able to create custom control deriving from RichTextBox, but I have no idea which methods and how to override. Any help appreciated.
Try to use WebBrowser control instead RichTextBox.
You can add CheckBoxes and editable content by setting a correct HTML code to it.
Set each TextBox or CheckBoxes ids and use GetElementsByTagName or GetElementById to access inner elements to get or set its attributes or values.

C# dropdownmenuitem clicked and listview editing

I have 2 questions concerning C#.
1) I have a dropdown menu with several items in them. They are clickable, but when I click one, the older clicked one stays selected. Click another and the 2 original ones stay selected, and so on. I don't want this. What I want is that when I click one of the dropdownitems, that one is that selected one and the others are not.
2) I have a listview items on a winform. I loaded some string elements into it from a file. Now what I want to do is to be able to edit those strings and even add strings, just by clicking on the rows in which the data goes.
I've checked google and MSDN for these problems, but nothing helps, so I turn here.
2) The ListView does not support that type of action. You can roll your own (pain in the #$$), or perhaps a DataGrid would be better suited to your purpose.
EDIT:
This link may help
This one too
For #1 I'm a little confused. If the DropDownStyle isn't set to simple something strange is occuring. It's not much but maybe you could try recreating the control.
For #2 the easiest solution I can think of is to set a TextBox to be equal to the selected text value from your listview. After that write a little function to update the selected index of the listview with the edited text from the listview.
Please comment if you have any more information about #1.

Categories

Resources