Question : client id with jquery

Hi,

I want to know how i can make the control scrollable http://flowplayer.org/tools/demos/scrollable/index.html

 work with my grid view

I have the code below

Please ehlp

Thanks,

r8VI
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:
<asp:GridView ID="GridViewOutside" runat="server" DataSourceID="SqlDataSource6" AutoGenerateColumns="false"
                    OnRowDataBound="gridviewoutside_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="Year">
                            <ItemTemplate>
                                <asp:Label ID="lblDescription" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Year") %>'>></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a class="prev browse left"></a>
                                <div id="dvGalleria" class="scrollable">
                                    <div class="items">
                                        <asp:GridView ID="InsideGridView" runat="server" AutoGenerateColumns="false" DataSourceID="SqlDataSource7">
                                            <Columns>
                                                <asp:TemplateField HeaderText="Picture">
                                                    <ItemTemplate>
                                                        <img border="0" width="75px" alt="image" height="75px" src='<%# DataBinder.Eval(Container, "DataItem.PictureName")%>' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </div>
                                </div> <a class="next browse right"></a>
                                <br clear="all" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>


    <script type="text/javascript">
        // execute your scripts when the DOM is ready. this is mostly a good habit
        $(function() {

            // initialize scrollable
            $(".scrollable").scrollable();

        });
    </script>

Answer : client id with jquery

I now see where things go awry:
within the items-div, every div represents a set of images to show. Since in your code every image has it's own div, each image is it's own set, ie there's only one image per set.
So what you need to do is set a div every 5th dataitem in the repeater.

So your ItemTemplate becomes this:
<ItemTemplate>
<asp:Literal ID="ltrlOpen" runat="server" Visible="false" Text="<div>"/>
                                                <div class="highslide-gallery">
                                                    <a href='<%# DataBinder.Eval(Container, "DataItem.PictureName") %>' class="highslide"
                                                        onclick="return hs.expand(this)">
                                                        <img border="0" width="75px" alt="image" height="75px" src='<%# DataBinder.Eval(Container, "DataItem.PictureName")%>' />
                                                    </a>
                                                </div>
<asp:Literal ID="ltrlClose" runat="server" Visible="false" Text="</div>"/>
                                            </ItemTemplate>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
protected void SetDivs(object sender, RepeaterItemEventArgs e)
{
if(e.Item.ItemIndex == 0 || e.Item.ItemIndex % 5)
{
Literal ltrlOpen = (Literal)e.Item.FindControl("ltrlOpen");
ltrlOpen.Visible = true;
}
else if(e.Item.ItemIndex % 4 || e.Item.ItemIndex + 1 == Repeater1.Items.Count)
{
Literal ltrlClose = (Literal)e.Item.FindControl("ltrlClose");
ltrlClose.Visible = true;
}
}
Random Solutions  
 
programming4us programming4us