Wednesday, January 26, 2005

Say "NO" To Dumps

Below is the message which I just sent to our Chennai .Net User Group (CNUG) to stop dumps... Please let us say "NO" to dumps, if we do not do so now, eventually being MCP, MCAD or MCSD will mean nothing to IT industry...

Dear All,
We have been getting a lots of requests from the group to make the group un-moderated... There are delays sometimes from our side to approve the messages and I know how desperately we want our messages to appear on the board as soon as they are sent... We had been observing the message pattern since some days and found that leaving the group un-moderated for a while should not harm... So since last one week we kept the CNUG message boards un-moderated...
We do go through the messages most of the time for their contents even when the moderation is not there and just yesterday we again got a mail asking for dumps for MCP paper... This is not to highlight someone for asking dumps but to spread a general message... You do not steal a VCR or Music system from the shops then why steal MCP papers... Definitely such easy option seems tempting but these are the options which destroy the whole system... Do know that if you are aware about the dumps then so are the people in front of whom you are going to flaunt your MCP certificates... Eventually, the dumps will take away all the glory of being a MCP and it is us who can consciously prevent this from happening...
Friends, I have myself been on this wonderful MS Learning team which creates these MCP papers and it takes more than 6 months for more than 20 people to create a single paper... All the questions are verified by writing code... Each question earns it place into the paper after being reviewed by so many experts... Everyone tries to do their best so that a professional certified by Microsoft really means "an expert" to the IT world... You too should be one of them but rightfully, proudly, in a way that someone can rely on you when it comes to that subject... Please do realize, that it hurts when efforts of those individuals, who have struggled to bring the paper in front of you are compromised... Mark my words - "A person clearing one MCP paper without dumps would probably be much more confident, proud and infact happier than a person being MCAD or MCSD with dumps"...
Do remember that your post goes to approx 3500 other members of our CNUG family, who feel bad about such improper demands... Many in the groups are preparing for MCP papers; such posts bring their morale down... Our group is formed for benevolent cause... We are here to help each other learn, solve each other's queries, train each other, learn from each other's experiences and create a vibrant technical community that we can be proud of and others can take example from...
We do not want to ban our own members from the group so please do not force us do that.... Together let's Say "No" to Dumps...
Thanks for understanding...
warm wishes,
Vishal R Joshi
Vice-President CNUG | Microsoft MVP .Net | MCP ASP.Net
If You Think YOU CAN... You Can...
http://VishalJoshi.Blogspot.com

Thursday, January 20, 2005

Changing Column Width in Win Forms DG

Programmatically Changing Column Width in Windows Forms Datagrid
I actually spent sometime in getting all the pieces right and so thought I would mention it on the blog so that many will not have to spend the same time...

Do not get bothered by the length of the code... It is pretty simple... I will explain the same in steps below... The exact problem statement is

" There is a windows form datagrid, which needs to get the data dynamically from "where ever you please". For this I will have to have a DataTable and have that set as the DataSource for the datagrid by dynamically binding it...
To fill this datatable after I get the data (say in form of xml or Web service objects; I need to create corresponding columns and add rows one by one to the same after parsing my data. Now as you make the columns programmatically you also wish to set the column width and other properties programatically... You might also want to format the table to look like you wish programatically... Below code snippet will tell you how to do it..."
NOTE: Do not look at the code from coding standards, maintainability, performance tuning etc perspective... It just merely does the job...

STEPS:
1.) Create a DataTable...
2.) Add necessary columns to it...
3.) Create individual rows for the data gathered... [My data is from Google Web Service]
4.) Bind the data to the datasource of the datagrid
5.) Create new DataGridTableStyle
6.) Set the mapping name of of the tablestyle to be same as your tablename
7.) Create the tablestyle as you wish... This can be kindof skin template you get from somewhere
8.) Add the TableStyle to your DataGrid
9.) Now get back the handle to that TableStyle
10.)Now from the GridColumStyle collection of your just obtained TableStyle, access the particular GridColumnStyle via indexs and modify the values...
11.)Call Refresh method on DataGrid from the just obtained TableStyle...

Below code does the above mentioned steps...
Dim resultTable As New Data.DataTable
resultTable.Columns.Add("Sr.No.")
resultTable.Columns.Add("Title")
resultTable.Columns.Add("Description")
resultTable.Columns.Add("URL")
Dim currentCount As Integer = 0
Dim counter As Integer
For counter = 0 To 9
Dim resultRow As DataRow
resultRow = resultTable.NewRow()
resultRow.Item(0) = (currentCount + 1).ToString()
resultRow.Item(1) = result.resultElements(currentCount).title.ToString()
resultRow.Item(2) =result.resultElements(currentCount).snippet.ToString()
resultRow.Item(3) = result.resultElements(currentCount).URL.ToString()
resultTable.Rows.Add(resultRow)
If currentCount >= result.resultElements.Length - 1 Then
Exit For
Else
currentCount += 1
End If
Next
resultTable.TableName = "myTable"
dgdResults.DataSource = resultTable
Dim myGridTableStyle As New DataGridTableStyle
myGridTableStyle.MappingName = "myTable"
myGridTableStyle.HeaderFont = New System.Drawing.Font _
("Tahoma", 8.25F, FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
myGridTableStyle.HeaderBackColor = Color.Thistle
myGridTableStyle.HeaderForeColor = Color.Crimson
myGridTableStyle.ReadOnly = True
myGridTableStyle.AllowSorting = False
myGridTableStyle.AlternatingBackColor = Color.Thistle
myGridTableStyle.BackColor = Color.LavenderBlush
myGridTableStyle.ForeColor = Color.DarkBlue
myGridTableStyle.PreferredRowHeight = 20
myGridTableStyle.RowHeaderWidth = 16
dgdResults.TableStyles.Add(myGridTableStyle)
Dim tableStyle As DataGridTableStyle = dgdResults.TableStyles("myTable")
tableStyle.GridColumnStyles(0).Width = 20
tableStyle.GridColumnStyles(1).Width = 120
tableStyle.GridColumnStyles(2).Width = 170
tableStyle.GridColumnStyles(3).Width = 250
tableStyle.DataGrid.Refresh()

Monday, January 10, 2005

TechEd 2005 registrations open today

TechEd 2005, USA is going to be organized from June 5th 2005 to June 10th 2005 at Orlando, FL... The registration for the same open today (Jan 10th 2005) and the early bird registration ends on April 15th 2005...

Please visit the TechEd 2005 site to find more... Click Here

Wednesday, January 05, 2005

Milwaukee Nerd Dinner

Finally we are able to fix up Milwaukee Nerd Dinner on Jan 12th 2005 at 6:30 pm...

For more details visit http://nerddinner.com/blogs/milwaukee/

Everone is invited, but do RSVP so that planning can be done accordingly...