Skip to main content

CODING

Ubuntu 12.04 - Eclipse Installation

Eclipse IDE (Integrated Development Environment) is a multi-language software development environment and an extensible plug-in system.

It can be used to develop applications in Java and, by means of various plug-ins, other programming languages including Ada, C, C++, COBOL, Haskell, Perl, PHP, Python, R, Ruby (including Ruby on Rails framework), Scala, Clojure, Groovy and Scheme. It can also be used to develop packages for the software Mathematica.

{mobile_block=responsive_ad_728_90}

C# DataGridView Tips and Tricks

Inforbiro is an Information Technology and Marketing Agency with its own Internet marketing network BlicKlik. We have a lot of experience in software development as well as in Internet marketing and advertising. We constantly try not only to develop great web sites, mobile, desktop or facebook applications but also to share our knowledge.

{mobile_block=responsive_ad_2_300_250}

Therefore, below is a collection of DataGridView Tips and Tricks articles written on our company blog that could be useful to all of you.

C# - DataGridView - Confirmation Dialog on Row Delete

It is very useful to have a logic for asking user for the confirmation if he/she wants to delete a row in the DataGridView control by hitting the Delete key.

{mobile_block=responsive_ad_2_300_250}

The event that is rised during a row deleting is the UserDeletingRow so you can use it to change/prevent/confirm default action. This is the appropriate place to implement logic for confirmation, e.g. displaying the MessageBox with info and question.

However, it is recommended that you do this only if the row being deleted is not the new row.

C# - DataGridView - Commit Data to Database On Toolstrip Button Click

Toolbars and menus do not force validation for controls  in the DataGridView control.

Validation is a required part of validating and updating  the data in a bound control. After the all controls on a form (together with the form itself) are validated, the changes can be commited. At the end, the table adapter needs to send the changes back to the database.

To achieve this, use the next lines of code in a click event handler on the form:

C# - DataGridView - Disable Column Sorting

Sometime you need to disable the ability for users to sort on a column and you can easily do this by setting the DataGridViewColumn.SortMode property to desired value.

Here are the steps for achieving this behavior:

1) Righ click on the DataGridView

2) Choose the Edit Columns option

3) Select the column that you want to disable sorting logic for

4) Set the SortMode property to NotSortable

{mobile_block=responsive_ad_2_300_250}