Search Results

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

Page 9/51 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Deleting Row Method on GridView

    - by George
    I am trying to implement the deleting method and pass my parameters for the delete operation. I am using sqldatasource. Since the ID doesnt have a column in my gridview how can I get the value of the ID and set it as my delete parameter?

    Read the article

  • gridview, order number + 1/- 1

    - by MyHeadHurts
    So I am working on a gridview that uses the order number to order the table. However, my users are able to ad a row. What i want is something similar to pages that have the arrows next to each row and the user can click up if they want that row to go up. I also want it to change the actual number in the row column. for the one being moved and for the other one being affected. I hope i am being clear enough

    Read the article

  • Checking All Checkboxes in a GridView Using jQuery

    In May 2006 I wrote two articles that showed how to add a column of checkboxes to a GridView and offer the ability for users to check (or uncheck) all checkboxes in the column with a single click of the mouse. The first article, Checking All CheckBoxes in a GridView, showed how to add "Check All" and "Uncheck All" buttons to the page above the GridView that, when clicked, checked or unchecked all of the checkboxes. The second article, Checking All CheckBoxes in a GridView Using Client-Side Script and a Check All CheckBox, detailed how to add a checkbox to the checkbox column in the grid's header row that would check or uncheck all checkboxes in the column. Both articles showed how to implement such functionality on the client-side, thereby removing the need for a postback. The JavaScript presented in these two previous articles still works, but the techniques used are a bit antiquated and hamfisted given the advances made in JavaScript programming over the past few years. For instance, the script presented in the previous articles uses server-side code in the GridView's DataBound event handler to assign a client-side onclick event handler to each checkbox. While this works, it violates the tenets of unobtrusive JavaScript, which is a design guideline for JavaScript programming that encourages a clean separation of functionality from presentation. (Ideally, event handlers for HTML elements are defined in script.) Also, the quantity of JavaScript used in the two previous articles is quite hefty compared to the amount of code that would be needed using modern JavaScript libraries like jQuery. This article presents updated JavaScript for checking (and unchecking) all checkboxes within a GridView. The two examples from the previous articles - checking/unchecking all checkboxes using a button and checking/unchecking all checkboxes using a checkbox in the header row - are reimplemented here using jQuery and unobtrusive JavaScript techniques. Read on to learn more! Read More >

    Read the article

  • WPF Combobox in Gridview's column

    - by plotnick
    I got a combobox in the grid's column: <ListView> <ListView.View> <GridView> <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <ComboBox /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> Now, in the SelectionChanged() of ComboBox I'm trying to change some value in an other column but the same row. And I can't find how to get the current row. none of the following doesn't work ListView.Items.CurrentPosition ListView.Items.CurrentItem please guys help me

    Read the article

  • c# gridview row click

    - by Martijn
    When i click on a row in my gridview, i want to go to a other page with the id i get from the database. In my RowCreated event i have the following line: e.Row.Attributes.Add("onClick", ClientScript.GetPostBackClientHyperlink(this.grdSearchResults, "Select$" + e.Row.RowIndex)); To prevent error messages i have this code: protected override void Render(HtmlTextWriter writer) { // .NET will refuse to accept "unknown" postbacks for security reasons. Because of this we have to register all possible callbacks // This must be done in Render, hence the override for (int i = 0; i < grdSearchResults.Rows.Count; i++) { Page.ClientScript.RegisterForEventValidation(new System.Web.UI.PostBackOptions(grdSearchResults, "Select$" + i.ToString())); } // Do the standard rendering stuff base.Render(writer); } My question is, how can i give a row a unique id (from the DB) and when i click the row, another page is opened (like clicking on a href) and that page can read the id. Thnx

    Read the article

  • How to Pass parameter to SQlDataSource from gridview?

    - by user144842
    Gridview has many columns and a Delete button as well. Delete button is a control as TemplateField <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID="btnDelete" CommandName="Delete" Text='<%# Eval("disabled").ToString()=="False" ? "Disabled" : "Enabled" %>' OnClientClick="return confirm('Are you sure you want to take this action?');" runat="server"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> Now associated SQLDataSource's Delete command's stored procedure is expecting two parameters. One is going from DataKeyNames (RowID), other one i wanna pass is the Text of btnDelete (True or False). How can i achieve it?

    Read the article

  • How to arrange the items of gridview ?

    - by kranthi
    I have a settings page in my asp.net website,in which a user can select desired items and their order to be displayed in another page.I am displaying these items(which are obtained from database) in a gridview with checkboxes,up/down arrows next to them.Once the user makes his selection/rearranges the items and clicks on the 'Save' button,I am saving the data into another database table.When this particular user logsin again I want to check the items which were already chosen by him and arrange them in the order he specified, on page load.I am able to check the checkboxes of the already chosen items but do not understand how do I arrange the items in the user specified order? Please help. Thanks.

    Read the article

  • Why doesnt the AsyncCallback update my gridview?

    - by Naruji
    Hi all, I started working with delegates last week and i am trying to update my gridview async on the background. All goes well, no errors or such but i dont get a result after my EndInvoke. does anyone know what i am doing wrong? Here is a code snippet: public delegate string WebServiceDelegate(DataKey key); protected void btnCheckAll_Click(object sender, EventArgs e) { foreach (DataKey key in gvTest.DataKeys) { WebServiceDelegate wsDelegate = new WebServiceDelegate(GetWebserviceStatus); wsDelegate.BeginInvoke(key, new AsyncCallback(UpdateWebserviceStatus), wsDelegate); } } public string GetWebserviceStatus(DataKey key) { return String.Format("Updated {0}", key.Value); } public void UpdateWebserviceStatus(IAsyncResult result) { WebServiceDelegate wsDelegate = (WebServiceDelegate)result.AsyncState; Label lblUpdate = (Label)gvTest.Rows[Convert.ToInt32(key.Value)].FindControl("lblUpdate"); lblUpdate.Text = wsDelegate.EndInvoke(result); }

    Read the article

  • Need help in gridview displaying data

    - by sumit
    Hi all, I want to display all the data in gridview which i am inserting in runtime. For that i have written code but getting this error. "Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition." protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindData(); } } public void BindData() { string str = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString(); SqlConnection con = new SqlConnection(str); SqlDataAdapter da = new SqlDataAdapter("select * from Items where ItemId='" + TxtItemId.Text + "'", con); DataSet ds = new DataSet(); da.Fill(ds,"Items"); GridView1.DataSource = ds; GridView1.DataBind(); } Pls modify my code where is my mistake. Thanks, Sumit

    Read the article

  • Button in gridview

    - by Rajeev
    I'm using a button in a template field of gridview. On button click I want to redirect to another page but it throws an exception: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" % in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. What can I do to resolve this problem?

    Read the article

  • C# Gridview - Checking if a column already exists when adding a new column fails

    - by Nir
    I have a GridView with 10 columns. On a certain condition, I want to add a new column called "Expiration Date". The problem is that when the user presses "Search" again (Postback) the column is added again. I check before adding the column, to see if it already exists: BoundField dtExp = new BoundField {DataField = "DateTimeExpired", HeaderText = "Expiration Date", DataFormatString = "{0:d}"}; if (!grid.Columns.Contains(dtExp)){grid.Columns.Add(dtExp);} But the problem is that even if the column already exists, "Contains" returns false. What am I doing wrong? Thanks!

    Read the article

  • Event handler of Dropdownlist inside Gridview

    - by hotcoder
    I've added Dropdownlist in Gridview at RowDataBound event. The code is: if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddlSeason = new DropDownList(); ddlSeason.DataSourceID = "odsRoomSeason"; ddlSeason.DataTextField = "SeasonTittle"; ddlSeason.DataValueField = "SeasonID"; ddlSeason.AutoPostBack = true; ddlSeason.SelectedIndexChanged += new EventHandler(ddlSeason_SelectedIndexChanged); TableCell tcSeason= new TableCell(); tcSeason.Controls.Add(ddlSeason); e.Row.Cells.AddAt(e.Row.Cells.Count, tcSeason); } The event handler I've added is: protected void ddlSeason_SelectedIndexChanged(object sender, EventArgs e) { // } But the problem is that the event handler function doesn't catch the event. Please tell me how to write the correct event handler, also I need to get the row from which the Dropdownlist's event has fired.

    Read the article

  • How to Set a gridview column width when binding to a datatable

    - by Bob Avallone
    I am binding a table to a gridview in asp.net as such grdIssues.DataSource = mdtIssues; grdIssues.DataBind(); The problem is I cannot then control the column width, asp.net seems to decided on it's own what width each column should be. Methods such as grdIssues.Columns[0].ItemStyle.Width = 100; grdIssues.Columns[1].ItemStyle.Width = 100; don't work because the columns are created dynamically. I cannot believe there isn't a way to do this short of manually creating each column and filling each row. Regards, Bob Avallone

    Read the article

  • Problem in creating different types of columns in a Winforms gridview

    - by Royson
    My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for further processing. We can create a column of these types in a grid view but how can i store it in a data table so that i can pass it to next screen. Or should i create a column in a data table and then assign data table to grid view by gridview.DataSource = dt; but can we create a these types of columns in a data table.

    Read the article

  • Update DataBase on clicking in button, after editing gridview (not automatically saving in DB, but a

    - by gaponte69
    0 vote down star I am using GridView in asp .net and editing data with edit command field property (as we know after updating the edited row, we automatically update the database), and I want to use transactions (with begin to commit statement - including rollback) to commit this update query in database, after clicking in some button (after some events for example), not automatically to insert or update the edited data from grid directly to the DB...so I want to save them somewhere temporary (even many edited rows - not just one row) and then to confirm the transaction - to update the real tables in database... Any suggestions are welcomed... I've used some good links, but very helpful, like: http://www.asp.net/learn/data-access/tutorial-63-cs.aspx http://www.asp.net/learn/data-access/tutorial-66-cs.aspx etc... etc...

    Read the article

  • In ASP.NET, Can I Delete a row in GridView while the primary key of that table is not loaded into the gridview?

    - by Reddy S R
    Hi, I have a table with primary key whose importance is technically high and none business wise. So, when I display the table data to user, I would like not to show him the primary key. Even if I load it in sqldatasource and dont show (I did this by removing the cloumn in "Columns" tag of GridView), I am not able to update or delete row using the built-in UpdateCommand & DeleteCommand. I have created the delete paramters but it does nothing when I hit the delete button. How to get around it? Thanks R S Reddy

    Read the article

  • DataFormatString in my Gridview does not work in SharePoint

    - by Etienne
    I have a ASP.NET GridView that i created on a page through SharePoint Designer 2007. For some reason it just does not want to work, why is that and how can i Fix it? Funny thing, it worked on another SharePoint Server but not on the one i am working on now, so i know my code is fine, it must be something ells on the SharePoint Server maybe? My Currency DataFormatStrings also dont want to work on my current SharePoint Server. My DataFormatString for my Date field <asp:BoundField DataField="c505_remdate" HeaderText="Remit. Advice Date" SortExpression="c505_remdate" DataFormatString="{0:d/MM/yyyy}" /> Thanks in advanced!!

    Read the article

  • Passing more than one argument in asp.net button in gridview

    - by MarceloRamires
    I have a TemplateField column in a gridview with a button inside of it. There is NO key value (surely that was not designed by me) , but in the other hand there aren't redundancies when comparing each single column, because they are events, and there is "starting date" and "ending date" of something that could not happen twice at the same time. I've already figured selecting with these values and all, but I just want the button to pass about five arguments to a given function. I've tested: <asp:Button CommandArgument='<%# Eval("day")%>' ID="Button2" runat="server" Text="Button" /> And it works properly, the day of the clicked row is passed, and could be retrieved through: e.CommandArgument.ToString(); in the GridView_RowCommand handler. How do I pass more than one argument? I've thought about concatenating with a separating character (wouldn't be that bad) but besides not knowing how to do it yet (didn't want to invest in a poor solution) I want a smarter one.

    Read the article

  • ASP.NET GridView sorting on method data

    - by husainnz
    Hi, I'm binding a GridView to a domain model object, this domain model object has a method for working out a formatted value to display on the grid. I'd like to use this method for my display value, which is fine, but I'd also like to be able to sort on the value returned by that method. My sort expression can only take in a property/field at the moment. Help please! What do I need to do to get this to work? I'm using an SPGridView actually, but that doesn't make a lot of difference to my problem. Thanks.

    Read the article

  • System.IndexOutOfRange Exception Sending Gridview Values to DataTable

    - by SidC
    Hello, I am writing an ASP.NET 3.5 application and need to send gridview values to a datatable for use in a listbox control as part of a quote process. I have written the following VB code in my Page_Load: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim dtSelParts As DataTable = New DataTable("dtSelParts") Dim column As DataColumn = New DataColumn column.ColumnName = "PartName" column.ColumnName = "PartNumber" column.ColumnName = "Quantity" dtSelParts.Columns.Add(column) For Each row As GridViewRow In MySearch.Rows Dim drSelParts As DataRow drSelParts = dtSelParts.NewRow() For i As Integer = 0 To row.Cells.Count - 1 drSelParts(i) = row.Cells(i).Text Next Next End Sub When I run the partsearch.aspx page, I enter values in the row textbox for parts I want included in the listbox (to be included in quote). However, I receive the error message System.Index.OutOfRangeException: Cannot find column 1 which occurs on the line drSelParts(i) = row.Cells(i).Text. How might I correct the code and resolve the error? Thanks, Sid

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >