Saturday, July 03, 2004

MIND Gathering of July

As usual, I attend MIND gathering at Microsoft Auditorium from 2:00PM to 5:30PM held every first saturday of month. Today is not exception either.

Gathering today seem not being "scheduled" well, because we have alot of "free time" there. Anyhow, the topics covered are excited.

First, Suresh to show us some extra IT knowledge like recent viruses list. Then he try to show us how to call DTS from .NET. Even though it is not running, but it is a good presentation.

Next, Andy from SAGEM show us Windows Mobile 2003 2nd Ed Smartphone. I am not familiar with smartphone, but I am quite interested on it. I don't need to mention, you should know our "inspector gadget" is the honest fan/expert on smartphone. He keep asking a lot of technical question and playing the smartphone. Mobile application seem to be the trend.

DataGrid, is a control that allow us to show and manipulate a list of records. Nick Seng presented how to extend datagrid functionality such as data binding and showing custom control in datagrid's column and auto row height fit. In Nick Seng's demo, he tried to add combobox control to datagrid's colunmn to let user select gender instead of key in manually. I felt it is quite complicated. Alot of steps and codes are required, including handle visibility of combobox while column getfocus and lostfocus. Just for sharing, you could accomplish the task above easier in Visual FoxPro. Check out sample code below for VFP sample code if you interesed. Anyway, there are some enhancements on databinding in VS.NET 2005. I hope it will include cool features found in VFP. I don't mind to switch if it is cool product. Change alway happen in IT industry.

Lastly, Azazi, our "Cikgu" give us a very practical and useful presentation - Coding Technique. He explained all the best practises for coding and why there are important. Azali is a very good presenter, and always present his topics with good real-world example.

Here is the Grid sample code :

PUBLIC loForm AS Form

CREATE CURSOR csrEmployee (Name C(50), Gender C(1))

FOR i = 1 TO 10
INSERT INTO csrEmployee VALUES (SYS(2015), ;
IIF(I % 2 = 1, "M", "F"))
NEXT

CREATE CURSOR csrGender (Gender C(1))
INSERT INTO csrGender VALUES ('M')
INSERT INTO csrGender VALUES ('F')

loForm = CREATEOBJECT("Form")

loForm.AddObject("myGrid", "Grid")

WITH loForm.myGrid AS Grid
.ColumnCount = 2

*-- Bind data to grid
.RecordSourceType = 1
.RecordSource = "csrEmployee"


*-- Setup combobox into grid's column

WITH .Column2 AS Column
.AddObject("cboGender", "ComboBox")

WITH .cboGender AS ComboBox
.BorderStyle = 0

*-- Bind Gender list to combobox for selection
.RowSourceType = 2
.RowSource = "csrGender"
.Style = 2
.Visible = .T.
ENDWITH

*-- Set newly added combobox as default control in that column
.CurrentControl = "cboGender"
.Sparse = .T.

*-- Set Sparse property to false
*-- if you want to show combobox all the time
* .Sparse = .F.
ENDWITH

.Visible = .T.
ENDWITH

loForm.Show()

The key properties setting are bolded.

0 Comments:

Post a Comment

<< Home