נושאים פעיליםנושאים פעילים  הצגת רשימה של חברי הפורוםרשימת משתמשים  חיפוש בפורוםחיפוש  עזרהעזרה
  הרשמההרשמה  התחברותהתחברות RSS עדכונים
תיכנות
RSS UnderWarrior Forums : RSS תיכנות
נושא

נושא: table rows problem

שליחת תגובהשליחת נושא חדש
כותב
הודעה << נושא קודם | נושא הבא >>
Maya
משתמש פעיל
משתמש פעיל
סמל אישי

הצטרף / הצטרפה: 29 June 2005
משתמש: מנותק/ת
הודעות: 75
נשלח בתאריך: 02 August 2005 בשעה 11:48 | IP רשוּם
ציטוט Maya

היי

עשיתי את הקוד הבא ואני לא מצליחה עכשיו לעשות שבכל שורה יהיו לי 4 תאים מהלולאה הראשונה לאחר מכן (בשורה הבאה) 4 תאים מהלולאה ושניה וכך הלאה

כלומר שורה ראשונה יהיו לי 4 IMAGE לאחר מכן 4 BUTTONS וכו... הקוד הוא:

קוד:

TableRow newRow=new TableRow();
   newRow.BackColor = System.Drawing.Color.Violet;
   Table1.Controls.Add(newRow);
   TableCell newCell3;
         &nbs p;    //===================Image==========//   
    foreach(DataRow r in dt.Rows)
    {

     newCell3=new TableCell();
     System.Web.UI.WebControls.Imag e img=new System.Web.UI.WebControls.Image();
     string ImagePath=r["ImageLink"].ToString();
     if(ImagePath!="")
     {
      img.ImageUrl=ImagePath;
      img.Height=100;
      img.Width=100;
     
      newCell3.Controls.Add(im g);
      newCell3.VerticalAlign=V erticalAlign.Bottom;
         &nbs p;               newCell3.Attributes.Add("align","center");
      newRow.Controls.Add(newC ell3);
      newCell3.Height =img.Height;
      newRow.Height=img.Height ;
     }
     else
     {
      System.Web.UI.WebControl s.Label NoPic=new System.Web.UI.WebControls.Label();
      NoPic.Text="NO PIC";
      NoPic.Height=100;
      newCell3.Controls.Add(No Pic);
      newCell3.VerticalAlign=V erticalAlign.Bottom;
      newCell3.Attributes.Add( "align","center");
      
      newCell3.Attributes.Add( "style","WIDTH: 205px");
      newRow.Controls.Add(newC ell3);
      newCell3.Height =NoPic.Height;
      newRow.Height=NoPic.Heig ht;
     }

    }
   //========end image==============// 
   
   TableRow newRow1=new TableRow();
   newRow1.BackColor = System.Drawing.Color.LemonChiffon;
   Table1.Controls.Add(newRow1);
   TableCell newCell4;
      //=========================Buttons=============//
   foreach(DataRow r1 in dt1.Rows)
   {
    newCell4=new TableCell();
    System.Web.UI.WebControls.Button button=new System.Web.UI.WebControls.Button();
    string ButtonName=r1["CatName"].ToString();
    button.Text=ButtonName;
    //button.Click=new EventHandler(
    button.Width=200;
    newCell4.Width=button.Width;
    
    newCell4.Controls.Add(button);
    newRow1.Controls.Add(newCell4);
    newCell4.Height=30;
    newCell4.Width=200;
     
   }
   //==========end buttons==========//
  }


חזרה לתחילת העמוד הצג את כרטיס החבר של Maya חפש הודעות אחרות של Maya
 
ניר
מנהל האתר
מנהל האתר
סמל אישי

הצטרף / הצטרפה: 12 January 2005
מדינה: Israel
משתמש: מנותק/ת
הודעות: 3296
נשלח בתאריך: 02 August 2005 בשעה 15:46 | IP רשוּם
ציטוט ניר

היי,
את יכולה להדביק את כל הקובץ כאן?


__________________
מספר האייסיקיו שלי ו/או כתובת ה-MSN שלי אינם מהווים מוקד תמיכה
חזרה לתחילת העמוד הצג את כרטיס החבר של ניר חפש הודעות אחרות של ניר בקר בדף הבית של ניר
 
Maya
משתמש פעיל
משתמש פעיל
סמל אישי

הצטרף / הצטרפה: 29 June 2005
משתמש: מנותק/ת
הודעות: 75
נשלח בתאריך: 02 August 2005 בשעה 17:15 | IP רשוּם
ציטוט Maya

קוד:

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Data.OleDb;

namespace ORDAN

{

/// <summary>

/// Summary description for WebForm8.

/// </summary>

public class WebForm8 : System.Web.UI.Page

{

protected System.Web.UI.WebControls.Table Table2;

private OleDbDataAdapter myDataAdapter;

private OleDbDataAdapter myDataAdapter1;

private OleDbDataAdapter myDataAdapter2;

protected System.Web.UI.WebControls.Table Table1;

protected System.Web.UI.WebControls.DataGrid DataGrid1;

private OleDbConnection myConnect=null;

protected DataTable dt=new DataTable();

protected DataTable dt1=new DataTable();

short ans;

private void Page_Load(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Inetpub\\wwwroot\\ORDAN\\Tables.mdb";

myConnect = new OleDbConnection(connectionString);

myConnect.Open();

First_Fill();

//   Image1.ImageUrl=@"C:\Inetpub\wwwroot\ORDAN\catalog-pic\1\Sel l_High_Strength_Super_Slim_Fluorescent_Lighting_Fixture.gif" ;

}

#region Web Form Designer generated code

override protected void OnInit(EventArgs e)

{

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

InitializeComponent();

base.OnInit(e);

}

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.Load += new System.EventHandler(this.Page_Load);

}

#endregion

public void First_Fill()

{

Table1.CellPadding = 4;

Table1.CellSpacing = 4;

// TableCell newCell1=new TableCell();

// TableCell newCell2=new TableCell();

// TableCell newCell3=new TableCell();

// newRow.Controls.Add(newCell1);

// newRow.Controls.Add(newCell2);

// newRow.Controls.Add(newCell3);

myDataAdapter=new OleDbDataAdapter("SELECT ImageLink FROM Category ", myConnect);

myDataAdapter.Fill(dt);

myDataAdapter1=new OleDbDataAdapter("SELECT CatName,CatId FROM Category ", myConnect);

myDataAdapter1.Fill(dt1);

myConnect.Close();

//

//

TableRow newRow=new TableRow();

newRow.BackColor = System.Drawing.Color.Violet;

Table1.Controls.Add(newRow);

TableCell newCell3;

//===================Image===============================//

foreach(DataRow r in dt.Rows)

{

newCell3=new TableCell();

System.Web.UI.WebControls.Image img=new System.Web.UI.WebControls.Image();

string ImagePath=r["ImageLink"].ToString();

if(ImagePath!="")

{

img.ImageUrl=ImagePath;

img.Height=100;

img.Width=100;

newCell3.Controls.Add(img);

newCell3.VerticalAlign=VerticalAlign.Bottom;

newCell3.Attributes.Add("align","center");

newRow.Controls.Add(newCell3);

newCell3.Height =img.Height;

newRow.Height=img.Height;

}

else

{

System.Web.UI.WebControls.Label NoPic=new System.Web.UI.WebControls.Label();

NoPic.Text="NO PIC";

NoPic.Height=100;

newCell3.Controls.Add(NoPic);

newCell3.VerticalAlign=VerticalAlign.Bottom;

newCell3.Attributes.Add("align","center");

newRow.Controls.Add(newCell3);

newCell3.Height =NoPic.Height;

newRow.Height=NoPic.Height;

}

}

// //========end image==============================================//

//

TableRow newRow1=new TableRow();

newRow1.BackColor = System.Drawing.Color.LemonChiffon;

Table1.Controls.Add(newRow1);

TableCell newCell4;

//   //=========================Buttons========================== =====//

foreach(DataRow r1 in dt1.Rows)

{

DataTable dt2=new DataTable();

string temp=r1["CatId"].ToString();

ans=Int16.Parse(temp);

newCell4=new TableCell();

System.Web.UI.WebControls.Button button=new System.Web.UI.WebControls.Button();

string ButtonName=r1["CatName"].ToString();

button.Text=ButtonName;

button.TabIndex=ans;

button.Click+=new System.EventHandler(this.Button_Click);

button.Width=200;

newCell4.Width=button.Width;

newCell4.Controls.Add(button);

newRow1.Controls.Add(newCell4);

newCell4.Height=30;

newCell4.Width=200;

}

// //==========end buttons=========================================//

}

private void Button_Click(object sender, System.EventArgs e)

{

short a=(((Button)sender).TabIndex);

ButtonClick b=new ButtonClick(a);

DataGrid1.DataSource=b.X();

DataGrid1.DataBind();

}

}

}


חזרה לתחילת העמוד הצג את כרטיס החבר של Maya חפש הודעות אחרות של Maya
 
Maya
משתמש פעיל
משתמש פעיל
סמל אישי

הצטרף / הצטרפה: 29 June 2005
משתמש: מנותק/ת
הודעות: 75
נשלח בתאריך: 02 August 2005 בשעה 22:07 | IP רשוּם
ציטוט Maya

יש חדש??? משהו???
חזרה לתחילת העמוד הצג את כרטיס החבר של Maya חפש הודעות אחרות של Maya
 
ניר
מנהל האתר
מנהל האתר
סמל אישי

הצטרף / הצטרפה: 12 January 2005
מדינה: Israel
משתמש: מנותק/ת
הודעות: 3296
נשלח בתאריך: 02 August 2005 בשעה 22:16 | IP רשוּם
ציטוט ניר

שלחתי את הקישור אל ההודעה אל כמה אנשים שאולי ידעו

__________________
מספר האייסיקיו שלי ו/או כתובת ה-MSN שלי אינם מהווים מוקד תמיכה
חזרה לתחילת העמוד הצג את כרטיס החבר של ניר חפש הודעות אחרות של ניר בקר בדף הבית של ניר
 
PROG1
משתמש מתחיל
משתמש מתחיל


הצטרף / הצטרפה: 02 August 2005
משתמש: מנותק/ת
הודעות: 2
נשלח בתאריך: 03 August 2005 בשעה 02:12 | IP רשוּם
ציטוט PROG1

אני מקווה שהפעם האמת מישהו יוכל לעזור לי ולא כמו השאלה שלי ב  JAVA

טוב תודה בכל אופן

חזרה לתחילת העמוד הצג את כרטיס החבר של PROG1 חפש הודעות אחרות של PROG1
 
ניר
מנהל האתר
מנהל האתר
סמל אישי

הצטרף / הצטרפה: 12 January 2005
מדינה: Israel
משתמש: מנותק/ת
הודעות: 3296
נשלח בתאריך: 03 August 2005 בשעה 02:15 | IP רשוּם
ציטוט ניר

הבעיה שהשאלות שלך לוקחות זמן, ורוב האנשים שמסתובבים פה עסוקים. מבחינתי אני יכול לשבת ולפתור את השאלה, אבל אין לי את הזמן לשבת...

__________________
מספר האייסיקיו שלי ו/או כתובת ה-MSN שלי אינם מהווים מוקד תמיכה
חזרה לתחילת העמוד הצג את כרטיס החבר של ניר חפש הודעות אחרות של ניר בקר בדף הבית של ניר
 

אם ברצונך להגיב לנושא זה עליך קודם להתחבר
אם אינך רשום/ה כבר עליך להרשם

  שליחת תגובהשליחת נושא חדש
גרסת הדפסה גרסת הדפסה

קפיצה לפורום
אינך יכול/ה לשלוח נושאים חדשים בפורום זה
אינך יכול/ה להגיב לנושאים בפורום זה
אינך יכול/ה למחוק את הודעותיך ותגוביך בפורום זה
אינך יכול/ה לערוך את הודעותיך ותגובותיך בפורום זה
אינך יכול/ה לצור סקרים בפורום זה
אינך יכול/ה להצביע בסקרים בפורום זה