dataitem

Get DataItem when updating GridView

How can I get the underlying DataItem from a GridView row that is in edit mode and the user clicks on "Update"? I have an editable GridView. I've added a CustomValidator to the Edit view of one of the columns. When the user clicks on Update I run a server validate method and need to get the underlying DataItem of the row being edited ...

Asp.Net LinkButton Onclick = method( container.dataitem ), need help with syntax

I have a linkbutton that I want to call a method in the code behind. The method takes a parameter of which I need to stick in a container.dataitem. I know the container.dataitem syntax is correct because I use it in other controls. What I don't know is how to user it a parameter for a method. Upon clicking on the button, the method shoul...

ASP.NET Retrieving GirdViewRow.DataItem on arbitrary post back

Hi there, Is there any way to get a GridViewRow's DataItem property in the handler for an arbitrary post-back?? All DataItems have values during the RowDataBound event, but are null in Button_Click for example, im assuming because the Grid is in the process of being databaound in the first event. I do some formatting on the fly in Row...

Using '<%# Eval("item") %>'; Handling Null Value and showing 0 aginst

If dataitem is Null I want to show 0 <asp:Label ID="Label18" Text='<%# Eval("item") %>' runat="server"></asp:Label> how can I accomplish this? Thanks ...

How can i set a DataItem to some part of aspx code?

I have some code like this: <div><%# DataBinder.Eval(Container.DataItem, "M_ClassProperty") %></div> <img src='<%# DataBinder.Eval(Container.DataItem, "M_AnotherClassProperty").To<string>() %>' but there is no component which wraps this code like Repeater, DataList or something like that. How can set the set a DataItem to this code t...

Programatic control using Telerik OpenAccess ORM and the RadGrid

Ok, between following documentation, posts and videos that use syntax and tools that are no longer used or available, I'm really lost as to how to go about even using Telerik's OpenAccess. So I thought I'd ask for some help and hopefully someone out there has done this before. I want to simply bind my OpenAccess entities to a RadGrid, ...

ASP.NET / DataItem of DataList is null after Postback

After postback (click on a button) in my ASP.NET form, all the DataItem of my form are null. Why? What should I do to retrieve the content of the DataList even after postback? protected void buttonAddRecord_Click(object sender, EventArgs e) { foreach (DataListItem item in listFields.Items) { // item.Data...

DataItem on Repeater.Items is always null

I am setting the DataSource of my repeater to a List (MyProducts is a simple class, consisting of only get/setters). After this and DataBind(), I can see in debugging mode that DataItem of each Repeater.Items is null. When making a postback and trying to update MyProducts, the Repeater.Items[n].DataItem is still null and Im not able to ...