Drawing Image

Last post 01-09-2008 11:03 PM by murthysrn. 5 replies.

Sort Posts:

  • Drawing Image

    12-24-2007, 5:55 AM

    Hello All

    Im Developing a Web Application Using ASP.NET(2005,VB).

    I need to draw a boxes based upon inputs i give

    The Inputs are A,B

    B is Child of A

    if i give input for A as 10

    it should draw 10 boxes

    In that box , it should Split depending on value i give for B

    lets B=3

    Then it should Split in to 3

    How to do this

    PLease Help me

    Thanks in Advance

    Regards

    Balagangadharan.R

     

     

     

    Filed under: ,
  • Re: Drawing Image

    12-26-2007, 5:07 AM
    • Participant
      884 point Participant
    • murthysrn
    • Member since 12-15-2006, 12:22 AM
    • Bangalore
    • Posts 312

    lblMessage is a lable in web page

    and call the  DrawTable() in page load.

    for display inamge  u can

     //----------------------------------------------------------

    private
    void DrawTable()

    {

    int IntRow = 4;//U can Use text box here

    int IntColumn = 3; //U can us TExt box here to display

    lblMessage.Text= "<table border='2' bordercolor='blue'>";for (int _intRow = 0; _intRow < IntRow; _intRow++)

    {

    lblMessage.Text = lblMessage.Text+("<tr>");

    for (int _intCol = 0; _intCol < IntColumn; _intCol++)

    {

    lblMessage.Text = lblMessage.Text + (
    "<td>");

    lblMessage.Text = lblMessage.Text + ("Image Here");

    lblMessage.Text = lblMessage.Text + ("</td>");

    }

    lblMessage.Text = lblMessage.Text + (
    "</tr>");

    }

    lblMessage.Text = lblMessage.Text + (
    "</table>");

    }

     

     //----------------------------------------------------------

    Thanks & Regards,
    Murthy.
  • Re: Drawing Image

    12-28-2007, 11:02 PM

    HI Murthy

    Thanks For replying

    Its works fine

    and one more thiing i need from you

    i need to restrict the columns to fit within the page width

    i created a query and i filled in dataset based upon the rows in dataset

    i used your coding to create table, if my dataset rows count is 20 , it exceeds the page width.

     how to solve this problem

    please help me

    Thanks in advance

    Regards

    Balagangadharan.R

     

     

     

    Filed under: ,
  • Re: Drawing Image

    12-30-2007, 11:08 PM
    • Participant
      884 point Participant
    • murthysrn
    • Member since 12-15-2006, 12:22 AM
    • Bangalore
    • Posts 312

    hi it may help u?,

    You have to use css class/Styles sheets. there you have to fix the width by getting/setting the pixel points or the distance

    then you will get the result.

     

    //---------------------------------------------------------

    private void DrawTable()

    {

    int IntRow = 4;//U can Use text box here

    int IntColumn = 3; //U can us TExt box here to display

    lblMessage.Text= "<table border='2' bordercolor='blue' width='800px'>";for (int _intRow = 0; _intRow < IntRow; _intRow++)

    {

    lblMessage.Text = lblMessage.Text+(
    "<tr>");for (int _intCol = 0; _intCol < IntColumn; _intCol++)

    {

    lblMessage.Text = lblMessage.Text + ("<td width='30px'>");

    lblMessage.Text = lblMessage.Text + ("Image Here");lblMessage.Text = lblMessage.Text + ("</td>");

    }

    lblMessage.Text = lblMessage.Text + (
    "</tr>");

    }

    lblMessage.Text = lblMessage.Text + ("</table>");

    }

    //--------------------------------------------------------

     

     

    Thanks & Regards,
    Murthy.
  • Re: Drawing Image

    01-01-2008, 12:35 PM
    • Participant
      888 point Participant
    • KelseyThornton
    • Member since 07-15-2007, 12:01 PM
    • Breda, The Netherlands
    • Posts 229

    Wouldn't it be better setting the widths in percent, rather than pixels?

    The table you have specified assumes all the clients are not running at less than 800 pixels wide...

    Kelsey Thornton
    (In the Netherlands)

    Don't forget - Mark the post which answered your question with "Answer", then that user will get some kudos, and your post will be marked as "Answered" for future readers!

    (VB code examples preferred)
  • Re: Drawing Image

    01-09-2008, 11:03 PM
    • Participant
      884 point Participant
    • murthysrn
    • Member since 12-15-2006, 12:22 AM
    • Bangalore
    • Posts 312

    Hi, 

     Modify your  aspx page as folows.... 

    <asp:Panel ID="pnlReport" runat="server" Width="800px" Height="350px" ScrollBars="Auto" Wrap="false">

    <asp:Label id="lblMessage" runat="server" />

    </asp:Panel>

     

    Thanks & Regards,
    Murthy.
Page 1 of 1 (6 items)