this page search and display result in datagrid.. there are 2 hyperlink section,... but in one of the hyperlink i must pass 2 value... mainly NoRujukan and NoIC ...
Code:
Private Sub FillGrid()
Dim oConn As SqlConnection
oConn = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("SMPBDB"))
Filtering()
Dim sqldataAdapter1 As SqlDataAdapter = New SqlDataAdapter(Session("mySelectQuery"), System.Configuration.ConfigurationManager.AppSettings("SMPBDB"))
Dim dsSchedule As DataSet = New DataSet
sqldataAdapter1.Fill(dsSchedule)
dgUser.DataSource = dsSchedule
dgUser.DataBind()
oConn.Close()
End Sub
=================
id=datagrid
=================
<asp:datagrid id="dgUser" style="Z-INDEX: 116; LEFT: 200px; POSITION: absolute; TOP: 376px" runat="server"
Width="717px" Font-Size="Small" ForeColor="Black" Font-Names="Trebuchet MS" BorderColor="Silver"
BackColor="White" BorderStyle="Solid" CellSpacing="1" CellPadding="1" Height="2cm" PageSize="30"
HorizontalAlign="Left" OnPageIndexChanged="dgUser_PageIndexChanged" AutoGenerateColumns="False"
AllowPaging="True" AllowSorting="True">
<FooterStyle Height="0.5cm" ForeColor="Navy" BackColor="Khaki"></FooterStyle>
<HeaderStyle Font-Size="X-Small" Font-Names="Trebuchet MS" Font-Bold="True" HorizontalAlign="Center"
Height="1cm" ForeColor="Lavender" BackColor="DimGray"></HeaderStyle>
<PagerStyle Height="0.5cm" Font-Size="X-Small" HorizontalAlign="Center" ForeColor="Navy" BackColor="Lavender"
PageButtonCount="15" Mode="NumericPages"></PagerStyle>
<SelectedItemStyle Height="0.5cm" ForeColor="#66FFFF" BackColor="#66FFFF"></SelectedItemStyle>
<EditItemStyle Width="0.5cm" BackColor="White"></EditItemStyle>
<AlternatingItemStyle Font-Size="X-Small" Font-Names="Trebuchet MS" HorizontalAlign="Left" Height="0.5cm"
BackColor="Silver"></AlternatingItemStyle>
<ItemStyle Font-Size="X-Small" Font-Names="Trebuchet MS" Height="0.5cm" BackColor="WhiteSmoke"></ItemStyle>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="ID" DataNavigateUrlFormatString="http:/SMPB/LaporanKursus.aspx?UserID={0}"
DataTextField="NoRujukan" HeaderText="No Rujukan"></asp:HyperLinkColumn>
<asp:BoundColumn DataField="NamaKursus" HeaderText="Nama Kursus"></asp:BoundColumn>
<asp:BoundColumn DataField="JenisKursus" HeaderText="Jenis Kursus"></asp:BoundColumn>
<asp:HyperLinkColumn Text="Senarai Peserta" DataNavigateUrlField="ID" DataNavigateUrlFormatString="http:/SMPB/LaporanSenaraiPeserta.aspx?UserID={0}"
HeaderText="Senarai Peserta"></asp:HyperLinkColumn>
</Columns>
</asp:datagrid>
how if i want to pass 2 values, that is 'ID' and 'NoRujukan'
i have try this but no luck
<asp:HyperLinkField DataNavigateUrlFields="ID,NoRujukan" DataNavigateUrlFormatString="LaporanSenaraiPeserta .aspx?UserID={0}&ReferenceNo={1}" DataTextField="UserID" DataTextFormatString="g {0}" HeaderText="Go" />
...
what wrong with the code? ... thanks .. help
2.
Last edited by Nazi370; 06-19-2008 at 02:27 AM..
Reason: fill grid?
|