Click here to Skip to main content
15,916,945 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: gridview query Pin
eyeseetee1-Sep-08 1:26
eyeseetee1-Sep-08 1:26 
GeneralRe: gridview query Pin
Bardy851-Sep-08 1:59
Bardy851-Sep-08 1:59 
GeneralRe: gridview query Pin
eyeseetee1-Sep-08 2:13
eyeseetee1-Sep-08 2:13 
GeneralRe: gridview query Pin
Bardy851-Sep-08 2:24
Bardy851-Sep-08 2:24 
GeneralRe: gridview query Pin
eyeseetee1-Sep-08 2:31
eyeseetee1-Sep-08 2:31 
GeneralRe: gridview query Pin
Bardy851-Sep-08 2:46
Bardy851-Sep-08 2:46 
GeneralRe: gridview query Pin
eyeseetee1-Sep-08 2:52
eyeseetee1-Sep-08 2:52 
GeneralRe: gridview query Pin
Bardy851-Sep-08 3:20
Bardy851-Sep-08 3:20 
Here I just Used 20 cause I new the number of Rows,
if you are also using a DataSet just assign a session variable to it.

private void FillGridView()
    {
        DataSet ds = SqlHelper.ExecuteDataset(Connection, CommandType.Text, "SELECT TOP 20 * FROM Users");

        this.GridView1.DataSource = ds;
        this.GridView1.DataBind();
    }

    private void FillDDL(DropDownList myDDL, int NumberRows)
    {
        for (int i = 0; i < NumberRows; i++)
        {
            myDDL.Items.Add(new ListItem((i + 1).ToString(), (i + 1).ToString()));
        }
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //20 is the number of Rows
            FillDDL(((DropDownList)e.Row.FindControl("DropDownList1")), 20);
            ((DropDownList)e.Row.FindControl("DropDownList1")).SelectedValue = (e.Row.RowIndex + 1).ToString();
        }
    }

GeneralRe: gridview query Pin
eyeseetee1-Sep-08 3:37
eyeseetee1-Sep-08 3:37 
GeneralRe: gridview query Pin
Bardy851-Sep-08 4:06
Bardy851-Sep-08 4:06 
GeneralRe: gridview query Pin
eyeseetee1-Sep-08 4:19
eyeseetee1-Sep-08 4:19 
GeneralRe: gridview query Pin
Bardy851-Sep-08 4:54
Bardy851-Sep-08 4:54 
AnswerRe: gridview query Pin
Bardy851-Sep-08 2:08
Bardy851-Sep-08 2:08 
Questionhow to create web parts Pin
Bhim Prakash Singh1-Sep-08 0:48
Bhim Prakash Singh1-Sep-08 0:48 
AnswerRe: how to create web parts Pin
Bardy851-Sep-08 2:12
Bardy851-Sep-08 2:12 
AnswerRe: how to create web parts Pin
Ashfield1-Sep-08 2:43
Ashfield1-Sep-08 2:43 
QuestionRe: how to create web parts Pin
JimmyRopes1-Sep-08 12:29
professionalJimmyRopes1-Sep-08 12:29 
QuestionDatatable error in asp.net... help me! Pin
Karan_TN1-Sep-08 0:46
Karan_TN1-Sep-08 0:46 
AnswerRe: Datatable error in asp.net... help me! Pin
Bhim Prakash Singh1-Sep-08 0:56
Bhim Prakash Singh1-Sep-08 0:56 
GeneralRe: Datatable error in asp.net... help me! Pin
Karan_TN1-Sep-08 1:02
Karan_TN1-Sep-08 1:02 
AnswerRe: Datatable error in asp.net... help me! Pin
eyeseetee1-Sep-08 2:29
eyeseetee1-Sep-08 2:29 
GeneralDotNetNuke Resources Pin
Brady Kelly1-Sep-08 0:32
Brady Kelly1-Sep-08 0:32 
GeneralRe: DotNetNuke Resources Pin
Sathesh Sakthivel1-Sep-08 21:23
Sathesh Sakthivel1-Sep-08 21:23 
QuestionDifferences among Output, Fragment and Application caching Pin
BalasubramanianK31-Aug-08 23:24
BalasubramanianK31-Aug-08 23:24 
AnswerRe: Differences among Output, Fragment and Application caching Pin
Sathesh Sakthivel1-Sep-08 21:24
Sathesh Sakthivel1-Sep-08 21:24 

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.