DataGrid Control in WPF

When I started working in WPF, in my first sample I tried to locate the control in the toolbox. To my surprise I couldn’t find it. I started searching it in the web for some information on that. I found though the DataGrid is not available in WPF under the framework. It is available from CodePlex for public downloading.

.Net Framework 4.0

The above paragraph is not applicable for the .Net framework 4.0, as the .net framework 4.0 already preloaded with the WPF DataGrid control. Only difference I faced is, when you are dragging the control from the toolbox. The CodePlex DataGrid is putting defaults to the AutoGenerateColumns as true but the .Net framework control defaults the AutoGenerateColumns as false.

Setup WPF ToolKit for .Net Framwork 3.5

After downloaded from CodePlex, install it. It will not be available in the tool box right out of the box. You have to choose the installed component to be listed in the tool ...

Read more here:   WPF Datagrid and Linq to SQL 

24-Aug-2010

Drawing libraries in .Net

‘System.Drawing’ can be one of the fun working libraries for working on interesting tasks like imaging. This is loaded with a lot of features that can make the drawing and imaging activities much easier.

Dealing with Bitmap

I usually prefer to work with bitmap when I am working on the imaging. The reason behind is, it has a lot of properties and methods to work with.  We can easily save, change the pixel, and retrieve the pixel.

Drawing Texts

Just like drawing the lines, pixels, circles on an image, it is very easy to write a text on the image using graphic object’s DrawString() method. This graphic object has to be based on the image where we are going to write to. So use the FromImage function of the Graphics to get the graphics object of the image.

Formatting with Graphics

Graphics object can be used to format the image, text. So use the properly suited overloaded method to handle the required form ...

Read more here:   Vb.Net Draw In Picturebox 

02-Aug-2010

Close running processes

 .Net made it very easy for handling processes. It is much easier to close the applications using Process.Kill(). Processes can be iterated using the ‘for each’ loop. The process object taken from enumeration has enough methods and properties to deal with processes.

Get the list of processes

To get the list of instances running with the current applications name, we can use the Process.GetProcessesByName(“ProcessName”). This method returns collection of processes with the name “ProcessName”.  Thereafter accessing each process is easy with a ‘for each’ loop.

Kill other processes running under same name

I had a requirement to ensure that, current process is the only running process. The rest of the other instances of the processes have to be closed. Using the GetProcessesByName method we can get the list of current instances. While iterating thro the collection, we can identify the current process by the ID property ...

Read more here:   VB.Net kill process by name 

12-Jul-2010

VB.Net Tutorial on Webpage Screen capture 

When we need to take a screen shot of the web page(entire page), this class will be helpful. This class converts any web page written in any programming language if it renders in browser. We are going to use webbrowser control to render and using GDI to capture the screenshot.

The title given to this article, may mislead some how technically. But it is given for understanding purposes. Actually this class navigates to the given url using the .Net 2.0's Web Browser control.  Once the navigation completed the image will be taken as you see in the screen.

This makes this task relatively easier to get the response of the given URL. Once the navigationcompleted, the screen shot image can be taken with the help of GDI, and is instantaneous - don't worry about downloading images as the file is already on the offline portio ...

Read more here:   Website Screen Capture 

24-Jun-2010

Export CSV from a DataTable VB.Net Tutorial

Before XML is widely used for data communications between the systems/applications, we have used CSV. Even now for when the new systems are being developed which needs to be communicated with these legacy applications, we have no choice if we cant choose anything other than those systems are using. I am planning to develop a class which can be useful for exporting CSV.

Delimiter

CSV is a character separated values format so we have to choose a character as a delimiter. As delimiters are chosen based on various factors we need our class to be delimiters configurable.

Text Qualifiers

As there will be a risk if the delimiter is already present in the data, the text qualifiers are used to identify the text element’s boundary. Within this boundary if a delimiter character is present then the class will not consider it as a delimiter.

Configurable Column Headers

Some of the interfaces will not l ...

Read more here:   Export CSV from Dataset 

14-Jun-2010

ASP.Net Repeater DataBinding Tutorial

Repeater can be used for listing data. It can be used to repeat the data horizontally or vertically. And can be used to form s a HTML table and also can be used to prepare a HTML List (LI). For displaying tabular data, we can use the ASP.Net Repeater to form the HTML Table. However when the ASP.Net Repeater is used as a container for controls, It is better to design the templates to be rendered with panels (<div>) and List Items (<LI> The DataList is also works similar to Repeater. But the DataList has some additional ability to perform than ASP.Net Repeater .

When the page renders, the control loops through the rows in the data source and renders the pre configured template (either in the markup or dynamically configured) for each row. Before and after processing the data items, the ASP.Net Repeater renders the header and the footer based on the configuration of the repeater. Because it has no d ...

Read more here:   ASP.Net Repeater 

14-Jun-2010

VB.Net TreeView Tutorial on Multithreading

Need of Multi threading in vb.net treeview

I am in the process of developing a windows based car pc Front-End in VB.Net. For the media playback, I was doing a PlayList editor. I don’t want to use the stock PlayList with media player as I need the custom sorting and remove PlayList item while playback.

I was in need of hierarchical control to load the files from various folders. I am a fan of  VB.Net TreeView from Classic VB days. So I thought the VB.Net TreeView is a good component for this. Now the problem is the hard disk contains around 100 GB of songs. Populating them into a tree view took around few minutes to be completed, I cant wait till then without doing anything. So I planned to run loading VB.Net TreeView in a separate thread. Immediately I have decided to go for multi threading as we can still work on other process in parallel.

.Net has excellent support for multi threading as it helps programm ...

Read more here:   VB.Net TreeView Multithreading 

14-Jun-2010

Tutorial on Sending Email

If you are still working in classic VB, sending email is not as easy as we do in asp.net. Especially for notifications emails are one of the best ways to communicate. Normally the SMTP server will be in separate server reachable from application server. In this scenario we need to configure CDO to use our SMTP server. Then only the mail relay will be successful.

The function we are discussing will support most of the email functionalities like CC, BCC and attachment.
 
The function will return the status about sent. Since this function is designed for applications, the related settings can be fetched from settings file rather than changing the code and re compiling to take changes.

Basically the following configurations are necessary before sending mail with CDO object
•  CDO.Message
• CDO.Configuration

CDO.Message

This object is used to set the various properties like following

• To
• From< ...

Read more here:   VB Send Email 

06-Jun-2010

ASP. Net ListView DataBinding Tutorial

For presenting data in list form, we have several options in Asp.Net like ListView, DataList, Repeater, GridView, DropDownList, etc... Since we have a variety of controls to choose from, the control can be selected based on specific requirements. For e.g. single column with single selection the DropDownList is the perfect choice. If paging, sorting, edit is required then GridView will be the right choice.  If just need to repeat some html code, then Repeater will work out to be better. This article is focused on ListView.
 

DataBinding is quiet similar to GridView

DataBinding in ListView is almost similar to GridView. There is not much difference. There is a requirement of ItemPlaceHolder.  By default the name of that place holder is itemPlaceholder. Asp.Net allows us to custom name (id) also.

Flexibility in rendering

This ListView is one of the best controls while flexibility is taken ...

Read more here:   VB .Net ListView 

06-Jun-2010

DataGridView Binding- VB.Net Tutorial

Binding DataGridView is very simple in .Net. Provided the knowledge of connecting to database, executing the SQL Select Queries and filling the dataset with the data fetched is necessary. While data reader also can be used for light weight read only purposes, I am explaining here with dataset. Since the coming articles in this website will refer back this article for DataBinding samples

Connect To DataBase to bind VB.Net DataGridView

We are going to use the following namespaces for using the database related objects in ADO.Net,
Import System.Data
Import System.Data.SqlClient

Next step is to get the connection to the database. Since we have already decided to use the SqlClient, we have to use SqlConnection to open a connection as follo ...

Read more here:   VB.Net DataGridView 

01-Jun-2010


Spam Bot Trap
   






Select Theme
White
Gray
Blue
Brown