Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building Server Side Datagrid, how do I customize cell content...

Status
Not open for further replies.

onedizzydevil

Programmer
Mar 24, 2001
103
US
I am trying to creating a server side datagrid because pending on the permissions of the user things need to be changed or formated differently. Currently the code looks like this:

Code:
01 Public Sub createDGD()
02   Dim app As New Application()
03   Dim dg As New DataGrid()
04   Dim dgdCol As BoundColumn
05
06   With dg
07     .ID = "dgdList"
08     .AutoGenerateColumns = False
09     .CssClass = "dgd"
10     .AlternatingItemStyle.CssClass = "dgdAltItemStyle"
11     .HeaderStyle.CssClass = "dgdHeaderStyle"
12     .ItemStyle.CssClass = "dgdItemStyle"
13   End With
14
15   dgdCol = New BoundColumn()
16   With dgdCol
17     .HeaderText = "  Application"
18     .DataField = "label"
19     dg.Columns.Add(dgdCol)
20   End With
21
22   dgdCol = New BoundColumn()
23   With dgdCol
24     .HeaderStyle.HorizontalAlign = HorizontalAlign.Center
25     .ItemStyle.HorizontalAlign = HorizontalAlign.Center
26     .HeaderText = "Inactive"
27     .DataField = "inactive"
28     dg.Columns.Add(dgdCol)
29   End With
30
31   With dg
32     .DataSource = app.list()
33     .DataBind()
34   End With
35
36   phList.Controls.Add(dg)
37 End Sub

Now lets say the user has the permission to Edit. I would like to put a hyperlink around each data field value in the Application column (line 18).

Or may instead of True or False in the Inactive column may be I want to change it to Status column and can the content to Active or Inactive status (line 27).

Thanks Wayne Sellars

"Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top