w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Find control of repeater nested in datalist on repeater item command
On Item command of Repeater you will have to first find the naming container of sender it will return you datalist item. then in returned list item you will have to find the repeater of that particular data list itme once you will find the repeater you can easily find the controls of the item of repeater

Categories : Misc

ASP.net Nested Repeater Puzzle: Basing inner SQL Query on data from outer repeater
The key is to add an event handler to ItemDataBound that binds data to the nested repeater for each row like this: http://www.codeproject.com/Articles/6140/A-quick-guide-to-using-nested-repeaters-in-ASP-NET

Categories : C#

Nested Repeater Puzzle: Using data returned from (outer) query, in a nested query
Couple of things that should be fixed here: The error "Server tag not well formed" was due to missed double quote after ConnectionString attribute. Remember that everything that goes inside <%# %> must be a valid C# code, which means that that if your are using a string - you should enclose it into double quotes. Typical pattern for quotes here is AttributeName='<%# Eval("Property")%>'. That was not the case in the SelectCommand value. When you need to manipulate with both literals and bound data, like in the select query here, it is better to enclose the whole expression in the servlet tags and perform necessary transformations inside. All in all, here is the result: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSourceGrantCategories"> <Ite

Categories : C#

Add List to Nested Repeater Control
I was trying to do the wrong thing here! I needed to have a RowDataBound command. This updates the nested gridview in the parent gridview. protected void AddPrincipleStaff_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow)// Bind nested grid view with parent grid view { var psid = DataBinder.Eval(e.Row.DataItem, "PrincipleStaffID"); int intpsid = 0; intpsid = Int32.Parse(psid.ToString()); using (var context = new FactoryTheaterModelFirstContainer()) { var query = (from c in context.PrincipleStaffs from p in c.Employees where c.PrincipleStaffID == intpsid

Categories : C#

Cannot "find" Repeater inside a nested Accordian
Your FindControl probably can't see into the AccordionPane. You'll need to traverse down through the top-level (parent) AccordionPane. Something like this: var childAccordionPane = (AccordionPane)parentAccordionPane.FindControl("childAccordionPaneId"); var repeater = (Repeater)childAccordionPane.FindControl("repeaterId"); We can make it compile and work if given your markup to verify the strings representing each of the control IDs is correct.

Categories : C#

Make an asp:TextBox inside a Repeater fire the Repeater's ItemCommand when Enter pressed
Here is a possible approach. Basically you wrap TextBox and LinkButton into the panel. Panel provides an option to specify a default button - that is a button that will be clicked when user hits Enter in the textbox inside this panel. <ItemTemplate> <asp:Panel ID="Panel1" runat="server" DefaultButton="LinkButton1"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Cmd" Text="FireCmd"/> </asp:Panel> </ItemTemplate> Beware that there might be a problem in FF with LinkButton being default - here is a post describing both problem and solution. However it might be outdated - post was written in 2007, things might have changed since then.

Categories : C#

Binding values in repeater ,regarding the selection of first Column in repeater
Here is a way for the scenario you mentioned.. protected void ddlEmployee_SelectedIndexChanged(object sender, EventArgs e) { (((sender as DropDownList).Parent).FindControl("txtAge") as TextBox).Text = "Age"; } Likewise, you can find other controls as well... Note: In the aspx file, you need to add OnSelectedIndex changed event to this DropDownList control in the Repeater and should also set it's AutoPostBack property to True Update: If your model class looks as below class Employee { public int ID {get; set}; public int Age {get; set}; public string Name {get; set}; public string Address {get; set}; } If you have a list of Employees in an object lstEmployees (of type List<Employee>), you can retrieve Name of the Employee having an ID of employeeID of

Categories : C#

Find radio button control in nested repeater control in asp.net?
I found the answer. Thanks foreach (RepeaterItem repeater in TabRepeater.Items) { Repeater repeater1 = (Repeater)repeater.FindControl("ContentRepeater"); foreach (RepeaterItem repItem in repeater1.Items) { for (int i = 1; i <= 4; i++) { string rdboption = ds.Tables[0].Rows[c][0].ToString() + "_" + ds.Tables[0].Rows[i - 1][2].ToString() + "_" + "Option" + i + "_" + i; PlaceHolder PlPreview = (PlaceHolder)repItem.FindControl("PlPreview"); rbt = (RadioButton)PlPreview.FindControl(rdboption); if (rbt.Checked) { // statement } } }

Categories : Asp Net

Repeater inside a repeater with jQuery accordion
I got it! I found this solution! $(function () { $("#accordion").accordion({ collapsible: true, heightStyle: "content" }); }); I need to specify that to attributes and that's it!

Categories : C#

Repeater to xls exports my repeater buttons too into the xls
Basically, you need to implement code that sets the button's (Btn1) visibility to false. When a server control's visibility is set to false, it is not rendered on the page. I would suggest the following code changes: First, create a page-level variable that determines what you are rendering to. You want to set this to default to true, since that is your default status (rendering to the screen) private bool _IsRenderForScreen = true; public property bool IsRenderForScreen { get { return this._IsRenderForScreen; } set { this._IsRenderForScreen = value; } } Then, in the ButtonExporter_Click method, set this variable to false: this.IsRenderForScreen = false; Then hook into the repeater's ItemDataBound event: <asp:Repeater ID="Repeater1" runat="server" OnItem

Categories : Asp Net

Repeater inside repeater - parent ID
Using the referenced answer it will be something like this, just check for nulls of course. protected void ItemBound(object sender, RepeaterItemEventArgs args) { if (args.Item.ItemType == ListItemType.Item || args.Item.ItemType == ListItemType.AlternatingItem) { Repeater childRepeater = (Repeater)args.Item.FindControl("ChildRepeater"); Repeater parentRepeater = (Repeater)args.Item.FindControl("ParentRepeater"); childRepeater.DataSource = YourMethod(parentRepeater.ID); childRepeater.DataBind(); } }

Categories : C#

Python for beginners
Welcome to python. In python everything is easy. Firstly you need to understand your problem on a slightly deeper level though. The problem here is just realizing that you're taking two slightly different sums. A good way to go about this would be to represent them both in a common form (minutes) then do all of your math there and change back only for display purposes. For example: def time_diference(time1, time2): hour_change = abs(int(time1[:2]) - int(time2[:2])) minute_change = int(time2[2:]) - int(time1[2:]) # Change hours to equivalent minutes so you're really comparing apples to apples total_minute_change = hour_change * 60 + minute_change return total_minutes_change def print_time(minute_difference): # Display the answer back to the user print_time(time_di

Categories : Python

SAML simple example for beginners
Typical SSO with SAML is something called Web SSO Profile. There are many products supporting this on the market for example OpenAM OpenSAML and Oracle Identity Federation. WebSSO is done in four steps SP sees that the user does not have an authenticated session. The SP redirects the user to IDP with a SAML AutnRequest as an URL parameter. The IDP authenticates the user and redirects it back to the SP with an artifact in URL parmeter. The SP exchanges the Artifact for an Assertion over SOAP using a ArtifactResolveRequest to the IDP. If you want to code this yourself in Java you can use OpenSAML. On my blog I have many examples on how to use it. In my book, A Guide To OpenSAML, I write alot about this

Categories : Java

Using maphilight for total beginners?
You should have given class mapHiLight to your image. Here is a sample demo for maphilight. Sample Demo Here : Fiddle

Categories : Jquery

r-OSGI ECF beginners tutorials
Would this help?http://wiki.eclipse.org/EIG:Getting_Started_with_OSGi_Remote_Services#Adding_ECF.27_OSGi_Remote_Services_Implementation_to_Your_Target_Platform My point of view: Yes all the concepts for OSGI should also apply to r-OSGI. I am not super familair with r-OSGI but it looks like the primary way to enable an OSGI service to become r-OSGI is to add a property on the exported OSGI service that tells the r-OSGI runtime "take my service and apply it on a efctcp:// port". Basically: an r-OSGI services is just a standard OSGI service that has been exposed using r-OSGI. You can see that here: http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.ds.host/OSGI-INF/hello.xml Where line 6 looks like the only one that applies

Categories : Java

openSearch() in Android beginners app not defined
These methods are just examples that Google put in to show how you would use a switch statement. You can put anything you want in there, but I think the point is to make function calls from a switch statement, instead of putting the code of a function in the statement, to keep code clean. The functions would probably be declared in the same .java file in some fashion like private void openSearch() { // start or show the search activity/fragment } They can technically contain anything you want them to, depending on what you want the action bar button to do. If you simply want to see that the buttons work, you can splash a Toast notification to see something appear private void openSearch() { Toast.makeText(this, "Search button pressed", Toast.LENGTH_SHORT).show(); } You'll hav

Categories : Android

...oracle group by syntax for beginners
You're not allowed to use single function with group function. Like mixing count with single row function. You should include the group by function: select inst.type as "TypeOfInstall" , count(inst.id) as "NoOfInstall" from dm_bsl_ho.installment inst GROUP BY inst.type;

Categories : SQL

How to develop WebRTC application for beginners?
EDIT: updated July 2014 Information about the native WebRTC APIs: WebRTC Internals documentation Getting Started Native API documentation libjingle Developer Guide Shameless self promotion, but for further information about ICE I suggest you look at the WebRTC Infrastructure article I wrote for HTML5 Rocks. There are a number of other WebRTC resources at bit.ly/webrtcwebaudio.

Categories : C++

Java beginners GUI Radio Buttons
Well, for one: the source code is irrelevant here. All you have to do is put private class HandlerClass implements ItemListener instead of private HandlerClass implements ItemListener

Categories : Java

LearnStreet Ruby for Beginners Lesson 9.12
The tutorial is asking you to define a "getter" for the BankAccount class: class BankAccount def initialize(balance) @balance = balance end def balance @balance # remember that the result of last sentence gets returned in ruby end end Then, you can do bankAccount = BankAccount.new 22 # the value 22 is the balance that gets passed to initialize bankAccount.balance # 22 Now, if what the tutorial is asking is a class method (to me it's not really clear), you should do: def self.balance # self is here so you define the method in the class @balance end Then you can do BankAccount.balance

Categories : Ruby

R: Backtesting a trading strategy. Beginners to quantmod and R
Starting with the second question > s <- getSymbols('SPY') > nrow(s) NULL > class(s) [1] "character" > s.data <- get(s) > class(s.data) [1] "xts" "zoo" > nrow(s.data) [1] 1635 So if you want to work on the actual xts object you need to use get. About your first question - i don't think you really need to pull the data as a vector - the xts object is an array indexed by date and it's easy to work with. If you still want to get the data you can use closing.prices <- coredata(Cl(s)) Now, to get you started with simple back testing of strategies i will suggest working in the following steps define your strategy. 2. create an array or add a column to your xts object that will represent your position for each day. 1 for long, 0 for no position and -1 for sh

Categories : R

Haskell skeleton template project for beginners
Make a cabal pkg out of them and install that package locally. Follow a directory stucture as here and use those constuctors in a project rather than across projects. The stucture mentioned is basically a structure of a cabal package. Manually add the input source while compiling through ghc or loading in ghci. Example ghci -i project-utils/A.hs Foo.hs where Foo.hs uses elements exported by A.hs

Categories : Haskell

How to: Accessing RESTful Web Services with Play Framework 2.1 for Beginners
Creating requests is straight-forward. First you provide a URL. There are various methods to add content types, query parameters, timeouts, etc. to the request. Then you choose a request type and optionally add some content to send. Examples: WSRequestHolder request = WS.url("http://example.com"); request.setQueryParameter("page", "1"); Promise<Response> promise = request.get(); Promise<Response> promise = WS.url("http://example.com").post(content); The complicated part is to send it and use the response of the request. I assume you have a controller that should return a Result to the user, based on the web service's response. The result is usually a rendered template or maybe just a status code. Play avoids blocking by using Futures and Promises. The controller's asyn

Categories : Java

How to use repeater inside the repeater
You can get a reference to the child Repeater and bind data to it in the ItemDataBound event this way: protected void parentRep_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (args.Item.ItemType == ListItemType.Item || args.Item.ItemType == ListItemType.AlternatingItem) { Repeater childRepeater = (Repeater)e.Item.FindControl("childRep"); childRepeater.ItemDataBound += new RepeaterItemEventHandler(childRepeater_ItemDataBound); childRepeater.ItemCommand += new RepeaterCommandEventHandler(childRepeater_ItemCommand); childRepeater.DataSource = dt3; //dt3 is the DataTable from your code sample childRepeater.DataBind(); } } Additionally, there are some very thorough answers in this thread: Repeater in Repeater

Categories : C#

Struts 1.1 nested and in combination
Use <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> and the code will look like <c:choose> <c:when test="${element.method1 == true}"> <c:choose> <c:when test="${element.method2 == true}"> <span style="color:green;"><c:out value="${element.prop1}/></span> </c:when> <c:otherwise> <span style="color:red;"><c:out value="${element.prop1}/></span> </c:otherwise> </c:choose> </c:when> <c:otherwise> <span style="color:black;"><c:out value="${element.prop1}/></span> </c:otherwise> </c:choose>

Categories : Java

How to hide a div for tag in an asp:Repeater
Hey you should use html5 data attributes if youre working using modern techniques: <td> <div class="AutoMaticRatingStars floating-left" data-rating='<%# DataBinder.Eval(Container.DataItem, "AutomaticRating") %>'></div> <div class="NoRatingAvailable floating-left">no data</div> </td> $('.AutoMaticRatingStars').each(function () { if ($(this).data("rating") == 0) { $(this).parent().find(".NoRatingAvailable").css("display", "inline"); $(this).css("display", "none"); } }); I changed the jQuery around a bit too. If your code had worked then it would have set every rating star on the page to invisible not just the current one.

Categories : Jquery

Paging With Repeater
Have a look at : void lbl_click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; int currentPage = int.Parse(lnk.Text); int take = currentPage * 10; int skip = currentPage == 1 ? 0 : take - 10; FetchData(take, skip); } What you are saying is that you will display 10 times the number of the currentpage in rows. For instance if you are in page 4 you are going to display 40 rows, whereas in page 5 you will display 50 rows. Then you dictate how many rows to skip, so in first page you will skip none, but in page 4 you will skip 40 - 10 = 30 rows. What you should do is take always a predefined set of rows, ie 10 and then the skip to be a variable. For instance you should have your code as: void lbl_click(object sender, EventArgs e) { LinkButto

Categories : Asp Net

Every 2nd repeater loop
Use alternate template: <asp:Repeater ID="rpt" runat="server"> <ItemTemplate> <div class="left"> Left one </div> </ItemTemplate> <AlternatingItemTemplate> <div class="right"> Right one </div> </AlternatingItemTemplate> </asp:Repeater>

Categories : C#

WPF repeater control
Ok without knowing your logic I cannot validate if you actually need two values going into the converter where 1 is the same for every item anyways. However assuming you indeed do need them: xaml: <StackPanel> <ItemsControl ItemsSource="{Binding Items}"> <ItemsControl.Resources> <local:MyEnumDescriptionConverter x:Key="MyEnumDescriptionConverter" /> <local:MyEnumToBooleanConverter x:Key="MyEnumToBooleanConverter" /> </ItemsControl.Resources> <ItemsControl.ItemTemplate> <DataTemplate> <RadioButton> <RadioButton.Content> <MultiBinding Converter="{StaticResource MyEnumDescriptionConverter}"> <Binding Path="." /> <Binding Path="

Categories : Wpf

ASP.NET Repeater DataItems
Just add your notes row to your item template. <ItemTemplate> <tr> <td> <asp:Label ID="empid" Text='<%#Eval("type") %>' runat="server"></asp:Label> </td> <td> <asp:Label ID="Label1" Text='<%#Eval("ID") %>' runat="server"></asp:Label> </td> <td> <asp:Label ID="Label2" Text='<%#Eval("FirstName") %>' runat="server"></asp:Label> </td> <td> <asp:Label ID="Label3" Text='<%#Eval("LastName") %>' runat="server"></asp:Label> </td> <td> <asp:Label ID="Label4" Text='<%#Eval("Date", "{0:MM/dd/yyyy}") %>' runat="server"></asp:Label> </td> </tr> <tr> <

Categories : Misc

Repeater with 2 datasources
The message class has MessageID, UserID and Content as members. You need to select the Message joined with the User and project only the columns which you want to display. For instance you can define a class named DisplayableMessage, for instance which will have members, such as MessageID, UserName and Content. You can define a method for the class, let's name it GetDisplayableMessage which will initialize a List of DisplayableMessage based on Message and User data. And then you can associate this method to the DataSource of the Repeater.

Categories : C#

QtQuick2 and C++ : Using a Repeater
delegate: tile This is wrong because there's no "tile" name defined in the current scope. You probably want to instantiate a tile component there, so you need: delegate: tile {} This is also wrong for another reason: type names must start with capital letters. So: delegate: Tile {} This is correct, but it won't work as is because QML has no idea where to find the Tile type. You need to add a qmldir file inside your tiles subdirectory containing something like this module tiles Tile 1.0 tile.qml

Categories : C++

Repeater ItemTemplate and DataBinding
I'm not sure it helps I found ones this information about it here: ASP.NET Web Server Controls Templates, which is on a full answer for your question, but maybe helps: A templated control creates an instance of its template contents only on demand. This means that instances of the controls in the template might not be created when the page load event occurs. This behavior can affect how a control inside a template can be used; you cannot assume that a control instance inside a template has been created when the page is loaded.

Categories : C#

How can I use data repeater correctly here
You're mostly on the right track, I think. I'm assuming that your repeater is being populated with a query containing a record for each employee you want to display. For there, you've got a couple of issues: Buttons. Set their "CommandArgument" to the unique key (database ID, whatever) of the record during the bind. Just use ' /> For the project list, if looks like you're looping through every employee record inside of the repeater's ItemDataBound event, which is probably not what you want. The repeater produces a fixed bit of markup for each record in a given set of data. The ItemCreated event is fired as each repeater item is created, one RepeaterItem for each employee assuming that's the data set that you're binding the repeater itself to. I have no idea how you are initially b

Categories : C#

C#/ASP.NET - Cannot have repeater inside HTMLselect
Why is your <select> being run at the server? Remove that attribute and it should compile fine. As the error says, the only valid child element of an HtmlSelect are options or optgroup thingy, not asp repeaters (even if they do create options, the compiler isn't aware of this).

Categories : C#

getting data from repeater controls
I have used Item.FindControl() method to get values. I need to get value inside ItemCommand function. public void repEdit_Itemcommand(object source, RepeaterCommandEventArgs e) { txtField = (TextBox)e.Item.FindControl("txt"); txtField.Text; } Like this you can get other values also from repeater. This worked for me, please try this.

Categories : Asp Net

given datatable, possible to use repeater, gridview, etc
You can use nested repeater to fulfill this requirement, assuming no. of columns are fixed in the datatable. You will have to put 3 repeaters. example: <asp:Repeater ID="repeaterDept" runat="server"> <ItemTemplate> <asp:Repeater ID="repeaterSection" runat="server"> <ItemTemplate> <asp:Repeater ID="repeaterTitle" runat="server"> </asp:Repeater> </ItemTemplate> </asp:Repeater> </ItemTemplate> </asp:Repeater> Now, derive distinct Departments from your datatable and bind repeaterDept with that. On, ItemDataBound event, retrieve respective child sections of the binding department and bind it with repeaterSection. Follow the same for repeaterTitle. I t

Categories : C#

ASP.NET Repeater with UserControl & Postback
If I understood correctly your question the data is bounded but does not appear in your repeater right? So this code may help you to solve it: protected void yourRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { MyDataBoundedObject bounded = (MyDataBoundedObject)e.Item.DataItem; Label lbText = (Label)e.Item.FindControl("myText"); lbText.Text = bounded.myText; }

Categories : C#

asp repeater download file c#
Your method name in OnItemCommand = "Dwn" must match the method name in your code-behind. Rename your Save method to Dwn, or change your markup to match the Save method name. Refactor the code like this: if(e.CommandName == "Save") { int index = Convert.ToInt32(e.CommandArgument); string fName = row.Cells[2].Text; Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment;filename=" + fName); Response.TransmitFile(Server.MapPath("~/uploadsadmin/" + fName)); Response.End(); } Put your breakpoint on the conditional (if...) and see if the breakpoint is hit.

Categories : C#

Bind 3 items in each row of a repeater VB.net
Change your markup to this: <asp:Repeater EnableViewState="true" ID="rptStart" runat="server"> <HeaderTemplate> <table> <tr> </HeaderTemplate> <ItemTemplate> <%#If((Container.ItemIndex <> 0 AndAlso Container.ItemIndex Mod 3 = 0), "</tr><tr>", String.Empty)%> <td style="width: 25%;"> <asp:CheckBox ID="chkColor" runat="server" /> <img id="imgCompStatusStar" runat="server" enableviewstate="false" src="../images/" /> <asp:Label ID="lblStarDescription" class="floating-left" runat="server" CssClass="test" /> </td> </ItemTemplate> <FooterTemplate> </tr></table> </FooterTemplate>

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.