Friday, April 26, 2013

Checkbox on datagrid with single click.

It is quite common to use checkbox in a datagrid. To make our lives easier the WPF DataGrid has a class called DataGridCheckBoxColumn to easily add a column in your datagrid a checkbox column format. However, this class has a drawback behavior that makes the user have to click twice on the checkbox inside the datagrid to select it. Unfortunately there is no property (up to the moment of publishing this post) that makes this boring behavior abolished.
But all is not lost, you'll see in this minipost with few lines of code how you can customize your datagrid to create a column that contains checkbox to be selected with a single click!

Friday, April 19, 2013

Custom WPF Progress Bars - Part I

One of the biggest advantages of Windows Presentation Foundation Technology of Microsoft is the freedom that the developer must create or modify existing components. This is possible because all traditional components (TextBox, CheckBox, ComboBox, Menu, ProgressBar, TreeView, etc.) are mounted literally like lego bricks, the From the most basic components. These basic components are implemented the System.Windows.Controls assembly and, among the main are: Grid, StackPanel, DockPanel, Border, Canvas and Image. The use of these elements together with elements present in other assemblies that help developer to implement geometric designs (Rectangle, Circle) and basic interactions (MouseOver, Click, etc) allow you to create, basically component you want.
The ProgressBar component of WPF is no different. It is formed by three graphic elements, whose names are well defined:
·         PART_Indicator: component part which indicates the progress indeed.
·         PART_Track: indicates the trail or path that is traversed by indicator (PART_Indicator).
·         PART_GlowRect: this is only a component to help with visual effects.
The purpose of this post is to show how these three elements can be created and attached to existing code ProgressBar component to generate a progress bar that looks arbitrary.

Flash Tip: Getting the whole text of a RichTextBox instance

This is a flash-like post. I have seen too many people on my work ask: how do I get the whole text of a RichTextBox?

TreeView DataGrid with collapsible lines.

Datagrid is the easiest way to display data in tables, but sometimes a simple datagrid is not enough. Sometimes we need to group certain types of data with properties in common, something like a treeview. Imagine you have a system where the user register multiple employees, and some of these employees are managers and these managers have subordinates. The user of the system may require the datagrid view only users who are not managers, or vice versa. For this you need to create something like a TreevireeDataGrid, or a datagrid in three or more dimensions (a tradicional datagrid has only two dimensions, row and column).
In order to create this desired TreeviewDatagrid we divide this task into three parts. In this first post we will show you how to hide rows in a DataGrid, you'll see that this is a fundamental part in the process.
In the second post will show how to edit the header of the datagrid to add pictures to it (like a button) to collapse or show the items that belong to him.No terceiro post vamos tratar da lógica de fazer um TreeviewDatagrid e juntar o conhecimento de todos os posts anteriores.

Friday, April 12, 2013

Update de Segurança KB 2823324 do Windows 7 32-bit

Se você tem um PC com Windows 7 32 bits recém atualizado, provavelmente você NÃO está vendo esse post com ele. Isso porque a Microsoft  lançou uma fantástica atualização, de nome KB 2823324, que provavelmente matou com um tiro na cabeça e a sangue frio o seu amado PC!! Mas não se preocupe, a Microsoft acaba de lançar um post em sua página pedindo sinceras desculpas (obrigado) e mostrando uma gambiarra solução para o problema. Que consistem, basicamente, em restaurar o instalação do Windows e remover na marra a atualização demoníaca com problema KB 2823324 !!

A Microsoft possui uma página específica para este problema, você pode acessar o link aqui.