Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

template column WIDTH

[es] :: .NET :: template column WIDTH

[ Pregleda: 1917 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

kopca

Član broj: 14307
Poruke: 118
*.leased.neobee.net.



Profil

icon template column WIDTH30.12.2005. u 15:52 - pre 195 meseci
Code:
<asp:DataGrid id="grdAgencies" AutoGenerateColumns="false"  CellSpacing="0" CellPadding="0" AllowPaging=True  runat="server" >
                                        <HeaderStyle CssClass="grdHeaders"></HeaderStyle>
                                        <ItemStyle CssClass="grdItems"></ItemStyle>
                                        <AlternatingItemStyle CssClass="grdAlternatingItems"></AlternatingItemStyle>
                                        <Columns>
                                            <asp:TemplateColumn HeaderText="">
                                                <ItemTemplate>
                                                        <asp:CheckBox ID="chckMark" Runat="server"></asp:CheckBox>
                                                    </span>
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                            <asp:TemplateColumn HeaderText="Name">
                                                <ItemTemplate>
                                                    <a href="http://www.yahoo.com">
                                                        <%#DataBinder.Eval(Container.DataItem, "Name")%>
                                                    </a>
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                            <asp:TemplateColumn HeaderText="Description">
                                                <ItemTemplate>
                                                    <a href="http://www.yahoo.com">
                                                        <%#DataBinder.Eval(Container.DataItem, "Description")%>
                                                    </a>
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                        </Columns>
                            </asp:DataGrid>


kako da ucinim da mi je prva kolona sirine npr 15px, druge dve po 200? Pokusavao sam na razne nacine ali ne ide... Hvala unapred!
kopca
 
Odgovor na temu

kaan
Kaurin Andrej
Telerik, Bulgaria
Banjaluka

Član broj: 1741
Poruke: 109
*.broadband.blic.net.

ICQ: 47193919


Profil

icon Re: template column WIDTH31.12.2005. u 14:34 - pre 195 meseci
Za svaku kolonu mozes posebno da definises header i item style.

Code:

<asp:TemplateColumn HeaderText="">
<HeaderStyle Width="15px" />
<ItemStyle Width="15px" />
                                                <ItemTemplate>
                                                        <asp:CheckBox ID="chckMark" Runat="server"></asp:CheckBox>
                                                    </span>
                                                </ItemTemplate>
                                            </asp:TemplateColumn>


Naravno, dovoljno je da stavis sirinu ili u header ili u item.
Ja praktikujem da stavljam sirinu u HeaderStyle da ukoliko je datagrid "prazan" odnosi sirina ostanu isti.
I pazi, stavljaj sirine na sve kolone samo ako si siguran koliko ce da bude sirina cijele tabele jer ce u suprotnom kolone ravnomjerno da se rasire i izgubices tacnu sirinu koju si htio.

Kaurin Andrej
 
Odgovor na temu

[es] :: .NET :: template column WIDTH

[ Pregleda: 1917 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.