Search Results

Search found 1260 results on 51 pages for 'gridview'.

Page 15/51 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • how to bind the converted value from a datatable to my gridview.

    - by Ranjana
    how to bind the value to gridview i have a datatable DataTable dtBindGrid = new DataTable(); dtBindGrid = serviceobj.SelectExamTimeTable(txtSchoolName.Text, txtBranchName.Text, txtClass.Text, txtExamName.Text); foreach (DataRow row in dtBindGrid.Rows) { strgetday= row["Day"].ToString(); strgetdate = row["Date"].ToString(); DatedTime = Convert.ToDateTime(row["Time"].ToString()); strgettime = DatedTime.ToString("t"); strgetsubject = row["Subject"].ToString(); strgetduration = row["Duration"].ToString(); strgetsession = row["Session"].ToString(); strgetminmark = row["MinMarks"].ToString(); strgetmaxmark = row["MaxMarks"].ToString(); // dtBindGrid.Rows.Add(row); } GrdExamTimeTable.DataSource = dtBindGrid.DefaultView; GrdExamTimeTable.DataBind(); this datatable will return me some values like day,date,time,duration,subject,.. here im getting each value in string bec to convert the Time as 9.00am or 9.00pm DatedTime = Convert.ToDateTime(row["Time"].ToString()); strgettime = DatedTime.ToString("t"); .... how to bind this converted value to my gridview.

    Read the article

  • How to Bind Data and manipulate it in a GridView with MVP

    - by DotNetDan
    I am new to the whole MVP thing and slowly getting my head around it all. The a problem I am having is how to stay consistent with the MVP methodology when populating GridViews (and ddls, but we will tackle that later). Is it okay to have it connected straight to an ObjectDataSourceID? To me this seems wrong because it bypasses all the separation of concerns MVP was made to do. So, with that said, how do I do it? How do I handle sorting (do I send over handler events to the presentation layer, if so how does that look in code)? Right now I have a GridView that has no sorting. Code below. ListCustomers.aspx.cs: public partial class ListCustomers : System.Web.UI.Page, IlistCustomer { protected void Page_Load(object sender, EventArgs e) { //On every page load, create a new presenter object with //constructor recieving the // page's IlistCustomer view ListUserPresenter ListUser_P = new ListUserPresenter(this); //Call the presenter's PopulateList to bind data to gridview ListUser_P.PopulateList(); } GridView IlistCustomer.UserGridView { get { return gvUsers; } set { gvUsers = value; } } } Interface ( IlistCustomer.cs): is this bad sending in an entire Gridview control? public interface IlistCustomer { GridView UserGridView { set; get; } } The Presenter (ListUserPresenter.cs): public class ListUserPresenter { private IlistCustomer view_listCustomer; private GridView gvListCustomers; private DataTable objDT; public ListUserPresenter( IlistCustomer view) { //Handle an error if an Ilistcustomer was not sent in) if (view == null) throw new ArgumentNullException("ListCustomer View cannot be blank"); //Set local IlistCustomer interface view this.view_listCustomer = view; } public void PopulateList() { //Fill local Gridview with local IlistCustomer gvListCustomers = view_listCustomer.UserGridView; // Instantiate a new CustomerBusiness object to contact database CustomerBusiness CustomerBiz = new CustomerBusiness(); //Call CustomerBusiness's GetListCustomers to fill DataTable object objDT = CustomerBiz.GetListCustomers(); //Bind DataTable to gridview; gvListCustomers.DataSource = objDT; gvListCustomers.DataBind(); } }

    Read the article

  • What are my best ASP.Net GridView replacement options?

    - by Homer
    We currently use a GridView to display 1000+ rows of data. Minimum requirement for replacement is a fixed header row, fixed footer and columns would be a plus. This would have to work across IE 6 and greater. I've heard good things about Infragistics, but the demo on their page is slow. So what are my best options? jQuery? YUI? other 3rd party?

    Read the article

  • How to bind an List<List<String>> to the gridview ?

    - by user301089
    Hi everyone, I'm using the new Telerik Rad Control and I would to use the GridView included. But my problem is I recover with a webservice a List<List<String>> object and I would like to show it into my Datagridview. I try to make a Grid.ItemSource = e.result but nothing appears ;-( What's the problem ? Thanks a lot. Narglix

    Read the article

  • How do I force the download of a file which link is inside a GridView?

    - by murderdoll
    I have a Gridview that shows a list of files previously uploaded to the server with a HyperLink control to be able to download it, I need to force a download every time the user clicks on one of the provided links, so that the file does not open directly on the browser (they are usually images). Currently I have a side-server function that forces a download, but I do not know how to assign this function to each one of the links when the user clicks on it.

    Read the article

  • Gridview inside UpdatePanel refresh

    - by Attilah
    I use a GridView to represent data from a table in my DB. the GridView has some template fields whose content are determined before displaying the Grid ( I use the RowDataBound event to determine content of template fields before displaying the GridView). The page displays a list of records from the table records and then, the recording process starts. after the process is over, the template fields should be updated. how do I automatically refresh the GridView after the process is finished ? it should be noted that the GridView is contained within an control and that I continuously poll the server using a Timer control that executes "GridView1.DataBind()" at the server level every 60 seconds. since the GridView is inside an UpdatePanel, calling DataBind() method on it doesn't seem to call the RowDataBound event. How can I solve this ?

    Read the article

  • how to rename the boundfield of a gridview in asp.net?

    - by Akshay
    protected void Button1_Click(object sender, EventArgs e) { System.Collections.ArrayList list = new System.Collections.ArrayList(); list.Add("abc"); list.Add("xyz"); list.Add("pqr"); list.Add("efg"); GridView1.DataSource = list; GridView1.DataBind(); } Now when data is bound to the gridview the column name is by default "Items" but I want to change the header text of this column. How to do this..?

    Read the article

  • How to bind a complex dictionary to a Gridview in asp.net?

    - by Mehdi
    I've used an early binding of a dictionary<string, string> to a gridview to show Urls Text and its HRef as key-value and it works like a charm. But since I want to replace the dictionary with this one : dictionary<string, LinkInfo> the binding goes wrong! Should I handle some events like as onItemDataBound or something? and the LinkInfo structure is: public struct LinkInfo{ public string href; public bool Enabled; }

    Read the article

  • Does Microsoft hate firefox? ASP.Net gridview performance in firefox bug?

    - by Maxim Gershkovich
    Could someone please explain the significant difference in speed between a firefox updatepanel async postback and one performed in IE? Average Firefox Postback Time For 500 objects: 1.183 Second Average IE Postback Time For 500 objects: 0.295 Seconds Using firebug I can see that the majority of this time in FireFox is spent on the server side. A total of 1.04 seconds. Given this fact the only thing I can assume is causing this problem is the way that ASP.Net renders its controls between the two browsers. Has anyone run into this problem before? VB.Net Code Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click GridView1.DataBind() End Sub Public Function GetStockList() As StockList Dim res As New StockList For l = 0 To 500 Dim x As New Stock With {.Description = "test", .ID = Guid.NewGuid} res.Add(x) Next Return res End Function Public Class Stock Private m_ID As Guid Private m_Description As String Public Sub New() End Sub Public Property ID() As Guid Get Return Me.m_ID End Get Set(ByVal value As Guid) Me.m_ID = value End Set End Property Public Property Description() As String Get Return Me.m_Description End Get Set(ByVal value As String) Me.m_Description = value End Set End Property End Class Public Class StockList Inherits List(Of Stock) End Class Markup <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <script type="text/javascript" language="Javascript"> function timestamp_class(this_current_time, this_start_time, this_end_time, this_time_difference) { this.this_current_time = this_current_time; this.this_start_time = this_start_time; this.this_end_time = this_end_time; this.this_time_difference = this_time_difference; this.GetCurrentTime = GetCurrentTime; this.StartTiming = StartTiming; this.EndTiming = EndTiming; } //Get current time from date timestamp function GetCurrentTime() { var my_current_timestamp; my_current_timestamp = new Date(); //stamp current date & time return my_current_timestamp.getTime(); } //Stamp current time as start time and reset display textbox function StartTiming() { this.this_start_time = GetCurrentTime(); //stamp current time } //Stamp current time as stop time, compute elapsed time difference and display in textbox function EndTiming() { this.this_end_time = GetCurrentTime(); //stamp current time this.this_time_difference = (this.this_end_time - this.this_start_time) / 1000; //compute elapsed time return this.this_time_difference; } //--> </script> <script type="text/javascript" language="javascript"> var time_object = new timestamp_class(0, 0, 0, 0); //create new time object and initialize it Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function BeginRequestHandler(sender, args) { var elem = args.get_postBackElement(); ActivateAlertDiv('visible', 'divAsyncRequestTimer', elem.value + ''); time_object.StartTiming(); } function EndRequestHandler(sender, args) { ActivateAlertDiv('visible', 'divAsyncRequestTimer', '(' + time_object.EndTiming() + ' Seconds)'); } function ActivateAlertDiv(visstring, elem, msg) { var adiv = $get(elem); adiv.style.visibility = visstring; adiv.innerHTML = msg; } </script> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="click" /> </Triggers> <ContentTemplate> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> </asp:UpdateProgress> <asp:Button ID="Button1" runat="server" Text="Button" /> <div id="divAsyncRequestTimer" style="font-size:small;"> </div> <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> </Columns> </asp:GridView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetStockList" TypeName="WebApplication1._Default"> </asp:ObjectDataSource> </ContentTemplate> </asp:UpdatePanel> </form>

    Read the article

  • How to: Display multiple related classes in an ASP.NET GridView ?

    - by kversch
    I would like to display students and their grades with a GridView and LinqToSQL like this: assignment1 assignment2 Student 1 55 89 Student 2 87 56 Student 3 92 34 I found this topic but it doesn't answer my question: http://forums.asp.net/t/1557987.aspx I have a many-to-many relationship between students and assignments called "grades". The grade for the assignment is stored in that table in a "gradeNumber" column. I would also like to specify which assignments should be displayed in the grid. Btw, my LINQ entities are extended to allow me to write/get studentx.Assignments or assignmentx.Students.

    Read the article

  • Show data relationship in gridview with dropdownlist or similar?

    - by Anders Svensson
    I have data coming from two tables with a foreign key relationship - one User table containing users of the web application, and one Page table containing details about pages visited by each user. I would like to be able to view these data in a gridview or the like on a page. It's easy enough to just show the User table data like so (I'm using the Entity Framework and LINQ): UserDBEntities context = new UserDBEntities(); GridView1.DataSource = from user in context.UserSet select new { user.Ip, user.Count, user.Description, user.Referer }; GridView1.DataBind(); But how can I show the Page details? I'm not bent on any particular way of showing it, but the only idea I've been able to come up with is to have a dropdown list for each user in a column. But I can't figure out how to get the page data into such a dropdown list. The tables are associated with the primary/foreign key UserID. Any ideas would be welcome (dropdownlist solution or other)!

    Read the article

  • Usar un Datatable como fuente de datos para un GridView

    - by Jason Ulloa
    Es común ver en los foros, preguntas sobre como llenar un datatable para luego, ponerlo como fuente de un GridView. En nuestro próximo ejemplo, mostraremos lo sencillo que puede ser y la poca cantidad de código que es requerida: using (SqlConnection c = new SqlConnection("conectionstring")) { c.Open(); // Crear un nuevo DataAdapter using (SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM table", c)) { // Usar un DataAdapter para llenar el DataTable DataTable t = new DataTable(); a.Fill(t);   gridView1.DataSource = t; gridView1.DataBind();   } }

    Read the article

  • ASP.NET 4.0 and the Entity Framework 4 - Part 5 - Using the GridView and the EntityDataSource

    In this article, Vince demonstrates the usage of the GridView control to view, add, update, and delete records using the Entity Framework 4. After providing a short introduction, he provides the steps required to create a web site, entity data model, web form and template fields with the help of relevant source code and screenshots.Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Scrollable GridView

    Cross browser support for a scrollable GridView....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Conditional Gridview Text - Checkboxes

    This code sample shows how to either show or make invisible, a checkbox in each row of the Gridview, along with making text conditional, based on certain criteria. In this case, if the Postal code starts with a non-numeric character, we change it to "Alt Text", and we set the Visible property of the checkbox in that row to "False"

    Read the article

  • ASP.NET 4.0 and the Entity Framework 4 - Part 5 - Using the GridView and the EntityDataSource

    In this article, Vince demonstrates the usage of the GridView control to view, add, update, and delete records using the Entity Framework 4. After providing a short introduction, he provides the steps required to create a web site, entity data model, web form and template fields with the help of relevant source code and screenshots.Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Gridview Header Filter

    To help you filter gridview using it's header...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >