Grid Is Not Getting Bound Properly In IE?

Nov 9, 2010

My grid is not binding properly in IE and I found the reason why it is not working. one of my column value in grid is showing video and database value is

<object id='video' width='462' height='407' type='application/x-shockwave-flash'
<param name='movie' value=''>
<param name='allowScriptAccess' value='always'>
<param name='allowFullScreen' value='true'>
<param name='wmode' value='transparent'>
<param name='flashvars' value='colourSet=blue&brandText=LSAT+Freedom&'>
<embed src=''></embed>

When I comment to this column while binding, my grid is working fine and showing all next records.
But I want this column.

How to bind <object ....> tag to grid so that a video can be displayed.

View 1 Replies

Similar Messages:

C# - How To Properly Filter Gridview Bound To Sqldatasource

Sep 21, 2010

I am trying to populate an (editable) gridview in ASP.NET with a table from SQL. I have a SQLDataSource set up for this. I also need to have this gridview be filterable based on parameters entered in textboxes. I have tried using ControlParameters for this and it works but the problem there is when all textboxes are empty I want it to display all results in the gridview. What it does is display nothing because no entries have parameters that equal "". Is there an easy way to do this that I am missing or is there a better way to go about it other than a SQLDataSource?

View 1 Replies

MVC :: JSON Object - Grid Is Not Filling Properly

Feb 25, 2011

I've created a simple (or what I thought was simple!) search form using Razor, MVC3 and the webgrid from the web helpers. I enabled paging, used a great article I found here to get that working... or so I thought. Basically what happens is that when I click the page buttons at the bottom of the grid it does something that I didn't expect, and creates a JSON object, then the browser prompts me to try and save it, and not as I expected to refill the grid. I can't see what I'm doing wrong, and before I break my monitor by throwing it onto the railway line!


My jQuery code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcApplication1.Models;
using System.Configuration;
using System.Web.Helpers;
namespace MvcApplication1.Controllers
public class SearchController : Controller
// GET: /Search/
Entities t = new Entities(ConfigurationManager.ConnectionStrings["Entities"].ConnectionString);
public ActionResult Details(int id)
Tender_Question q = (from x in t.Tender_Questions where x.Unique_ID_number == id select x).SingleOrDefault();
Customer c = (from cu in t.Customers where cu.CustomersID == q.Company select cu).SingleOrDefault();
ViewBag.Customers = c.CompanyName;
Panel_type pan = (from pa in t.Panel_types where pa.ID == q.Panel_type select pa).SingleOrDefault();
ViewBag.Panel = pan.Panel_type1;
return View(q);
public ActionResult Edit(int id)
Tender_Question q = (from x in t.Tender_Questions where x.Unique_ID_number == id select x).SingleOrDefault();
List<Customer> c = (from cu in t.Customers select cu).ToList();
ViewBag.Customers = c;
return View(q);
public ActionResult Edit(Tender_Question model)
if (ModelState.IsValid)
Tender_Question q = (from x in t.Tender_Questions where x.Unique_ID_number == model.Unique_ID_number select x).SingleOrDefault();
q.Answer = model.Answer;
q.Company = model.Company;
q.Customer = model.Customer;
q.Date = model.Date;
q.Page_Question_Ref = model.Page_Question_Ref;
q.Panel_type = model.Panel_type;
q.Question = model.Question;
q.Type_of_tender = model.Type_of_tender;
//add update code
return RedirectToAction("Index");
return View(model);
public ActionResult Search(int? page)
if (page.HasValue)
return RedirectToAction("EfficientPaging", new { page = page });
return View();
public ActionResult Search(int? page, FormCollection collection)
IEnumerable<Tender_Question> q = getSearch(collection);
TempData.Add("Results", q);
return View(q);
private IEnumerable<Tender_Question> getSearch(FormCollection collection)
string question;
string answer;
IEnumerable<Tender_Question> q = t.Tender_Questions;
question = collection["Question"];
answer = collection["Answer"];
if (!string.IsNullOrEmpty(question))
if (question.EndsWith(","))
question = question.Substring(0, question.Length - 1);
} if (question.Length > 0)
if (question.Contains(","))
string[] questioned = question.Split(',');
foreach (string s in questioned)
q = q.Where(m => m.Question.Contains(s));
q = q.Where(m => m.Question.Contains(question));
if (!string.IsNullOrEmpty(answer))
if (answer.EndsWith(","))
answer = answer.Substring(0, answer.Length - 1);
if (answer.Length > 0)
if (answer.Contains(","))
string[] answered = answer.Split(',');
foreach (string s in answered)
q = q.Where(m => m.Answer.Contains(s));
q = q.Where(m => m.Answer.Contains(answer));
return q;
public ActionResult EfficientPaging(int? page)
IEnumerable<Tender_Question> q = (IEnumerable<Tender_Question>)TempData["Results"];
int skip = page.HasValue ? page.Value - 1 : 0;
q = q.OrderBy(o => o.Unique_ID_number).Skip(skip * 10).Take(10).ToList();
var grid = new WebGrid(q);
var column = new WebGridColumn();
column.CanSort = false;
column.ColumnName = "Unique_ID_number";
column.Header = "Edit";
column.Format = (item) =>
return new HtmlString("<a href="/Home/Edit/" + column.ColumnName + "">Edit</a> ");
var detcolumn = new WebGridColumn();
detcolumn.CanSort = false;
detcolumn.ColumnName = "Unique_ID_number";
detcolumn.Header = "Details";
detcolumn.Format = (item) =>
return new HtmlString("<a href="/Home/Details/" + column.ColumnName + "">Details</a> ");
var htmlString = grid.GetHtml(htmlAttributes: new { id = "DataTable" }, columns: grid.Columns(
column, detcolumn,
grid.Column(columnName: "Type_of_tender", header: "Type of Tender"),
grid.Column(columnName: "Panel_type", header: "Panel type"),
grid.Column(columnName: "Page_Question_Ref", header: "Page Question Ref"),
return Json(new
Data = htmlString.ToHtmlString(),
Count =q.Count() / 10
}, JsonRequestBehavior.AllowGet);

View 4 Replies

Web Forms :: Hyperlink Column In Grid Is Not Formatting Properly?

Apr 12, 2010

In gridview I am adding row as mentioned below

string hyPerLinkUri = DispForm.aspx?ID=" + result["ID"].ToString()
row["Schedule ID"] = hyPerLinkUri;

Then I added hyperlinkfield column grid


It is showing hyperlink column link in grid properly, but as column text it is showing full hyperlink url rather then only value of ID, can anyone tell whats wrong I am doing here. Secondly, I also want that if someone click on hyperlink text, it should open in new window.

View 2 Replies

Forms Data Controls :: Add Bound Fields At Run Time In Grid View

Jun 3, 2010

my problem is that i have a gridview that fetch the data from database .I added the linkbutton on gridview that redirect to next page but cant working becouse at run time i add a bound field on gridview to calculate the time. source code

<asp:GridView ID="GridView3" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4" Width="928px" Height="321px" OnPageIndexChanging="GridView3_PageIndexChanging" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" style="z-index: 102; left: 24px; position: absolute;
top: 248px" >
<asp:TemplateField HeaderText="Select">
<%--<asp:RadioButton ID="RadioButton1" onclick="javascript:CheckOtherIsCheckedByGVIDs(this);" runat="server" AutoPostBack="true" OnCheckedChanged="RadioButton1_CheckedChanged" />--%>
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Select"
OnClick="LinkButton3_Click" Text="Update"></asp:LinkButton>
<asp:BoundField DataField="id" HeaderText="Ticket Id" SortExpression="id" />
<asp:BoundField DataField="fname" HeaderText="Name" SortExpression="fname" />
<asp:BoundField DataField="phone" HeaderText="Phone No." SortExpression="phone" />
<asp:BoundField DataField="comname" HeaderText="Company Name" SortExpression="comname" />
<asp:BoundField DataField="sub" HeaderText="Subject" SortExpression="sub" />
<asp:BoundField DataField="mess" HeaderText="Message" SortExpression="mess" />
<asp:BoundField DataField="email" HeaderText="Email" SortExpression="email" />
<asp:BoundField DataField="status" HeaderText="Status" SortExpression="status" />
<asp:BoundField DataField="Dept" HeaderText="Dept" SortExpression="Dept" />
<asp:BoundField DataField="Prior" HeaderText="Priority" SortExpression="Priority" />
<asp:BoundField DataField="time" HeaderText="Time" SortExpression="Time" />
<-- <asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age" />--%>
<asp:TemplateField HeaderText="Detail">
<a href=# " onclick="return jsPop('Detail.aspx?id=<%#DataBinder.Eval (Container.DataItem,"id")%>', 'win01', 800, 500);">
view detail</a>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />

View 2 Replies

C# - Grid Data Bound To Stored Procedure Getting Called Multiple Times?

Mar 8, 2011

I have an application that uses an aps:GridView. The GridView is populated using a DataSource that calls a Stored Procedure. The DataSource passes parameters to the Stored Procedure based on some text fields. The page has been running slower than wanted, so I was doing some checking.

I ran SQL Profiler while loading the page, and saw the Stored Procedure was being called twice. I stepped through the code and found out that in the Page Load Complete event was where this was happening. In this event, I set the value of a parameter for the Stored Procedure, then did a DataBind on the GridView to pick up the data. As I was stepping through the code, I watched the SQL Profiler. When I got to the step of setting the parameter, the Stored Procedure had not yet been called. When I stepped through that and got to the DataBind command (before running that step), the SQL Profiler showed that the Stored Procedure had been called. Then I did the DataBind and the StoredProcedure was called again.

My question is, how do I get the parameters set, and get the GridView data bound, and only call the StoredProcedure once? If I comment out the DataBind step, the StoredProcedure never does get called (which seems really strange to me...).

View 1 Replies

Forms Data Controls :: How To Take Value Of Bound Field Of Grid In A Variable Or In A Textbox

Aug 21, 2010

How to take value of bound field of grid in a variable or in a textbox.

I m using this code in .aspx page for grid.


Now how to take value of cell of grid in textbox or in any varaible on cell click.remember if I take the field as BoundField on aspx.

View 4 Replies

Forms Data Controls :: Gridview Sorting Unbound Column In Bound Grid

May 14, 2010

I have a gridview control bound to a sqldatasource in c#. In the rowdatabound event I look at a value in a cell and use a function to evaluate the value and depending on that value I populate an added unbound column in my bound datagrid to show an excalmation point. I now want to sort by the column with the excalmation point.

View 2 Replies

Forms Data Controls :: Nested Grid Dynamically Fill When Parent Grid Button Click Then Expand Child Grid

Jan 16, 2011

i have one grid and one button when i click on that button then it expand and showing another grid under the row of parent grid how to do that.

View 2 Replies

C# - Using YUI Grid - Dataset Contains Some Special Character - Bind Dataset Into Grid But Its Not Displayed In Grid?

May 19, 2010

Problem in YUI:I am using YUI grid,my dataset contains some special character.i bind my dataset into the grid,but its not displayed in my grid? how to solve this

View 1 Replies

Forms Data Controls :: Force Grid View To Select Next Row On A Button_click Which Is Outside The Grid?

Jun 23, 2010

Have a GridView with a templated select button hidden and using

e.Row.Attributes.Add("onclick",Page.ClientScript.GetPostBackEventReference(this.grdMaster, "Select$" + e.Row.RowIndex.ToString())); to select a row .

When user like to update the datasource he will select one row from gridview then in selected indexchanged event i would display the selected row values beneath the form under the grid , Then user will update the contents displayed from grid and click an update button which is outside the grid . After updating the displayed row , i got to get the values of the next row in the grid and display them for next updation , i'e if users maually selects row 3 from grid then he can update the values using the update button and then on update click itself i'll have to display next row contents of row 4 and this process could go on .

View 3 Replies

Forms Data Controls :: How To Read Parent Grid Values In Child Grid

Mar 12, 2010

I have Parent/Child Grid (also called Nested Grids).

Parent Grid (PG) :: PG has two template fields. 1st template field has "Category ID" and 2nd template has Child Grid

Child Grid (CG) :: CG is populated in PG's RowDataBund event based on "Category ID". In CG's DataBound event, I am doing something which I need to display in CG's footer row.

Problem :: In the footer row of each CG, I have to show the "Category ID" which is in PG' row. How can I get hold of the PG's row which hascurrent nested grid (there will 'n' child grids, one for each 'Category ID' in the PG ) so I can read the "Category ID"

I was thinking if I could do something (DataBound event of CG) like this..

string catId = ChildGrid.Parent[get the index of the current row in PG].Cells[0].Text;

View 2 Replies

How To Remove Grid Lines From Grid View Suing Style Sheet

Mar 31, 2010

how to remove grid lines from Grid View suing style sheet...

View 1 Replies

Alert On Moving To A Different Page Of A Grid When User Changes Contents Of Textboxes In A Grid

Mar 24, 2010

In a ASP.NET application I have a paging RadGrid which shows up textbox in each row. Outside the grid, there is an OK button to save the content of all the textbox. If user changes text in any one or more of the textbox and without clicking on the "OK" button, tries to move to a different page number (of the grid by clicking on the page number), he should be prompted for confirmation of save or cancel the changes.

I am guessing that one can write a Javascript function which would look for any form input control (textbox in my case) and detect changes and If there are changes, would prompt the user. However, I am not sure where I can call this function from?

I am using RadGrid but I guess this should be applicable to GridView as well.

View 1 Replies

Linq To Xml Datasource For Grid View Is Not Working - The Grid Show No Rows

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]"
<DMSLaneModeID xsi:nil="true" />

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;

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

Forms Data Controls :: Trying To Add Subtotal In Gridfooter With Has Grid Inside Grid?

Jun 1, 2010

i am trying to add subtotal in gridfooter with has grid inside grid

View 1 Replies

Forms Data Controls :: Show Grid With All Orders And In Grid One Column With Last State Of Order?

Feb 2, 2011

I have an entity "Order", which contains a set of states. Every state has date and name.

I want show grid with all orders and in grid one column with last state of order. But I dont understand how to do it.

View 1 Replies

Forms Data Controls :: Create A Second Grid In The Same Page With Detailed Info For A Given Record Of The First Grid

Jul 6, 2010

I am trying to create a second grid in the same page with detailed info for a given record of the first Grid, but when I press select in the first grid nothing happens. I follwed everything I read.

<asp:GridView runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" style="margin-right: 0px" Width="659px"
AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
AllowSorting="True" DataKeyNames="accession_num,organ"
EnablePersistedSelection="True" EnableSortingAndPagingCallbacks="True" onselectedindexchanged="Unnamed1_SelectedIndexChanged"
<asp:BoundField DataField="organ" HeaderText="organ"
SortExpression="organ" />
<asp:BoundField DataField="weight" HeaderText="weight"
SortExpression="weight" />
<asp:BoundField DataField="unit" HeaderText="unit" SortExpression="unit" />
<asp:BoundField DataField="accession_num" HeaderText="accession_num"
ReadOnly="True" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%&#36; ConnectionStrings:pdmstestConnectionString %>"
SelectCommand="GetGrossOrgan" SelectCommandType="StoredProcedure"
UpdateCommand="UpdateGrossOrgan" UpdateCommandType="StoredProcedure"
DeleteCommand="DELETE FROM [Pathology_Gross_Organ] WHERE [accession_num] = @accession_num AND [organ] = @original_organ"
> <SelectParameters>
<asp:ControlParameter ControlID="accession_num" Name="accession_num"
PropertyName="Text" Type="String"/>
<asp:Parameter Name="accession_num" Type="String" />
<asp:Parameter Name="original_organ" Type="String"/>
<asp:Parameter Name="accession_num" Type="String"/>
<asp:Parameter Name="organ" Type="String"/>
<asp:Parameter Name="weight" Type="Int16" />
<asp:Parameter Name="unit" Type="String"/>

View 8 Replies

Forms Data Controls :: How To Edit Grid View (draged The Grid To The Aspx Page)

Sep 29, 2010

I have a grid view that does add, edit update and delete. ( I draged the grid to the aspx page ) it is working. I would like to have the following : once I lick on edit, I open a form inside the grid view to edit the fields. How can I do that.

View 4 Replies

Forms Data Controls :: Nest A Grid Inside Of Another Grid?

Jan 20, 2010

I'm using ASP.NET/VB and am wanting to nest a grid inside of another grid. I've seen them but am unsure how to make them work. I have a Orders table with an OrderID and it is linked to a Orders_Detail table. I would like to be able to select the order and see the details. I've done it differently with 2 grids outside of each other, but this isn't the solution I need.

View 1 Replies

VS 2008 - How To Make The Checkbox Outside The Grid Independent From The Ones In The Grid

Mar 2, 2010

I have a Select All checkbox in my grid that calls this fine. Outside of my grid I'd like to use another checkbox for something else, but when the select all checkbox in the grid is selected, it also selects my checkbox outside of the grid. Is there way to make the checkbox outside of the grid independent from the ones in the grid?


View 4 Replies

Finding Working Code For Pdf And Excel For Grid With In A Grid

Feb 18, 2011

i have a gridview in which there is another gridview now i want the data in the primary as well as the nested gridview in pdf and excel format. i have tried all sort of things how ever none is working can anyone send me the working code for pdf and excel for grid with in a grid.

View 3 Replies

Data Controls :: Any Chance To Add More Than One Grid Row In Single Grid Row

Apr 30, 2014

Is there any chance to add more than one grid row in single grid row like this.

<h1> Question</h1>
<table width="100%">
<tr style="background-color:Gray; color:White;">


View 1 Replies

C# - How To Bind Grid / Grid Appear Empty When Run Program

Feb 18, 2011

I cant bind my Grid. I dont know what I am doing wrong, the grid appears empty when I run the program.

here is my code ::

protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)

View 2 Replies

Forms Data Controls :: Have A Grid View With Some Coulmns Like Name,Phone No Etc With Edit,Delete Column In Grid View?

May 27, 2010

i have a grid view with some coulmns like Name,Phone no etc with Edit,Delete column in grid view. I click a row in grid view to Edit,it goes another page where i can edit all fields .Once i update i redirect the page to gridview. I want the grid view to remain in that particular page say 4 of the grid view

View 5 Replies

Copyrights 2005-15, All rights reserved