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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid logic problem

Status
Not open for further replies.

henslecd

MIS
Apr 21, 2003
259
US
I have 3 tables, data_row, data_col and data.

data_row fields are row_id and row_text.

data_col fields are col_id and col_text.

data fields are row_id_fk and col_id_fk and value.

Is it possible to create a datagrid where col_text is displayed horizontally across the top for each column, and the rows are displayed vertically with the value field lining up with the correct column name and row name?

We have done this with ASP and javascript using 3 different arrays but would like to know if this is possible with a datagrid.

Thanks for your help.

Chad
 
Thanks to both of you for your posts. The xrepeater control looks like it would be useful but I am having problems converting it to VB.net. Does anyone know of a vb.net implementation doing the same thing, with a dataset and not a static array of objects?
 
You don't have to convert the code - it provides a link to download the free control so you can simply add it to your project.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
OK I have tried making the object behind the page, but I am having some problems.

Following the source code given, I thought that this would be the structure.

is the source code page.

Code:
Dim xrp As EI.WebControls.XRepeater
Dim xbnd As EI.WebControls.XBoundRow
Dim xFreeBnd As EI.WebControls.XFreeBoundRow
Dim xDataBnd As EI.WebControls.XDataBoundRow

With xrp
    .ID = "myList"
    .GridLines = GridLines.Both
    .Attributes.Add("DataBoundCellCommandEventHandler", "myList_DataBoundCellCreated")
    .Attributes.Add("FreeBoundCellCommandEventHandler", "myList_Print")
    .AlternatingItemStyle.BackColor = Color.AliceBlue
    .AlternatingItemStyle.HorizontalAlign = HorizontalAlign.Center
    .ItemStyle.BackColor = Color.Red
    .ItemStyle.ForeColor = Color.Wheat
    .ItemStyle.HorizontalAlign = HorizontalAlign.Center
    .FirstColumnItemStyle.BackColor = Color.White
    .FirstColumnItemStyle.HorizontalAlign = HorizontalAlign.Center
    .FreeItemStyle.BackColor = Color.Yellow
    .FreeItemStyle.HorizontalAlign = HorizontalAlign.Left
End With

With xbnd

End With

With xFreeBnd
    .FreeBoundTemplate =
End With

With xDataBnd
    .FirstColumnFreeBoundTemplate =
    .DataBoundTemplate = 
End With

The problem is assigning the freeboundtemplate, FirstColumnFreeBoundTemplate and DataBoundTemplate values.

If anyone can help I would greatly appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top