databind

asp.net repeater returns weird html

I have a repeater that is supposed to create div tags with their onclick functions from databind. Which is like onclick='<%# "functionname('" + Eval("somestring") +"');" %>' but the single quotes ' after the js func ( and before ) , they become something like ?,= .. I don't understand what's happening. .. the full code is below <d...

ASP ListView: How do I access the data that is databound to the rows?

I want to access the data that was databound to my list view when handling list view events such as: protected void List_ItemDataBound(object sender, ListViewItemEventArgs e) or protected void List_ItemCommand(object sender, ListViewCommandEventArgs e) Inside the events, I can not access the data via somthing like Eval("ID") Curr...

how to get xml html after transpose and databind()

Hi. I have some code that uses xsl and xml. The Xml control is on the design page. The xml control id is xmlApplication The xmlstring is generated and xsl has the format with all the tables and cells etc. Here is a part of thecode of a page which generates the final product which shows the xml in a certain format. xmlApplication.Docume...

WPF Create Rectangle Tags on Image from DataBinding

I'm trying to add image tags to a WPF image and I'm not having much luck. I'd like to do it through databinding if at all possible. Can I set a resource with a DataTemplate to take care of this? Here's what I've been playing with to no avail: <Image Margin="25,4,14,46" Name="MainImage" Stretch="Uniform" ...

What do I miss here so that my asp:Repeater does not work?

I have this class: public class RateResultsSummary { public RateResultsSummary(string labelText, string dataText) { LabelText = labelText; DataText = dataText; } private string _labelText; public string LabelText { get { return _labelText; } set { _labelText = value; } } ...

rebind my dataGridView

Hello My Project include dataGridView Control, and i change the property: gridview1.columns.DataPropertyName at run time Now, i need rebind my gridView, how i do this. in asp.net is simple gridView1.DataBind(), bun how in c#. i try to do this: this.gridview1.DataSource = "MyDataSource" this.gridview1.refresh() and it's not working....

C#.net Populate a datagrid from the result of a .bat file

I have created a .bat file that displays all the users logged in Windows Terminal Services. I can execute the .bat file in my c# code behind and display the results in plain text in a label or text box. What i would like to do is data bind the user name and the session ID in a data grid. protected void Button1_Click(object sen...

Paging with datagridview in asp.net works only from 2nd time

Hi, I have datagridview with paging enabled. But when I want to move from page to another page in the grid, then it only works when I press the 2nd time on some other page. I read some on the internet that I need to bind the data of the gridview but the thing is, I cant bind the data again because the gridview was filled with data in t...

Problem Binding Entity Framework Images to GridView

Hi I'm trying to bind the product pictures to my gridview but nothing shows up... Here's the code: Using ProductsCtx As New CAJFBLL.ProductEntities Dim Produtos = (From P In ProductsCtx.produto _ Join C In ProductsCtx.categoria On C.id Equals P.categoria_1.id _ Join F In ProductsC...

Data Grid View -- binding columns to list

Hello, My project in c# cantains dataGridView and i have a object contain data. public class Data { public List list {get;set;} } the data is init at program start up and the length of list can change. i want to bind the gridView to object that when gridView show each columns in gridview is bound to list in data object like this:...

TextBox - binding property doesn't refresh itself

Hi I have a textbox which Text property is bound like that <TextBox Name="txtBox"> <TextBox.Text> <Binding Path="Data"> </Binding> </TextBox.Text> </TextBox> The filed Data can be changed in various places in my program. However if I change filed Data in ahother control, the t txtBox Tex...

DataBinding to classes

Possible Duplicate: Binding GridView to Objects My C# app contains a Data Object like this: public class Data { public class a {get;set;} public class b {get;set;} } public class a { public int first {get;set;} } public class b { public int second{get;set;} } I initialize my data when the application starts a...

Silverlight dataform blanks out textbox when focus is given to other textbox on form.

I have a data form that I assign a new Entity class as its current item. The problem is when i tab from one textbox on the dataform to the next the first one reverts back to a blank textbox. If hit save it will save the values you typed buy you cant see them once you tab or click on the next texbox. Below is my xaml and code behind. < ...

Accessing a property inside a property

I curently have a set up like below public class ProptsClass { public class ClassA { public list<ClassB> pcb { get; set; } } public class ClassB { public list<ClassC> pcc { get; set; } } public class ClassC { public string _someproperty { get; set; } } } what I want to d...

Setting label text in DataBinding in a GridView (ASP.NET/C#)

Hi all, I need to perform some string manipulation to a columns contents in a GridView, and I'm using the DataBinding event for the template field for this. I'm converting all Environment.NewLine's to 's for outputting. Here is the code: protected void Label1_DataBinding(object sender, EventArgs e) { Label lb = (Lab...

Why is Asp.Net WebForms GridView performing an unasked DataBind() in OnPreRender()?

I'm working with a GridView in an UpdatePanel and perform databinding to an ObjectDataSource using the DataSourceID property. Everything works just fine except for when I perform data validation in the object source and return false from the Update. I use this to set the content and visibility of another control in the GridView. However,...