how to check columnspan in aspx page (not code behind)

G

geronimi

I want to make a linkbutton column if the column span for that row is
4, if it isn't, make a boundcolumn. These columns are part of a
datagrid. I want to use these code below. In the If statement I want to
check to see if the ColumnSpan = 4, how can I do that? I need the check
the ColumnSpan of the current row, because sometime there is a header
row (spanned over 4 columns) that doen'st need a buttoncolumn

<asp:datagrid id="dgCustomers" runat="server"
AutoGenerateColumns="False" HeaderStyle-CssClass="header4">

<Columns>

<%if not ColumnSpan = 4 then%>
<asp:ButtonColumn DataTextField="Klant" HeaderText="Name"
ItemStyle-CssClass="normal"
ButtonType=LinkButton CommandName="PassSelectedClient"
</asp:ButtonColumn>
<%else%>
<asp:BoundColumn DataField="Klant" HeaderText="Name"
ItemStyle-CssClass="normal"
ItemStyle-Width="250px"></asp:BoundColumn>
<%end if%>
<asp:BoundColumn DataField="Klant" HeaderText="Name"
ItemStyle-CssClass="normal"
ItemStyle-Width="250px"></asp:BoundColumn>
<asp:BoundColumn DataField="Address"
HeaderText="Address" ItemStyle-CssClass="normal"
ItemStyle-Width="300px"></asp:BoundColumn>
</Columns>
</asp:datagrid>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top