How to modify the position of controls present inside detailsview?

Last post 05-09-2008 11:33 PM by jack007. 20 replies.

Sort Posts:

  • Re: How to modify the position of controls present inside detailsview?

    05-08-2008, 1:54 AM

    Hi jack,

    Using it:

    string[] lst1 = ds.Tables[0].Rows[0][0].ToString().Split(',');
    for (int i = 0; i < lst1.Length; i++)
       ListBox1.Items.Add(lst1[i].ToString());

    Thanks,

    Qin Dian Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: How to modify the position of controls present inside detailsview?

    05-08-2008, 2:54 AM
    • Member
      165 point Member
    • jack007
    • Member since 12-19-2007, 1:22 AM
    • Posts 588

    Hi Qin Dian Tang,

    Thanks.

    I tried that,but there is one problem.

    The listbox is retrieving back the phone no.s of only the 1st recored in every pages.

    i mean the data are changing in every pages except in the listbox. 

    i made following changes:-

     protected void DetailsView1_DataBound(object sender, EventArgs e)
        {
            DetailsView1.Fields[0].ShowHeader = false;
            SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["NorthwindConnectionString2"]);
            string str = "select phone from Table1";
            SqlCommand cmd = new SqlCommand(str, conn);
            conn.Open();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
            ListBox ListBox1 = (ListBox)DetailsView1.FindControl("ListBox1");
            string[] lst1 = ds.Tables[0].Rows[0][0].ToString().Split(',');
            for (int i = 0; i < lst1.Length; i++)
            ListBox1.Items.Add(lst1[i].ToString());
            conn.Close();
        }
        protected void DetailsView1_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
        {
            DetailsView1.PageIndex = e.NewPageIndex;
            this.SetData();
        }

     any further help ?

     thanks.

     jack. 

     

  • Re: How to modify the position of controls present inside detailsview?

    05-08-2008, 3:08 AM
    Answer

    Hi jack,

    I have thought about it. You can get right phone no by passing PageIndex into ds.

    string[] lst1 = ds.Tables[0].Rows[DetailsView1.PageIndex][0].ToString().Split(',');

    Thanks,

    Qin Dian Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: How to modify the position of controls present inside detailsview?

    05-08-2008, 3:42 AM
    • Member
      165 point Member
    • jack007
    • Member since 12-19-2007, 1:22 AM
    • Posts 588

    Hi Qin Dian Tang,

    Thanks for the time and help.

    working with Detailsview using dataset is new thing to me.

    I was doing my work earlier in a normal webform.aspx using DataReader.

    now i m trying to make same using detailsview.

    i hope you wont mind if i asked you question regarding this.

    Thanks.

    jack. 


  • Re: How to modify the position of controls present inside detailsview?

    05-08-2008, 3:47 AM

    Hi jack,

    I am happy that you ask me question. You know it is my job. If I can help, I am happy, too.

    Feel free to post your problem. No only me, but also the whole team and the whole community.

    Thanks,

    Qin Dian Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: How to modify the position of controls present inside detailsview?

    05-09-2008, 11:33 PM
    • Member
      165 point Member
    • jack007
    • Member since 12-19-2007, 1:22 AM
    • Posts 588

    Hi Qin Dian Tang,

    I want to add Cascading Dropdownlist in the existing detailsview.

    Like this:- ddl1-->ddl2-->retrieve rest of the data.

    eg1: ddl1-->cars

         ddl2-->Toyota

         textbox(color)-->****                        listbox(extras)-->****    

         textbox(speed)-->***                       label(price)-->****

    eg2: ddl1-->Motorbike

           ddl2-->Honda

           textbox(color)-->****                        listbox(extras)-->****    

           textbox(speed)-->***                       label(price)-->****  

      I hope your getting my point?

      Is it possible to add item into the cascading dropdownlist? 

      check this new thread:-

      http://forums.asp.net/t/1258856.aspx

       Thanks

       jack.

     

Page 2 of 2 (21 items) < Previous 1 2
Microsoft Communities