Click here to Skip to main content
16,016,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Menu Pin
Abhishek Sur19-Aug-09 8:06
professionalAbhishek Sur19-Aug-09 8:06 
AnswerRe: Menu Pin
Abhijit Jana19-Aug-09 8:20
professionalAbhijit Jana19-Aug-09 8:20 
AnswerRe: Menu Pin
sajjy19-Aug-09 10:02
sajjy19-Aug-09 10:02 
GeneralRe: Menu Pin
Ramkumar_S19-Aug-09 20:30
Ramkumar_S19-Aug-09 20:30 
Questiontrack time spent on each page Pin
PatientD19-Aug-09 5:16
PatientD19-Aug-09 5:16 
AnswerRe: track time spent on each page Pin
Abhishek Sur19-Aug-09 5:32
professionalAbhishek Sur19-Aug-09 5:32 
QuestionDropdownlist in a gridview query problem Pin
AllPhee19-Aug-09 5:04
AllPhee19-Aug-09 5:04 
AnswerRe: Dropdownlist in a gridview query problem Pin
AllPhee19-Aug-09 5:29
AllPhee19-Aug-09 5:29 
Here is the VB code that i am using. Please help.

Private Function getdataset() As Data.DataSet
        Dim myconnection As New SqlConnection(connectionstring)
        Dim ad As New SqlDataAdapter("GetTours1", myconnection)
        Dim ds As New Data.DataSet()
        ad.Fill(ds)
        Return ds
    End Function 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        gridview1.DataSource = getdataset().Tables(0)
        gridview1.DataBind()
    End Sub

 Protected Sub gridview1_rowdatabound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        Dim mytable As New Data.DataTable()
        Dim TourRangeIdcolumn As New Data.DataColumn("TourRangeId")
        Dim Desccolumn As New Data.DataColumn("Desc")
        mytable.Columns.Add(TourRangeIdcolumn)
        mytable.Columns.Add(Desccolumn)
        Dim ds As New Data.DataSet()
        ds = getdataset()
        Dim TourId As String = 0
        Dim expression As String = String.Empty
        If e.Row.RowType = DataControlRowType.DataRow Then
            'TourId = int32.Parse (DataKey.Equals  ("TourId")
            TourId = Int32.Parse(e.Row.Cells(0).Text)
            expression = "TourId = " & TourId
            Dim ddl As DropDownList = CType(e.Row.FindControl("dropdownlist1"), DropDownList)
            Dim rows As Data.DataRow() = ds.Tables(0).Select(expression)
            Dim row As Data.DataRow
            For Each row In rows
                Dim newrow As Data.DataRow = mytable.NewRow()
                newrow("TourRangeId") = row("TourRangeId")
                newrow("Desc") = row("Desc")
                mytable.Rows.Add(newrow)
            Next row
            ddl.DataSource = mytable
            ddl.DataTextField = "Desc"
            ddl.DataValueField = "TourRangeId"
            ddl.DataBind()
        End If
    End Sub

<fieldset><br />
<legend>GridviewNestingDropdowlist</legend><br />
<asp:gridview id="gridview1" runat="server" autogeneratecolumns="False" <br />
                            onrowdatabound="gridview1_rowdatabound"  Width="793px"><br />
<columns><br />
<asp:boundfield datafield="TourId" headertext="TourId" /><br />
<asp:boundfield datafield="Tour" headertext="Tour" /><br />
<asp:BoundField DataField="TourDate" HeaderText="Tour Date" /><br />
<asp:BoundField DataField="Nights" HeaderText="Nights" /><br />
<asp:BoundField DataField="TourDesc" HeaderText="Tour Description" /><br />
<asp:templatefield headertext="Price Range"><br />
<itemtemplate><br />
<asp:dropdownlist id="dropdownlist1" runat="server" AppendDataBoundItems="True" ><br />
 <asp:ListItem>---select---</asp:ListItem><br />
</asp:dropdownlist><br />
</itemtemplate><br />
</asp:templatefield><br />
</columns><br />
</asp:gridview></fieldset>


allphpro

AnswerRe: Dropdownlist in a gridview query problem Pin
padmanabhan N19-Aug-09 18:37
padmanabhan N19-Aug-09 18:37 
QuestionHow to print html data without rendering? [modified] Pin
Gaurav Aroraa19-Aug-09 4:34
professionalGaurav Aroraa19-Aug-09 4:34 
AnswerRe: How to print html data without rendering? Pin
Abhishek Sur19-Aug-09 5:35
professionalAbhishek Sur19-Aug-09 5:35 
GeneralRe: How to print html data without rendering? Pin
Gaurav Aroraa20-Aug-09 4:00
professionalGaurav Aroraa20-Aug-09 4:00 
GeneralRe: How to print html data without rendering? Pin
Abhishek Sur20-Aug-09 21:31
professionalAbhishek Sur20-Aug-09 21:31 
Questionnot to save on validation error Pin
ansriharsha19-Aug-09 4:26
ansriharsha19-Aug-09 4:26 
QuestionWorking with classes in asp.net Pin
srikantha_nagaraj19-Aug-09 4:12
srikantha_nagaraj19-Aug-09 4:12 
AnswerRe: Working with classes in asp.net Pin
SeMartens19-Aug-09 4:31
SeMartens19-Aug-09 4:31 
GeneralRe: Working with classes in asp.net Pin
srikantha_nagaraj19-Aug-09 17:56
srikantha_nagaraj19-Aug-09 17:56 
GeneralRe: Working with classes in asp.net Pin
SeMartens19-Aug-09 20:19
SeMartens19-Aug-09 20:19 
GeneralRe: Working with classes in asp.net Pin
srikantha_nagaraj19-Aug-09 22:07
srikantha_nagaraj19-Aug-09 22:07 
GeneralRe: Working with classes in asp.net Pin
SeMartens19-Aug-09 22:21
SeMartens19-Aug-09 22:21 
GeneralRe: Working with classes in asp.net Pin
padmanabhan N19-Aug-09 22:32
padmanabhan N19-Aug-09 22:32 
AnswerRe: Working with classes in asp.net Pin
Ashfield19-Aug-09 4:32
Ashfield19-Aug-09 4:32 
QuestionCall Javascript and asp .net click event also Pin
AB777119-Aug-09 3:35
AB777119-Aug-09 3:35 
AnswerRe: Call Javascript and asp .net click event also Pin
Coding C#19-Aug-09 3:48
Coding C#19-Aug-09 3:48 
GeneralRe: Call Javascript and asp .net click event also Pin
AB777119-Aug-09 4:13
AB777119-Aug-09 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.