C# - Accessing Linq Data In Telerik Grid ItemCreated Method?
May 17, 2010
I have a telerik grid bound to a Linq data object, however, I limit the fields returned:
<IQueryable>filter = data.Select(x => new {x.ID, x.Name, x.Age});
I would like to access these fields in the ItemCreated method of the grid:
protected void rgPeople_ItemCreated(object sender, GridItemEventArgs e)
{
Telerik.Web.UI.GridDataItem item = (GridDataItem)e.Item;
?????? Person = (???????)e.Item.DataItem;
}
What do I declare ?? as so that I can use:
String ID = Person.ID;
String Name = Person.Name; etc
View 2 Replies
Similar Messages:
Dec 15, 2010
How can i pass asp.net mvc telerik grid data to controller using Ajax call.I need to save the telerik MVC grid data in database.
View 2 Replies
Jun 29, 2010
I want to select the row of telerik radgrid and get the value of column 1For thi can't use select or deselect columns, Here i want to select row by clicking only.here I also require code to get the value of column 1 of selected row
View 4 Replies
Oct 20, 2010
[Code]....
And in a submit button click event,I am writting the following code:ut,the problem is:I am gettting null for ChannelNumber,ServiceID,TransponderID,NetworkID,i.e.,not being able to access the values entered in those respective textboxes.Where am I going wrong?Do I need to write the same code in diff event?or diff code in diff event
View 1 Replies
Apr 13, 2010
I am creating an Asp.net web site which will support dynamic data. When I am creating a dynamic web site from Scratch (from template in VS) all is working fine. But when I am trying to add dynamic entity (.edmx) file and running the application I am getting following error
"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'. "
View 2 Replies
Nov 22, 2010
I have a telerik grid with a checkbox. I am using a client template. There is a .DataBinding Ajax call attached. When the grid initially comes up, instead of a checkbox, it has the id value as text.If I hit refresh, the ajax call gets executed and when it comes back the checkbox appears. Is there any way to force the ajax call to happen when the grid initially paints so that I have a checkbox and not text..
View 1 Replies
Sep 3, 2010
Currently i am using Telerik grid which filters are applied to each column. I am binding the SQL result set to grid. If the result set is empty from the database while binding, I should disable the filter option in the grid.
How can i achive the same through ASPX or Code behind using C#. Does Telerik Grid have any property to disable the filtering option when thre are no records.
View 2 Replies
Nov 18, 2010
Currently i am using Telerik grid which filters are applied to each column. I am binding the SQL result set to grid. If the result set is empty from the database while binding, I should disable the filter option in the grid.
How can i achive the same through ASPX or Code behind using C#. Does Telerik Grid have any property to disable the filtering option when thre are no records.
View 1 Replies
May 12, 2010
I've introduced the (awesome) grid control and got it working fine on my dev environment.I deployed my site to my local dev server and got the following error:
[Code]....
View 4 Replies
Oct 25, 2010
What im trying to do is have an edit button that instead of opening the line for editing, it forwards you to a page where you can edit. Is this possible? I tried something with the client template, but the grid render is ignoring it completely.
View 1 Replies
Dec 27, 2010
I am using telerik grid in mvc2 application. I have to perform Watin UI test for my application. For that i need to select a row from the telerik grid. I was not able to select id for the telerik grid as the telerik grid doesn't have any id. can u please help me to select the particular row from the grid. I have 6 columns in the grid. Based on the value of a row in the column(should iterate though the column) i need to select the id of that row and hit on the select button of that row.
View 1 Replies
Dec 16, 2010
I have the following markup in a 'content' page. Without the Render call, nothing renders, and with the Render call, the grid renders as the first element in the whole page, not inside the 'content' section defined by my view:
@using Telerik.Web.Mvc.UI
@model Outdoor.Mvc.ViewModels.OutdoorSite.SiteList
@{
Html.Telerik().Grid(Model.ItemList).Name("Site Grid")
.Columns(columns =>
{
columns.Bound(o => o.SiteId);
columns.Bound(o => o.Name);
})
.Pageable()
.Sortable()
.Render();
}
View 1 Replies
Apr 20, 2010
Is it possible to add client side validation to the fields of the Telerik MVC Grid at runtime. I am having validation JSON strings stored in the DB which I need to use when inserting or updating content
View 1 Replies
Sep 21, 2010
I have a FormView and I have the following defined:
[Code]....
This gets called when I go into Insert mode just fine, but it also gets called when I click the INSERT button to insert my record. I am trying to use this function to set default values for those controls on the form.
How do I stop this from being fired twice, or is there another method of setting the defualt calues?
View 2 Replies
Aug 1, 2010
is it possible ro insert grid inside a panelbar i try this but i have some errorsi define a grid in the inctructuion .content()
View 1 Replies
Mar 8, 2011
I have a Telerik grid. For each row there is a details table. The row is of type NominationTypeClass and the rows in the details table is of type Nomination. So what this means for each nomination type there is a list of nominations. The grid's code:
<telerik:RadGrid
AllowPaging="true"
AllowSorting="true"
AutoGenerateColumns="false"
GridLines="None"
ID="rgMyNominations".......
I have an action column that has a link that says Withdrawn. When clicked I have a JavaScript confirm box with a Yes or No option. If yes, then the nomination status is updated to withdrawn. Then I want the grid to be refreshed to show the updated status. I used the grid's update command to to show the show the JavaScript's command box. It updates, but is it the correct way to do it?
protected void rgMyNominations_UpdateCommand(object source, GridCommandEventArgs e)
{
try
{
StatusManager.InsertStatus( /* required parameters */ );
// Refresh grid
rgMyNominations.DataSource = GetNominationTypes();
rgMyNominations.DataBind();.....
...it says that NominationDate is not a property of NominationTypeClass. This is wrong, I don't know why it is taking the type for the row to be the type of the details table? NominationDate is a property of Nomination. It seems like it is overriding the datasources.
View 1 Replies
Jan 14, 2011
My grid has 5 data columns and 1 command column (update/delete)the column separator between command column and last data column is missing, making everything shift when entering inline edit mode.
this is the grid's view code:
<%=
Html.Telerik().Grid<ActivityPOCO>()
.Name("ActivityGrid")
.DataKeys(dataKeys =>
{
dataKeys.Add(e => e.ActivityID);
}
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image))........
View 1 Replies
Dec 21, 2010
Problem: How to display more columns in a Telerik grid than are displayed in the rendered grid?
eg I'd like to only display on the screen the Surname, but on dump to csv would like firstname too.
I've tried visible = false, and display = false on the GridBoundColumns, but then they don't come out on the csv.
<telerik:RadGrid ID="grdAuctions" runat="server" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"
AllowPaging="False" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="odsAuctionSales"
GridLines="None" EnableEmbeddedSkins="False" OnItemDataBound="grdAuctionSales_ItemDataBound">
<ExportSettings HideStructureColumns="true" />
[Code]....
View 2 Replies
Jun 15, 2010
i m using Telerik grid to present memos received by user below is the code
[Code]....
where i m binding third column (Subject) my intention is to make an ActionLink where subject is the display text and i want a dynamic ID coming from <#=MemoID#>. memo id is working fine and gives me a link with dynamic Memo IDs. the problem is with the subject i.e ("<#=Subject#>") is rendered as it is on the screen without mapping to the actual subject of the memo. i have also tried ("<%#=Subject%>") but to no gain.
View 12 Replies
Jun 2, 2010
Actually I and doing my college Project and I have some Problem.I have 3 sections in my web page:1. The Search Part, which search a product by its name or Id.2. Result Part, which is a grid view showing Product ID,Product name ,its stock and Price.3. Billing Part, where The bill will be created which contains Sr.no. ,Product Id, Product name, Qty,Price,Total Price as attributes.Now I want that if any one search the product then result is shown in result part and then from the list of the products i click a product and add it in the bill list.But I am not able to understand here how to access a data from the grid view i.e. accessing Product Id,Product name, Price and add it to bill.
View 5 Replies
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
Dec 3, 2010
I am using telerik grid. I need to apply a filter for all the columns in my grid. Currenly I am customizing the filter option using the following code. By using the following code, I am removing the certain items for all the columns. But, for a date column what are the possible options for filtering in the grid and how to customize those filtering options?
Code Behind
protected void RGVTest_Init(object sender, EventArgs e)
{
GridFilterMenu menu = RGVTest.FilterMenu; [code]....
View 1 Replies
May 14, 2010
i am using visual studio 2005 i am adding a gridview control to a new webpagewhen i click the advance option after configuring the database ,its option are disabled.what may be the problem????
View 7 Replies
Jun 30, 2010
I'm getting some Xml back from a service. I would like it to be the datasource of a grid view on my aspx page. Here is a sample of the Xml
<?xml version="1.0" encoding="utf-16" ?>
<ArrayOfTripTollCompleteDC xmlns:xsi=[URL]"
xmlns:xsd=[URL]>
<TripTollCompleteDC>
<TripTollId>5</TripTollId>
<DMSLaneModeID xsi:nil="true" />
<HOVOnly>false</HOVOnly>
<CreateDateTime>2010-06-07T15:54:01.023</CreateDateTime>
<ConfigVTMSDelaySeconds>5</ConfigVTMSDelaySeconds>
</TripTollCompleteDC>
and here is my code that parses the xml and tries to bind the grid. What am I missing here?
var retVal = service.GetTripDetailsByTripID(tripId);
var xmlTrips = XDocument.Parse(retVal);
var tripTolls =
from t in xmlTrips.Elements("TripTollCompleteDC")
select new {
TripTollId = (int)t.Element("TripTollId")
, DMSLaneModeID = (int?)t.Element("DMSLaneModeID")
, HOVOnly = (bool)t.Element("HOVOnly")
, CreateDateTime = (DateTime)t.Element("CreateDateTime")
, ConfigVTMSDelaySeconds = (int)t.Element("ConfigVTMSDelaySeconds")
};
grdTripDetails.DataSource = tripTolls;
grdTripDetails.DataBind();
I realize these are anonymous types. Is that a problem? I have verified the service is returning the Xml as stated above. Can anyone out there point me in the right direction? Just for completeness, here is the grid markup <asp:GridView runat="server" ID="grdTripDetails" />
View 1 Replies
Apr 2, 2011
I am facing serious problem while trying to work in clientevents provided with asp.net mvc telerik grid.
Here's the two different scenarios:When I am putting the following script in a view or partial view it works fine;
<%= Html.Telerik().Grid()
.Name("Grid")
.DataKeys(keys => keys.Add(p => p.StaffId))
[code]...
View 1 Replies