Telerik Radgrid GridDataItem.DataItem Is Empty When Updating?

May 10, 2010

When handling the OnUpdateCommand event on a RadGrid the DataItem is null.

I thought that this would also represent the data item being represented by the row.

The Radgrid is populated from an IList and in the handler the code looks like this...

protected void rgAllocatedClients_UpdateCommand(object sender, GridCommandEventArgs e)
{
if (e.Item is GridDataItem)
{
var gridDataItem = e.Item as GridDataItem;
var client= gridDataItem .DataItem as Client;

This works find when handling the ItemDataBound event but not when handling the UpdateCommand event. I really need this as in my Client class is the Id of the row I want to handle the update for.

View 2 Replies


Similar Messages:

Alternative To Telerik RadGrid?

Jan 14, 2011

Is anyone able to offer any decent alternatives to the telerik ASP.Net controls.

I'm in the market for a decent grid control with all singing all dancing extensions... bt I'm finding the telerik grid really hard work to deal with.

The telerik controls do look good, but after a day of hard work with them I'm just looking to see if there are any other 3rd party offerings?

View 3 Replies

Telerik RadGrid - How To Add A New Row From Code Behind

Feb 5, 2010

What's the simplest way to add a new row to a Telerik RadGrid in ASP.NET from code behind?

View 2 Replies

C# - Any Pointers To How To Use Telerik RADGrid In C Sharp

Mar 24, 2011

give me any pointers for free tutorial on RADGRID or give me a simple example on how to create a RADGRID and bind it to data source.

View 2 Replies

Finding Values In A Telerik Radgrid?

Nov 26, 2010

I've tried to find the answer, but am not having any luck and am wasting to much time trying to figure it out. Using RadGrid from Telerik, latest version of their Ajax Controls, I've added a Select to each row, and can't figure out how to get the value of the selected row. Prefer to get the value of the ID column (from ID field in my database) or other specific columns. C# or VB example will work, VB preferred.

View 2 Replies

How To Refresh Telerik:radgrid Contorl Using Javascript

Oct 5, 2010

How to refresh Telerik:radgrid contorl using Javascript ?

View 2 Replies

How To Remove Filter Button On Telerik RadGrid

Jan 14, 2011

I'm really new to asp.net and Telerik...

I have a RadGrid with filtering. I set AutoPostBackOnFilter="true" and CurrentFilterFunction="Contains" on my columns. Ok it works fine, user don't have to open drop-down list to select type of filter. But now, I want to hide filter buttons.

View 1 Replies

C# - Add Textbox To Telerik Radgrid Confirmation Dialog?

Dec 3, 2010

I need to collect additional information from the user when they initiate a delete on a radgrid. Right now I am presenting the user with a confirmation dialog box that lets them click "OK" to continue but I need to add an additional textbox to collect a reason.

View 1 Replies

C# - Telerik RadGrid - How To Set The MaxLength For The Insert Textbox

Jul 23, 2010

I have a radGrid on the page with the "Add New Record" button. When I click the "Add New Record" button, a textbox appears above each column that allows me to enter values. I want to limit the number of characters that can be entered in the textbox. How do I set the MaxLength of those textboxes

View 1 Replies

Set Telerik RadGrid To Edit Mode By Default?

Dec 7, 2010

I have a checkbox column in a RadGrid that I want the user to be able to check/uncheck it and set the attached property. When the grid renders however, the checkboxes are disabled, because the grid is not in "edit mode". All the examples I'm finding want me to go through a lengthy process of selecting the record, putting it into edit mode, changing the value, saving the value.... yada yada yada...I just want the whole grid to be in edit mode (or the column, or whatever works) from the get-go, so the end user can make a one-click change to the data value. I know there must be a way to do this, I just can't seem to find it.

View 1 Replies

Telerik RadGrid Doesn't Display On First Page_Load But Does On Postback

Mar 17, 2010

I have a page with a drop-down. Based on the selection in the drop-down, data gets loaded and populates a RadGrid. I am using a custom user control for the EditTemplate, so I can't use radGrid.DataBind(). Instead, I have to use radGrid.MasterTableView.Rebind() in association with a NeedDataSource event handler.

My problem is that when I load the page initially, I populate the drop-down and automatically select a value (first item in the list) which triggers the databinding on the RadGrid. I can step through the code in debug mode and see that the grid is being populated with data, but when the page displays, it doesn't get rendered. When I then manually choose an item from the drop-down, which triggers the same grid databinding code, it displays properly the second time.

How do I get it to display the grid the first time the page loads?

View 2 Replies

C# - Extra Column Appearing When Paging In Telerik RadGrid?

Oct 5, 2010

I'm getting a blank column when switching to another page using the default pager in the telerik radgrid. As data for each row, it shows the type of data i am using for the rows (SearchRecord)

Anyone have any clues as to why this may be happening? It doesn't show up on initial population of the grid, but only when I do paging. My columns are built dynamically but i confirmed that when my columns are built, they are the correct number.

View 1 Replies

Telerik RadGrid Doesn't Seem To Export Grouped Data?

Jan 5, 2011

I've got a DNN application using Telerik RadGrid. We're exporting some data from the Grid but when we drill down on the grid control and export the data we only see the initial top level data, never the updated Grid. Here's my table tag and supporting code. I'm not an expert in ASPX/C#so please forgive my newbie-ness.

<mastertableview autogeneratecolumns="False" datakeynames="AccountId" datasourceid="SqlDataSource1"
groupsdefaultexpanded="False">
<DetailTables>

[code]...

View 1 Replies

Find Html Anchor Control In Telerik:radgrid ?

Sep 22, 2010

how to find html anchor control in telerik:radgrid ?

View 1 Replies

Best Practice To Manage Telerik RadGrid Grid And Column Widths?

May 25, 2010

I wanted to ask what is the best practice to manage width of the radGrid.

For my application most users are running 1280 x 1024 so I would be happy to set my overall grid width to 1100. However, depending on the form in use, I sometimes have horizantal scroll bars. To solve this, I have been playing with the width of the grid, and also I have played with setting the itemstyle-width for one or two columns. Sometimes I accidentally get it right, and sometimes it is not quite right.

What is the best way to manage this? Do I set the grid, and then all columns, or just the grid, or just the columns? I guess there is a best practice, so just wondering how you handle it,

View 2 Replies

Using Telerik RadGrid - How To Set The Date Format For Autogenerated Column In Edit Mode

May 23, 2010

Using VS2008, and Telerik radGrid version 2010.1.519.35

I have a about 50 DNN modules using telerik radgrid and I need to display my dates in dd/mm/yy format. It is possible to do this easily in view mode, but when I switch to edit mode, it is more of a struggle. I can write a snippit of code to reformat the displayed date values to dd/mm/yy, but for inserts the user must enter mm/dd/yy.

IOW, I need to change the culture of the form to en-GB culture.

In my DotnetNuke App, I have made a change to the web.config, but it still assumes en-US format.

I am not sure whether I need to set this at web.config level, page level or at the column within the control.

View 3 Replies

How To Change The Data In Telerik's RadGrid Based On Calendar's Selected Dates

Feb 24, 2010

I was creating another usercontrol with Telerik's RadGrid and Calendar.

[code].....

The problems are, (1) when I click the submit button. the data in the RadGrid is not changed. (2) how can we check if there is nothing selected in the Calendar controls, because there is a date (01/01/0001) set even if we do not select anything from that calendar, thus Calendar1.SelectedDate != null is not enough.

View 1 Replies

Data Controls :: How To Check Container DataItem Is NULL Or Empty In GridView

May 7, 2015

I have a

<%# DataBinder.Eval(Container.DataItem, "starttime") % >

i.e. starttime is field in mysql which i bind to asp:Repeater. and  want to print as <span>Start Time:

<%# DataBinder.Eval(Container.DataItem, "starttime") %> </span>

if starttime is not blank ..and if blank, print nothing.. How to do this in asp.net ...

View 1 Replies

E.Row.DataItem Is A List?

Jun 11, 2010

I use this bit of code in the code behind a OnRowDataBound comand of a gridview:

Code:
(int)DataBinder.Eval(e.Row.DataItem, "SectorID")I have made some changes to my Class so that SectorID is now a list of ints. How do i return the first item in the list using the above method?

View 6 Replies

Forms Data Controls :: Getting Text As Empty String When Gridview Cell Is Empty?

Feb 19, 2010

I have a gridview with two bound fields. On clicking a button i want to display the values in first row of gridview in two textboxes. But if gridview cell is empty i am getting the text in textbox to which the value of cell is given as -' 'i know my problem will be solved if i use the template fields instead. But i want a solution while maintaining the bound fields ,if any.

View 2 Replies

Empty Field In SQL Database, Using A Datalist Do Not Display The Empty Fields?

Jan 15, 2010

I have a sql database that on some field will have a empty string/field. I am using a Datalist to display my results. How do I not make the labels that are empty not display? Currently if the field is empty it will leave a space there which my goal is if the field is empty do not leave a white space instead move the other colunms up.

View 2 Replies

C# - How To Get Id Of A DataItem In ListView After DataBound

Sep 7, 2010

i am new in ListView Control. I have a List view to show shopping products. in each data Item i put a link-button for "Add to cart" button. in my scenario clicking on this button causes ShoppingCart.Instance.AddItem("Product GUID") to call. how can i perform that?

i set CommandName="Select" in Link Button and performed this:

[code]....

View 1 Replies

Access Dataitem In Usercontrol?

Feb 4, 2011

I'm using DataTable for DataBinding.

Can I access dataitem (I think its suppose to be DataRow in my case) from aspx?

Something like:

<img alt="" src='<%= DataItem("ColumnName") %>' />

View 6 Replies

C# - Get A The DataItem In A ListView OnItemEditing?

Mar 4, 2011

How can I get a DataItem in a listView in the ItemEditing event?? I thought it would work similar to a repeater but I am at a loss. I need it to do something like this:

protected void lvUsers_ItemEditing(object sender, ListViewEditEventArgs e)
{
var item = lvUsers.Items[e.NewEditIndex];

[code]...

View 2 Replies

C# - Get A Value Out Of A DetailsView DataItem Property

Feb 25, 2011

I am accessing a DetailsView from the following event

public void dvDetails_DataBound(Object sender, EventArgs e)

I am casting the sender to my detailsview like so

DetailsView dv = (DetailsView)sender;

Now when I look in "dv" I can see the DataItem property has the data I want in it under a field name, but I dont know how to write the code access the value??

The field name is shown in the dataitem property as "_DTMON_F", I tried to say

Datetime myDate=dv.DataItem["_DTMON_F"]

BUT C# doesnt like the syntax

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved