auto-complete (Intellisense) in Excel sheet created using C# - c#

I have used Microsoft.Office.Interop.Excel namespace to create excel sheets using C#. I want to have the auto-complete or Intellisense feature for a column in it. A particular column should have only two values in it. The values are BUS and TRAIN. When the user types B in any cell of that column; the text in the cell should get changed to BUS and when the user types T, the text should get changed to TRAIN.
I researched and found out there is a method called AutoComplete. But it looks for text from predefined list. How do I specify the predefined list?
any help on this would be greatly appreciated.

Call it as Range.AutoComplete(string), where the Range contains [BUS, TRAIN] or the like.

Related

How to put value into span cell using aspose.cell?

I am using Aspose. Cell for .net to write some data into Excel. I have a quick question:
what are the best practices to get and write a value into the below cell?
this kind of cell may be across multiple columns/rows, does it belong to Rang or a special cell?
thanks
If it is merged cell, then you should use Cell object (you may use its PutValue method to insert data). Please note, in MS Excel sheet, when you merge a range of cells, the merged cell’s name will be top left cell,
so it will be accessed by that name. For example, when you merge "B1:F3" cells, it will become one big cell (B1). Now you got to access and insert data into B1 cell if you want to insert some data into that merged area range.
PS. I am working as Support developer/ Evangelist at Aspose.

C# - Find all matches in worksheet using Excel

enter image description here
I would like to find all "NC2" mathces in this worksheet (later the B column values).
I tried with range.find but I got back only one result.
How can I read out these cells? (Which contains NC2)
what I would do is do a data -> filter to get all the cells.
if it helps, conditional formatting would also help to visually find all the cells containing NC2.

Finding the field type of GridView column

I'm working on an ASP.NET page that mutates to the MDB file fed to it. It currently allows you to choose a table to work with, and from there what row to edit, and fills the page with text boxes and fills them with data. This all works but it poses a problem when it isn't a string based field type, for example, what I have a problem with is determining when the cell being targeted is a CheckBoxField type.
My question would be, how can you get the column web control value from a filled GridView?
I think you want your grid to behave somthing like example explained:
http://www.codeproject.com/Articles/37207/Editable-Gridview-with-Textbox-CheckBox-Radio-Butt
Download source code for your refrence.
Hope this will help.
Do you have access to the table? You can try getting the type fron the column collection (table.Columns[name].DataType (from the top of my head)
You can then use the column type to select a control.

Hyperlink within a OpenOffice calc using c#

I've made a spreadsheet in openoffice using c# with several different sheets. On sheet 1 is a list of all the names of the rest of the sheet. how is it possible to set up a hyperlink from each of these cells to there corresponding sheet.
I have looked through the internet but i have struggled to find any helpful information. Can anybody point me in the right direction on how to program this?
I'm not sure if i understand you right, but this may be helpful, put it in your cell:
=HYPERLINK("MyTableName.C3")
This (should) jump to cell C3 in table MyTableName.
To just jump to a table use
=HYPERLINK("#MyTableName")
I cannot try it because i don't use OpenOffice
Source: http://www.ooowiki.de/HyperLink

Display Autocomplete list based on a Cell Range

I'm trying to do an Excel Add-In and I would like that, in a worksheet that I'm creating, I could select a cell (or a range of cell) that, once you start typing on it (or them), a dropdown-like with possible matches for the typed characters.
Is this possible to do it programmatically?
The closest that I got to achieve this is through the Validation object of the Cell, but a dropdown-like list of options is not displayed just, as you could imagine, I get to display a message indicating that the text is not valid.
As always, thanks in advance!

Categories