Datagrid Template Column size control

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Datagrid Template Column size control

    Hello guys,

    I have a datagrid with 2 Template columns. 1 colum which has all the data in
    the form of a HTML table and other which has
    an image control and shows the image there. I only show the detail of 1 item
    there. However, the height of the datagird is much
    bigger than I want it to be. It shows the details in the top and the bottom
    all blank. I set the width and hieght to fix sizes but it
    doesn't work.

    How to control the size of datagrid with customized columns?

    I have something lik this

    ..
    ..
    ..
    <tr>
    <td align="left"><b>Colour Screen</b></td>
    <td><%# DataBinder.Eval(Container.DataItem, "ModelColour") %></td>
    </tr>

    </table>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="Image">
    <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
    <ItemTemplate>
    <asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ModelImage")
    %>' runat="server">
    </asp:Image>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>

    TIA


    Annie Guest

  2. Similar Questions and Discussions

    1. Calendar within DataGrid Edit Control or Template Column
      I'm currently trying to build a calendar functionality into a datagrid that opens a new web page. Once the user selects the date in the new page,...
    2. Dynamic Template column in DataGrid control
      Hi Everybody, I am trying to create a dynamic template column in a datagri control using the ITemplate interface. //part of my code in the...
    3. How can I dynamically add a control to a DataGrid Template column?
      I want to do the following: // create the template column ... TemplateColumn tc = new TemplateColumn(); tc.HeaderText = "Location";...
    4. Dynamic Template Column Sorting in DataGrid control
      Hi, am facing a problem while using ASP.NET Datagrid Template Columns generated dynamically. Scenario: ------------- 1) I have a custom...
    5. How to Bind a DropDownList control to a DataGrid in Template Column?
      I'm having a tough time with this, and I can't find any resources that address it. I have a DataGrid comprised of Template Columns, in which I have...
  3. #2

    Default Re: Datagrid Template Column size control

    Guys,

    I sorted out this issue my self ... I created a value in my .css file for
    ..gridTable and set the values there.
    It works great now.

    Thanks

    "Annie" <myjunksandforums@gmail.com> wrote in message
    news:4320eeb2$1@dnews.tpgi.com.au...
    > Hello guys,
    >
    > I have a datagrid with 2 Template columns. 1 colum which has all the data
    > in the form of a HTML table and other which has
    > an image control and shows the image there. I only show the detail of 1
    > item there. However, the height of the datagird is much
    > bigger than I want it to be. It shows the details in the top and the
    > bottom all blank. I set the width and hieght to fix sizes but it
    > doesn't work.
    >
    > How to control the size of datagrid with customized columns?
    >
    > I have something lik this
    >
    > .
    > .
    > .
    > <tr>
    > <td align="left"><b>Colour Screen</b></td>
    > <td><%# DataBinder.Eval(Container.DataItem, "ModelColour") %></td>
    > </tr>
    >
    > </table>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > <asp:TemplateColumn HeaderText="Image">
    > <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
    > <ItemTemplate>
    > <asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ModelImage")
    > %>' runat="server">
    > </asp:Image>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    >
    > TIA
    >

    Annie Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139