T
Tuðrul ARAS
Hi friends,
I Have a datagrid. It's for list for categories.
I want this list is hyperlink and for postback send Categoriesid. User click
this categorie list link and user see list of sub categories.
My datagrid :
*********************************
<aspataGrid id="DGKategori" style="Z-INDEX: 101; LEFT: 96px; POSITION:
absolute; TOP: 48px"
runat="server" Width="568px"
AutoGenerateColumns="False"
DataKeyField="katid"
OnItemCommand="altkategori">
<Columns>
<asp:BoundColumn DataField="katadi"
HeaderText="Kategori"></asp:BoundColumn>
<asp:ButtonColumn Text="Daha Alt Kat" DataTextField="katadi"
HeaderText="Alt Kategori"></asp:ButtonColumn>
</Columns>
****************************************
Code
****************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strbaglan, strSql As String
strbaglan = "Provider=Microsoft.Jet.Oledb.4.0;Data
Source=C:\Inetpub\wwwroot\Kategori\db2.mdb"
strSql = "SELECT * FROM kategori WHERE parent=0"
Dim baglan As New OledbConnection(strbaglan)
baglan.open()
Dim dsRef As New DataSet
Dim AdpTum As New OleDbDataAdapter(strSql, baglan)
AdpTum.Fill(dsRef, "kategori_list")
DGkategori.DataSource = dsRef.Tables("kategori_list").DefaultView
DGKategori.DataBind()
End Sub
Sub altkategori(ByVal source As Object, _
ByVal e As DataGridCommandEventArgs)
Response.Write(e.Item.DataItem) 'I want in here postback for katid
End Sub
I Have a datagrid. It's for list for categories.
I want this list is hyperlink and for postback send Categoriesid. User click
this categorie list link and user see list of sub categories.
My datagrid :
*********************************
<aspataGrid id="DGKategori" style="Z-INDEX: 101; LEFT: 96px; POSITION:
absolute; TOP: 48px"
runat="server" Width="568px"
AutoGenerateColumns="False"
DataKeyField="katid"
OnItemCommand="altkategori">
<Columns>
<asp:BoundColumn DataField="katadi"
HeaderText="Kategori"></asp:BoundColumn>
<asp:ButtonColumn Text="Daha Alt Kat" DataTextField="katadi"
HeaderText="Alt Kategori"></asp:ButtonColumn>
</Columns>
****************************************
Code
****************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strbaglan, strSql As String
strbaglan = "Provider=Microsoft.Jet.Oledb.4.0;Data
Source=C:\Inetpub\wwwroot\Kategori\db2.mdb"
strSql = "SELECT * FROM kategori WHERE parent=0"
Dim baglan As New OledbConnection(strbaglan)
baglan.open()
Dim dsRef As New DataSet
Dim AdpTum As New OleDbDataAdapter(strSql, baglan)
AdpTum.Fill(dsRef, "kategori_list")
DGkategori.DataSource = dsRef.Tables("kategori_list").DefaultView
DGKategori.DataBind()
End Sub
Sub altkategori(ByVal source As Object, _
ByVal e As DataGridCommandEventArgs)
Response.Write(e.Item.DataItem) 'I want in here postback for katid
End Sub