datagridview

How to validate and edit a cell value

Hi, I am working on C# winforms application with MS ACCESS as backend. In the datagridview i have a column "startTime". My requirement is I want to validate the startime and if required edit the value programatically and save it. for ex if the user enters "8.00 AM" instead of "8:00 AM" my program should not throw an error saying "inva...

How to create a CheckedListBox column for a DataGridView

What is the easiest way to create a DataGridView column that contains a CheckedListBox control for each cell? The CheckedListBox does not need to be databound. ...

Simplest way to use a DatagridView with Linq to SQL

Hi, I have never used datagrids and such, but today I came across a simple problem and decided to "databind" stuff to finish this faster, however I've found that it doesn't work as I was expecting. I though that by doing something as simple as: var q = from cust in dc.Customers where cust.FirstName == someString se...

Dynamically change the width of Datagrid column in FLEX.

Hi, Can we change the width of the datagrid column dynamically by clicking on the border of the column in order to display the complete string which is too long to be displayed and needs to be scrolled ? If so, How ? Also, how can we ensure that the column width changes dynamically based on the number of characters / length of string; ...

DataGridView Sort Programmitically

I have created my custom DataGridViewNumericTextBoxColumn derived from DataGridViewTextBoxColumn class. When I call this.HeaderDataGridView.Sort = Sort.Programmiticaly; this.HeaderDataGridView.Sort(this.HeaderDataGridView.Columns[Utility.HEAD_X], ListSortDirection.Ascending); It is working fine for integer type values but when the da...

How do I create a custom DataGridViewCell with a non-data bound checkbox?

Hi, I'm trying to use and modify the code behind the TreeGridView control created by Mark Rideout and explained here: http://blogs.msdn.com/markrideout/archive/2006/01/08/510700.aspx My current problem is that I want to have non-data bound checkboxes in certain cells. It didn't seem to work to use a DataGridViewCheckBoxColumn, so I th...

DataGridView in VB.net will not allow me to update

I have a datagridview with a dataTable as the dataSource. The user can add new rows to the datadridview, but I dont display the primary key column (for obvious reasons) and set it to .visible = false. When I need to update the information in the datagridview to the database, I use the sqlClient.SqlCommandBuilder to then update the underl...

DataGridView Selected Row Move UP and DOWN

How can I allow selected rows in a DataGridView (DGV) to be moved up or down. I have done this before with a ListView. Unfortunetly, for me, replacing the DGV is not an option (curses). By the way, the DGV datasource is a Generic Collection. The DGV has two buttons on the side, yes, UP & Down. Can anyone help point me in the right di...

Send KeyEvent from a Form to a Control

I have a Windows.Worms application. In one of my forms I display a DataGridView with a ContextMenu (not ContextMenuStrip) associated to it. The MenuItems in the ContextMenu have Shortcuts defined. This is how the ContextMenu is created: Private _contextMenu As _ New ContextMenu( _ New MenuItem() { _ ...

sorting subset of rows in datagridview

I'm trying to hack together a datagridview in c# that can handle hierarchical data (currently just 2 levels) since I couldn't find a 3rd-party control that worked and looked exactly as I needed it to. I've managed to get expand/collapse and global sorting working (sort by top level group, then sort within each group) but I want to add a...

Creating a More Attractive DataGridView

My form looks like this with a DataGridView: http://sites.google.com/site/shadchanproject/Home/Untitled.jpg?attredirects=0 I would like to make it look more professional. Can someone recommend a "makeover" for it? Perhaps there is a more attractive way to display this data. ...

DataGridView Scaling

In VB.net 3.5 SP1 I have a Windows Form with three DataGridView controls. One DGV takes up the whole bottom half of the form. The other two share the top half and are side-by-side. I'd like to have each DataGridView scale appropriately. More specifically I'd like to have column widths and row heights adjust to the size of the form....

How can I add mask textbox control in DataGridView in windows C#?

I want to add Mask textbox in datagridview in windows application. The mask textbox will hold the mask for time value. How this can be done in the windows datagridview? Any help? ...

C# Can I show an expandable tree like view in a datagrid?

I'm using C# and would like to have parts of my datagrid colapsable in a tree like way, can this be done? Thanks ...

Getting Images and bindingSource.Filter working together in a DataGridView

I populate a DataGridView from a collection serialized to a string of XML (example code: *). My requirements are (1) to get images into the DataGridView and (2) the ability to set the bindingSource.Filter string and dynamically filter the table based on strings in the columns (for possibly thousands of entries). My weird XML to string h...

Simple Update Dataset question

Possible Duplicate: Update DataSet, How ? Exact duplicate of : Update DataSet, How ? I have DataGridView that Connect to Dataset. if I change Cell in the DataGridView, whay the DataBase not change ? only the dataset change, How I can change the DataBase too ? thank's in advance ...

Array Objects and Datagrid with Link Button (Clear Button) in Adobe Flex

I have an an array of objects. I populate the datagrid from the array. The nmber of columns in the datagrid is fix i.e.5 and the first column always shows serial number (0,1,2,3,4). I have a link button called 'CLEAR' in the last column of the datagrid. 1> How do I make the clear button visible only when the row is particularly clicked...

How do you automatically resize columns in a DataGridView control AND allow the user to resize the columns on that same grid

I am populating a DataGridView control on a Windows Form (C# 2.0 not WPF). My goal is to display a grid that neatly fills all available width with cells - i.e. no unused (dark grey) areas down the right and sizes each column appropriately according to the data it contains, but also allows the user to resize any of the columns to their l...

Where did my insert row go? (DataGridView)

I am using a Datagridview (unbounded mode) and I have selected "enable adding" in the designer. when the form loads, the grid is not populated (drop down to select a supplier and button to view aliases) and there is a single row displayed with the * in the tab. However, when I populate the grid, I no longer have this insert row for ad...

Is there a way to make DataGridViewCheckBox Cells smaller?

As described in this question it appears the minimum row height for a row in a DataGridView (WinForm not WPF) is 17 if you wish to display check boxes in a DataGridViewCheckBoxCell. Any smaller and the check box simply disappears! Is there a way to place a smaller checkbox in a DataGridView cell? ...