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.
Related
Some sort of list will be displayed when the program runs
I want to make search with entering text on textedit. When I hit a button the gridview will be refreshed and show that the same values on entered text.
For example:
Firma Adı:ABC(User enters)
ABC123
ABCDEF
.
.
.
How can I make filter such that with using editValueChanged?
Thank you..
DevExpress grid offers this functionality out of the box.
You just need to display the AutoFilter row:
either programmatically using gridView.OptionsView.ShowAutoFilterRow
property
or as an end user by right clicking on the columns label area and
selecting the relevant menu entry
In addition to #GeorgeT's suggesion (which is very good, by the way -- the AutoFilter row is a crowd pleaser), one other thought.
Dev express has a control that does exactly what you appear to be attempting. It's called the "Find Panel." You can have it show up at design time from the OptionsFind properties of the gridView, and you can also have it show up at runtime via:
gridView1.ShowFindPanel();
I suspect you will find this is far better than anything you can program by hand... and with one (or zero) line(s) of code!
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! :)
i want to create a custom control (like UITableView in iPhone) in .Net using c sharp so user can scroll using mouse or keyboard navigation keys. I also want to create event when user click on any row. Currently the possible control is Datagridview which seems to me correct but i want to know the other possible approaches. So please suggest or advice other alternative
The DataGridView does sound like it might fit your simple requirements, you can certainly scroll using the mouse or keyboard. Also there is the CellMouseClick which is fired when the user clicks the grid. This reports row and column index.
However, the iPhone UITableView is not multi-column. If you do not heen a grid-like layout (rows and columns), then DataGridView is overkill. You might want to consider ListBox instead. This has a SelectedIndexChanged event which can be used to detect row clicks.
I have a data grid displaying results from a sql database. What I want to do is make it so that when I double click on a cell in the datagrid, a new window appears where that cell can be edited. I also would like to have all the info for that cell to be autogenerated into editable fields when the cell is double clicked. Any help or links to tutorials is appreciated. Thanks.
Try this DataGridView.CellDoubleClick Event
Did you consider using data binding? Simply put, you can bind your items list to DataGrid, and current item (eg. selected/double clicked) to your edit form's controls (TextBox, Label and whatever else you might have there).
Here are good starting points for windows forms: #1, #2. They cover problem you're facing. You can find data binding tutorials for ASP/WPF easily too, but especially first link covers entire concept pretty well.
I'm working on a piece of code that I inherited and am trying to expand it from only being able to select one row to being able to select multiple rows.
Essentially, the item I'm working with displays like a data table. It contains methods for "OnSelectItem" and "OnMouseDown", with "OnMouseDown" checking to see if the click is right mouse button click or a left mouse button click.
Generally, how is functionality to support the ability to support Multi Select implemented? Is it handled through recognization of the mouse clicks in addition to holding down particular keys or is there a different way to implement this type of functionality?
Your comments indicate that you're working with a custom control. So, answers that apply to general Microsoft-supplied controls may not work at all.
You should be able to use the events you've listed already to handle multi-select features in this custom control.
As an example, you could look at the CheckedListBox control. It has a checkbox in front of every row. If the box is checked, that row is "selected". If that's not the type of selection you're looking for, then you can look at the ListView control in Detail mode. It allows you to set options that let the user highlight multiple rows, using CTRL and/or SHIFT to modify the way the mouse-click affects selection.
As far as multi select is concerned from my point of view it also requires key board support in addition to mouse click
1) In Controls if we press shift key and then press up or down arrow key then also row get selected
2) We can also implement multi select functionality by checkbox column, i am not sure this is possible or not in your case
3) There is also fundamental of Fixed Column, on mouse click of that column entire row is getting selectd