.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Help!!! How can I get item index in jquery template?

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
How can I get item index in jquery template?Something likes: ${itemIndex}http://github.com/jquery/jquery-tmplHelp me!!!

View Complete Post

More Related Resource Links

gridview item template Tab index and focus problem ???


Hi .... i have used the below gridview item template , which is working fine.

No Problem here.


I need to set Tab Index here.

1. I have a textbox outside of gridview , on pressing the tab from the textbox in need to focus on gridview item template first row.

2.After user click add new button, again i want to focus on the second row on the gridview item template first column.

Plz help me to do so ....

jquery datepicker not popping up in Gridview Edit Template textbox


I have a gridview that I can't for the life of me get the datepicker calender to pop up for.  I've been using the datepicker for months very successfully for a variety of textboxes on the page and inside of formviews but this is the first time I've tried using with gridview.  I didn't expect any issues however can't seem to find anything to work.  I have searched the forums for 2 days and attempted any suggestions found within the solutions to no avail.  I've tried using the CSS to link the datepicker but everything stopped working when I changed the code and my page which uses a css style already got all distorted looking.  Please help!

Here is my gridview (only included a part b/c it is large and am only having problem with the datepicker for the date completed text box)

<asp:GridView ID="GridViewCompleted" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid"
        BorderWidth="3px" CellPadding="4" DataKeyNames="job_id" DataSourceID="SourceJobProjectCompleted"
        ForeColor="Black" CellSpacing="2">

listview 3.5 bind dropdownlists edit item template VB.NET


I am trying to do this with many issues of data binding doubling the amount and not setting selectedValue on dropdownlist. I have read some posts and they help but I am missing a crucial piece. My problem is that my dropdownlist is doubling the amount of records for the dropdownlist. Instead of "YES;NO;SELECT A VALUE", I am getting "YES;NO;SELECT A VALUE;YES;NO;YES;NO". My database is correct with the UPDATE part but the rebind after update is failing horribly.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack Then
            If Session("ACTIVETAB").ToString() = Session("SUBCONTRACTSATABNO").ToString() Then
            End If
        End If
    End Sub

    Public Function loadlookups(ByVal id As String, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) As DataTable
        Select Case id
            Case "ddlCertReceived"
                dt = GetLookupTable("SubcontractsA", "Sub 1 Cert Received")
                Dim ddlCertReceived As DropDownList = _
                CType(e.Item.FindControl("ddlCertReceived"), DropDownList)
                ddlCertReceived.DataSource = dt
                ddlCertReceived.DataTextField = "lup_text"

listview with button in item template - how do I handle the click event?

Hello,Using a listview control for the first time... I need a button for each item, and of course I need to handle the click event for the buttons... upon clicking a particular button I of course need to know which item the button is associated with so the appropriate action can be taken...In VS, I can't select the button and see my list of available events in the properties window like is normally done for controls outside of templates like this... what do I need to do?

Jquery.tools tabs doesn't retain tab index on postback

The graphic designer of a project I'm building a web site for chose jquery.tools (http://flowplayer.org/tools/tabs/index.html) for a tabs tool in the site. Unfortunately it seems that the tool doesn't behave properly on a postback in IE7 or IE8 (it does behave properly in FireFox, Chrome and Safari). Does anyone have experience using the jquery.tools with asp.net? and know how to retain the tab index on a postback? I've tried a lot of things and can't get it to work. The code i'm using now is as follows:           $("ul.tabsScenario").tabs("div.panes > div");         var tabIndex = $('#ctl00_ContentPlaceHolder1_EnInDeToekomst1_HiddenFieldTabIndex').val();         $("ul.tabsScenario").tabs('select', tabIndex); where the tab index is stored in a hidden field (HiddenFieldTabIndex). The above code works fine in Firefox, Chrome and Safari, but not in IE7 or IE8. I am using a ScriptManager and UpdatePanels, but in an extremely simple website example I can't even get the jquery.tools tabs tool to work. There are some unanswered posts on the Jquery.Tools forum concerning this topic, but yeah, that doesn't help much. I've already determined that the

Please help me with client template jquery!!!

I use webservces to response Json data (xml -> json by using Json.NET)My xml file:<?xml version="1.0" encoding="utf-8" ?><navigation>    <item title="Home" url="/"></item>    <item title="Home" url="/"></item></navigation>I received through $ ajax call and have json object like this:{"?xml":{"version":"1.0","encoding":"utf-8"},"navigation":{"item":[{"title":"Home","url":"/"},{"title":"Home","url":"/"}]}}Still now, i don't know how to write client template sytax to generate menu like this<li><a href="...">name here</a></li>I see some example write so simple but my json has more node so i don't the way to access child node.<script id="clientTemplate" type="text/html">        <li><a href="${url}">${title}</a></li></script>Anybody help me. I want to create menu from xml + client template!!!P/S:When i see in Firebug (Firefox add-in), i see json object like this: {"d":"{\"?xml\":{\"@version\":\"1.0\",\"@encoding\&q

gridview item template

Hi, I have a gridview which the columns are created programmatically.When a button is click i will clear all columns and add the columns that I want. Im adding a boundfield which is not a problem. When I add a template field, I must add also the item template which is my problem.How can I add a item template in the template field I created which is binded in my datasource. Also what event handler should I use to do this.Here's the part of my code:Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click GridView1.Columns.Clear() Dim en As New BoundField en.HeaderText = "Employee Number" en.DataField = "Employee Number" GridView1.Columns.Add(en) Dim n As New TemplateField n.HeaderText = "Name" GridView1.Columns.Add(n) AccessDataSource1.SelectCommand = "Select * from Employee" GridView1.DataBind() End Sub Someone know how can  I bind a label item template from the datasource. The label item template should be firstname + middlename + lastname.If im not doing it programatically, it will be just concatenating eval(). But how can create item template and bind it programmatically??.

How do I get an item of a collection by index?

Hello, I have a StackPanel whose children are all Expander controls. I can Add an Expander control to the StackPanel. I can Insert an Expander control into the StackPanel at specific location. I can Remove an Expander control from the StackPanel at a specific location. But, I cannot find a way to get one Expander control from the StackPanel. There is a CopyTo, but that is for copying to an array, I only need to look an one Expander control at a specific location. Since I can Insert into a specific location and Remove from a specific location, you'd think I'd be able to look at a specific location. The following does not work, where "s" is the StackPanel, p (an int) is the position, and there is an Expander control at that location: Expander x = s[p]; // [] is not allowed on collections. How do I get an item of a collection by index?  Regards, Robert Note: I work on various aspects or one or more programs, working on what is most important at the time. Some questions I ask are on aspects of the program that are not important right now or I'm using a workaround for now. I'll eventually get back to those answers received and respond. Those that are high priority get responses very soon. Thanks for your input, it is appreciated.

jQuery instead of UpdatePanel (repeater loads when item in dropdown is selected)

Hello!I want to develop web page on which most of the things happens on clientside. The page contains several tabs (jQuery). One tabbed section have repeater which load when item in dropdown is selected.I've placed this 2 controls in UpdatePanel. Does somebody have any example how to achieve this without UpdatePanel, with jQuery?  I've heard that UpdatePanels are bad for page performance. I'm very new to jQ and Ajax.Thanks!all the bestBlaz

Dropdown select message in item template gridview dropdwon list ???

Hi ....I have used gridview item template , which has two dropdown list .The first dropdown list is binded from database to the dropdown list I have using the below code , to show the select message in dropdown list before selecting any item from dropdown list.In first row its show me --Select-- message and my vaues.. if i select some value form dropdownlist and click add new button it will create a new row dynamic then in previous row again it come back --Select-- message... on going to second row....I need to remain first row user selected value on going to next row.The New row will show --select-- message..Please go to my code and let me know what to do<asp:DropDownList id="DropDonList2" tabIndex=11 runat="server"          OnSelectedIndexChanged="DropDonList2_SelectedIndexChanged" AutoPostBack="True"          DataTextField="SizeRange" DataValueField="SizeRange"          OnDataBound="DropDonList2_DataBound" __designer:wfdid="w10"          AppendDataBoundItems="True">  <asp:ListItem Value="-1">Select</asp:ListItem> </asp:DropDownList><asp:DropDownList id="DropDonList2" tabIndex=11 runat="server" 

WPF ComboBox Key Index not working when using data template selector


Hi all,

I have a problem regarding WPF combobox when using data template selector.

Basically, WPF combobox has a standard behaviour which will take you directly to the item that starts from a character if you type that character using keyboard. I don't know the official name for this functionality and will temporarily call it "Key Indexing".

I now want to create a ComboBox which displays its item differently. I achieved this using DataTemplateSelector;

        <ComboBox SelectedItem="{Binding Selection}" x:Name="Input" ItemsSource="{Binding Parties}">
                <Editor:PartyTemplateSelector DefaultTemplate="{StaticResource Default}" NewTemplate="{StaticResource New}" OldTemplate="{StaticResource Old}"/>


And the PartyTemplateSelector is:

    public class PartyTemplateSelector : DataTemplateSelector

display data in item template in datalist


my data is in dataset is like this:

firstname  lastname  middlename

xyz          xyz1         xyz2

Pqr          pqr1         pqr2

i want to it display like this format in datalist

firstname          xyz        Pqr

lastname          xyz1       pqr1

middlename     xyz2        pqr2

please help me if somebody is know

i am not able to set this table formate in item template of datalist

Jquery MVC item info popup



  I am still new to Jquery and trying to sell my boss on it.

Is there any good examples that show how I can say when the user mouses over an area of the screen( for a certian Item) it would popup the details of that item?

I am using vs 2010 / mvc 2  and would like to use Json to get the data for the popup. So it does not have to be loaded all at one time.




How to Create a Custom Item Template and Project Template

When you're working on a web project, there are times you wish you could have captured all of the stuff you're working on often and then re-use it later on, similar to code snippet. For example, if you work with JaveScript, HTML5 a lot, you would want to be able to create a new web project that already has a predefined set of jQuery library, or add a new page that already has references to the new HTML5 doctype and the jQuery libary, so you don't have to constantly modify the page to add those in. You can achieve this by creating your own Item Template and Project Template. Recently, Rey Bango has posted a nice blog about this topic at How to Create HTML5 Website and Page Templates for Visual Studio 2010 . Joe Cartano also had a blog about it...(read more)

jquery on datalist item


 Hi! i have a problem with datalist and  jquery. i have a datalist. In it, i'm showing my products. Its formation is like below:

<asp:datalist ...>

there are labels in table.i bind datas tihs labels' text properyties. also, i have a class that makes adding products to shoppingbasket. when iclick the linkbutton in datalist, i want to add that product to the shopingbasket. but i can't take the values in datalist. how can i accomlish this?



accessing checkbox list from with in edit item template.


Protected Sub dsEmployeesByDepartments_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting
        'Determine which checkboxes have been checked
        Dim selectedDepartmentIDs As New List(Of String)
        For Each li As ListItem In CategoryList.Items
            If li.Selected Then

JavaScript Calculation in gridview item template with some condition ???


Hi ...

My javascript to calculate gridview columns on gridview databound

<script type="text/javascript" language="javascript">  
    function CalcAmount(quantity1, price1, amount1)
        document.getElementById(amount1).value = parseFloat(document.getElementById(quantity1).value) * parseFloat(document.getElementById(price1).value);  

Gridview Cs code

 protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)

                    if (e.Row.RowType == DataControlRowType.DataRow)
                    TextBox txtQuantity = (TextBox)e.Row.FindControl("TextBox1");
                    TextBox txtPrice = (TextBox)e.Row.FindControl("TextBox34");
                    TextBox txtAmount = (TextBox)e.Row.FindControl("TextBox4");

                    TextBox txtQuantity1 = (TextBox)e.Row.FindControl("TextBox2");
                    TextBox txtPrice1 = (TextBox)e.Row.FindControl("TextBox34");
                    TextBox txtAmount1 = (TextBox)e.Row.FindControl("BP");

                    txtPrice1.Attributes.Add("onkeyup", "CalcAmount('" + txtQuantity.ClientID
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend