Showing posts with label template. Show all posts
Showing posts with label template. Show all posts

Wednesday, March 28, 2012

Link inside a draghandles template

Is it possible to access a link or a textbox inside a draghandle's template?

I want all the controls inside the draghandle to be dragable and also that users could click on these controls inside the draghandle

talking about ReorderList's DragHandle..

I"m trying to do a similar thing. Originally, I wanted to be able to drag any portion of a ReorderItem to a different position. The problem I ran into is that if you don't declare a position for the DragHandle, you can drag from any place on the ReorderItem BUT this means you cannot click on any controls that are contained in the ReorderItem, making them all useless. The control thinks that if you click ANYWHERE, you're trying to drag it, so the controls can never be used.

So, to remedy this problem, I thought to do exactly what you're doing. I added a <DragHandle> to the left side which contains a Label; this Label was to hold the sequence number of the ReorderItems (so the first item would have a 1, the second would contain a 2, etc), but like you I cannot access this control from the code behind when the Reorder event fires.


your problem seems diferent than mine. I don't have any problems accesing controls in the code behind. I'm trying to figure out how to make some parts of the draghandle dragable and some of them "clickable". I guess i need to construct some <div> element consisting of several other <div> elements and put a draghandle inside one of them. But here is another problem: you cannot place the draghandle anywhere you like, just four possitions. So i cannot put it inside a particular <div> element

I guess i need to think another way to do it

List View Template-Table layout

Is it possible to set the template to generate table rows?Yes. There's 1 gotcha though: you need to define a tbody as well. So, the template for tables should look like:

<table runat="server">
<tbody>
<tr id="itemTemplate" runat="server">... </tbody>
</table>

Wilco,

I am having issues with this too, getting unknown runtime errors. Do you have a working example?

My code (probably far from what it should be):

<tablecellspacing="0"cellpadding="0"frame="box"style="border-collapse: collapse;">
<tbody>
<atlas:ListViewID="listEmails"runat="server"ItemTemplateControlID="itemTemplate"CssClass="list"ItemCssClass="row"AlternatingItemCssClass="altrow">
<LayoutTemplate>
<trid="itemTemplate"runat="server">
<tdid="itemTemplateColumn"runat="server">
<atlas:LabelID="lblAddress"runat="server">
<Bindings>
<atlas:BindingDataPath="Address"Property="text"/>
</Bindings>
</atlas:Label>
</td>
<td>
...
</td>
</tr>
</LayoutTemplate>
</atlas:ListView>
</tbody>
</table>

Thx
dB.


Got it. The table and tbody have to go inside the LayoutTemplate. It's a little confusing ...

<atlas:ListViewID="listEmails"runat="server"ItemTemplateControlID="itemTemplate"CssClass="list"ItemCssClass="row"AlternatingItemCssClass="altrow">
<LayoutTemplate>
<tablecellspacing="0"cellpadding="0"frame="box"style="border-collapse: collapse;">
<tbodyid="trBody"runat="server">
<trid="itemTemplate"runat="server">
<td>
<atlas:LabelID="lblAddress"runat="server">
<Bindings>
<atlas:BindingDataPath="Address"Property="text"/>
</Bindings>
</atlas:Label>
</td>
<td>
...
</td>
</tr>
</tbody>
</table>
</LayoutTemplate>
</atlas:ListView>


Please look at my previous post. The sample code disappeared cause the HTML in my message was not encoded. I tried to encode it myself, but it looks like the forum is a bit screwed up.

Anyway, as you can see the table/tbody should be inside the template. Also note which tags need to runat server...