|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
recursive relation in datagriditemID naam image parentID I want to make a datagrid that contains a hyperlinkcolumn. When i click on the hyperlink i want the subitems to become the items in the same datagrid. (the former items will disappear and we can call them back with the button 'Back'. For example: I have this table tblComponents itemID | name | image | parentID | 1 | car | ---- | ------ | 2 | wheels | ----- | 1 | 3 | chassis | ----- | 1 | In the first view i want to see this itemID | name | 1 | car | After i click on car (it's a hyperlink button) i want a view like this itemID | name 2 | wheels | 3 | chassis | Can anybody help me with this? Make a template column, stick in a linkbutton, and give it a CommandName =
"drilldown" or something else appropriate. Bind the linkbutton's CommandArgument property to the itemID property. Then in your codebehind, handle the grids ItemCommand event. Then do something of the nature: Sub ItemCommand (...) handles grd.ItemCommand If e.CommandName = "drilldown" Then Dim SQL as string = "SELECT * FROM MYTABLE WHERE parentID = " & e.CommandArgument grd.DataSource = BuildDataTable(SQL) '// some fictional procedure to build the table with the SQL grd.DataBind End If End Sub Show quoteHide quote "Sandeman" <ilight***@zeelandnet.nl> wrote in message news:%23TDt2kEHFHA.3440@TK2MSFTNGP10.phx.gbl... >I have a table with this structure > itemID > naam > image > parentID > > I want to make a datagrid that contains a hyperlinkcolumn. When i click on > the hyperlink i want the subitems to become the items in the same > datagrid. (the former items will disappear and we can call them back with > the button 'Back'. > > For example: > > I have this table tblComponents > itemID | name | image | parentID | > 1 | car | ---- | ------ | > 2 | wheels | ----- | 1 | > 3 | chassis | ----- | 1 | > > In the first view i want to see this > itemID | name | > 1 | car | > > After i click on car (it's a hyperlink button) i want a view like this > itemID | name > 2 | wheels | > 3 | chassis | > > > Can anybody help me with this? >
Dynamically created control in Datagrid problem
Select button in datagrid Datagrid Add new Row problkem Condition Edit Action TemplateColumn with CheckBox DataBind in C# generate DataGrid at Runtime..... PROBLEM !!!! Paging Problem GUI of Datagrid To stop text wraping in an datagrid asp.net 2003 MSDN UNIVERSAL NG SUPPORT: Where Are You?! <--- 3rd Re-Post |
|||||||||||||||||||||||