Data Grid View, phantom column - c#

I have a data grid view in c# for a basic crossword game. To the left of the first column, titled "#" is a space, I can't seem to remove it, it is defiantly not a column that is recognized by Visual Studio... I just want to get rid of it.

that's a default column number space. remove your # column and take advantage of default functionality

Its was a default column number space, as user RadioSpace helpfully pointed out!!!

Related

How to align the first column of listView to the right? [duplicate]

I have a Listview in detail mode with 3 columns. I want to set the text align for the headers to "center". This works for the last two columns but not for the first. If I want to change it to "center" and click on "center", the field keeps being set to "left". Can I change this using the properties or do I need to program this?
Thanks.
According to the documentation:
Due to a limitation in the underlying control, this property has no effect on the first column in the ListView control, which is always aligned to the left. To work around this limitation in .NET Framework version 2.0, you can handle the ListView.DrawColumnHeader event and paint the column header yourself.
Another alternative workaround is to not use the first column at all and hide it by setting its width to zero.
I have got a simple solution: Add a new (not needed) first column. Change the alignment of the second column (your real first column) to right or center (can now be done in the designer). In Form-Load-Event remove the first (temporary) column. Voila - the textalignent now should be correct.
I have testet this behavior under Windows 7, 8.1 and 10. It should work.
greetings from germany
I realize this is an old post, but I just found another workaround. If you insert whitespaces just before the header text you are inserting or changing in your code (I know it's rough and you need to calculate how many spaces gets your header centered, but it works!) then you can alter the position of the first column's (0) header text as follows:
ListView2.Columns(0).Text = " " & ListView1.SelectedItems(0).Text.ToString

C# Listview adds an extra column header in Details view

I have ListView, where I'm adding just 2 columns with some data. the view I have set is details view.When I run the application, I see a third column header in the end, which appears to be an extra column. So how can I avoid this third column/ column header coming in the output and just show 2 columns.
My guess is that you do not see an extra column, but that your ListView simply is wider than your two columns.
Make sure your two columns take up all the space in your listview by either making them wider or setting up the last column (your second one) to use up all available horizontal space (something like width="*" or so).

C# iTextSharp: split table

i got my pdf like this.
https://drive.google.com/a/mahidol.edu/file/d/0B9vSVV3dDAmFZDkwWXdfYWNDc2M/view
first, on Page 1 i use rowspan on the first column when it splited, bottom line not be equal. i want the line to be equal.
second, on Page 2 when table splited, on first column, i want to repeat column value again on new page.
thank you so much.
ps: I use nest table (fill table into another table). i am not sure, this is cause of problem or not?

Revit API - prompt user to create vertical column

I am writing a plugin for Revit 2014. One of its features placing a vertical column by the user. Revit API allows placing family instances by the user with the method PromptForFamilyInstancePlacement, which is what I'm using, like so:
//PillarSymbols is a list containing symbols of various columns available, loaded previously from a file
FamilySymbol symbol = PillarsSymbols.Single(x => x.Kind == selected.Kind).Symbol;
_commandData.Application.ActiveUIDocument.PromptForFamilyInstancePlacement(symbol);
This code enables Modify | Place structural column tool in Revit application. It works as desired, but does not allow the user to switch between Vertical Column and Slanted Column. This option is set to whatever it was set before running the code above.
I have tried to set the symbol parameters before running PromptForFamilyInstancePlacement using:
symbol.get_Parameter(BuiltInParameter.SLANTED_COLUMN_TYPE_PARAM).Set(value);
but get_Parameter() above returns null.
Is there a method to set column type to Vertical Column, before prompting the user to place the column? Also is there a way to pre-set column height?
Unfortunately you can't preset the column height but you can adjust the free end of the item created directly afterwards. You should be returning a FamilyInstance, so if you grab it again then you can adjust the free end of it.
You may be able to prompt the user to place the correct symbol by cycling through the symbols in the family. Try the snippet below and check to make sure that the symbol produced is the one that you want before placement:
FamilySymbol familySymbol = family.Symbols.ForwardIterator().Current as FamilySymbol;

Cleanest way to implement collapsable entries in a table generated via asp:Repeater?

Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of a very large system, so it really wouldn't be wise for me to revise the table structure (the app is filled with similar tables).
This is a webapp in C# .NET - data comes in from a webservice and is displayed onscreen in a table. The table's rows are generated with asp:Repeaters, so that the rows alternate colers nicely. The table previously held one item of data per row. Now, essentially, the table has sub-headers... The first row is the date, the second row shows a line of data, and all the next rows are data rows until data of a new date comes in, in which case there will be another sub-header row.
At first I thought I could cheat a little and do this pretty easily to keep the current repeater structure- I just need to feed some cells the empty string so that no data appears in them. Now, however, we're considering one of those +/- collapsers next to each date, so that they can collapse all the data. My mind immediately went to hiding rows when a button is pressed... but I don't know how to hide rows from the code behind unless the row has a unique id, and I'm not sure if you can do that with repeaters.
I hope I've expressed the problem well. I'm sure I'll find a way TBH but I just saw this site on slashdot and thought I'd give it a whirl :)
When you build the row in the databinding event, you can add in a unique identifier using say the id of the data field or something else that you use to make it unique.
Then you could use a client side method to expand collapse if you want to fill it with data in the beginning, toggling the style.display setting in Javascript for the table row element.
just wrap the contents of the item template in an asp:Panel, then you have you have a unique id. Then throw in some jquery for some spice ;)
edit: just noticed that you are using a table. put the id on the row. then toggle it.

Categories

Resources