Search Results

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

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

  • An innovative architecture to develop business web forms (3) - Configure GridView

    This is third article in the series to introduce an innovative architecture to develop web forms in enterprise software which is high performance, productivity, configurability and maintainability than writing ASPX/MVC code directly. The article introduces how to configure gridview for search result...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

  • Filtering GridView Table Rows using a Drop-Down List in ASP.NET 3.5

    In the real world ASP.NET 3.5 websites rely heavily on the MS SQL server database to display information to the browser. For the purposes of usability it is important that users can filter some information shown to them particularly large tables. This article will show you how to set up a program that lets users filter data with a GridView web control and a drop-down list.... SW Deployment Automation Best Practices Free Guide for IT Leaders: Overcoming Software Distribution & Mgmt Challenges.

    Read the article

  • Custom Gridview Paging on ASP.NET

    - by OscarRibbeck
    Hello again :).There is an interesting entry about Custom Gridview Paging on ASP.NET 2.0 subject on here: http://forums.asp.net/t/1069129.aspx I tweaked the original code for my own convenience and posted it on this thread but I noticed yesterday that some people had some questions on it that I didn't notice. Hence I uploaded an small sample available on here:http://www.mediafire.com/?2a8c34zn4495mq8Try it out and if you have any questions please let me know.Cheers!

    Read the article

  • ASP.NET GridView "Client-Side Confirmation when Deleting" stopped working on ie - how come?

    - by tarnold
    A few months ago, I have programmed an ASP.NET GridView with a custom "Delete" LinkButton and Client-Side JavaScript Confirmation according to this msdn article: http://msdn.microsoft.com/en-us/library/bb428868.aspx (published in April 2007) or e.g. http://stackoverflow.com/questions/218733/javascript-before-aspbuttonfield-click The code looks like this: <ItemTemplate> <asp:LinkButton ID="deleteLinkButton" runat="server" Text="Delete" OnCommand="deleteLinkButtonButton_Command" CommandName='<%# Eval("id") %>' OnClientClick='<%# Eval("id", "return confirm(\"Delete Id {0}?\")") %>' /> </ItemTemplate> Surprisingly, "Cancel" doesn't work no more with my ie (Version: 6.0.2900.2180.xpsp_sp2_qfe.080814-1242) - it always deletes the row. With Opera (Version 9.62) it still works as expeced and described in the msdn article. More surprisingly, on a fellow worker's machine with the same ie version, it still works ("Cancel" will not delete the row). The generated code looks like <a onclick="return confirm(...);" href="javascript:__doPostBack('...')"> As confirm(...) returns false on "Cancel", I expect the __doPostBack event in the href not to be fired. Are there any strange ie settings I accidentally might have changed? What else could be the cause of this weird behaviour? Or is this a "please reinstall WinXP" issue?

    Read the article

  • How to insert selected rows value of Gridview into Database in .net

    - by MAS1
    I am Developing Windows Form Application in .Net, I want to insert selected rows value of Gridview into database. First Column of my GridView is Checkbox, when user check one or more checkbox from gridview, i want to insert values of respective rows into Database. In Web application i done this using DataKeyNames property of GridView.Want to know how to do it in Windows Form Application. I am using Visual Studio 2005

    Read the article

  • how to create Custom Server control for GridView using C#.net

    - by Dhanapal
    Hi, I want to created a Custom Server Control (Inherited from GridView). On the page, the GridView is DataBound to a DataSet, so I do not know at design time what columns will be present in my GridView. Now, what I want to do is, to add a textbox in every Cell for the GridView Header row, and those textboxes will control column filtering.

    Read the article

  • Using GridView and DetailsView in ASP.NET MVC - Part 1

    - by bipinjoshi
    For any beginner in ASP.NET MVC the first disappointment is possibly the lack of any server controls. ASP.NET MVC divides the entire processing logic into three distinct parts namely model, view and controller. In the process views (that represent UI under MVC architecture) need to sacrifice three important features of web forms viz. Postbacks, ViewState and rich event model. Though server controls are not a recommended choice under ASP.NET MVC there are situations where you may need to use server controls. In this two part article I am going to explain, as an example, how GridView and DetailsView can be used in ASP.NET MVC without breaking the MVC pattern.http://www.bipinjoshi.net/articles/59b91531-3fb2-4504-84a4-9f52e2d65c20.aspx 

    Read the article

  • Show line breaks in asp:label inside gridview

    - by Vipin
    To show line breaks in asp:label element or for that matter inside Gridview, do the following  in case of Mandatory/ Nullable fields. <ItemTemplate>          <%# ((string)Eval("Details")).Replace("\n", "<br/>") %>  </ItemTemplate>    <ItemTemplate>          <%# FormatString(Eval("Details"))  %>  </ItemTemplate>   In code behind, add the following FormatString function - protected string FormatString(string strHelpMessage) { string rtnString = string.Empty; if (!string.IsNullOrEmpty(strHelpMessage)) rtnString = strHelpMessage.Replace(Environment.NewLine, "<br/>"); return rtnString; }

    Read the article

  • Detecting right-click on XAML GridView control item

    - by mbrit
    Leaving aside why you would ever want to do this in a touch-centric world, here's how you tell if the right-mouse button has been clicked on a GridView in XAML/WinRT/Metro-style. You have to retrieve a point relative to the UI element you're in, and then query its properties. void itemGridView_PointerPressed(object sender, PointerRoutedEventArgs e) { if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed) { this.BottomAppBar.IsOpen = true; } } (The reason why you might want to do this can be explained by looking at any of the built-in Win8 apps. You can right-click any of the items on any list to bring up a context-sensitive AppBar.)

    Read the article

  • Grouping GridView on Windows 8

    - by nmarun
    It took me a few minutes to get the grouping working on the GridView on my Windows 8 app. I’m sharing what I did just so others can get it working sooner and go by the rest of their work. In VS 2012, I added a Grouped Items Page to my Windows 8 application project. By default, the template will add some sample data, so you can just run it to see how things look. Let’s see what it takes to show our custom data on the page. I’ll stat with the data source. 1: public class Team 2: { 3: public Team( string...(read more)

    Read the article

  • jQuery Filtering Gridview Columns

    - by RSchmitt
    I'm looking to have a click event for all columns but the last column of a GridView and then have a separate click event for the last column of the gridview (a DropDownList). I have the following right now but just can't seem to get it to exclude the last column: var _activeRow; $('.gridview-jquerify tr').filter(function() { return $('td', this).length && !$('table', this).length }) .bind('click', function(e) { if (_activeRow) _activeRow.removeClass('gridviewrow-highlighted'); _activeRow = $(this).addClass('gridviewrow-highlighted'); $(this).each(function() { var myID = $(this).find('.gridview-cell-hide').html(); __doPostBack('MyUpdatePanel', myID); }); }); Then I can't seem to get a variation of the above to work for the last column by doing a filter using :last in the selector such as: $('.gridview-jquerify tr >td:last').filter(function() { return $('td)', this).length && !$('table', this).length })

    Read the article

  • C#: Changing the order of columns when binding DataTable to a GridView

    - by Nir
    How is it possible to change the displayed order of columns from a DataTable? For example, dataTable "dt" contains two columns "a" and "b". I bind it to a GridView like this: gridView.DataSource = dt; gridView.DataBind(); But I'd like the GridView to display "b" first (leftmost). Important point: I'm using this to export to Excel and there's no actual output to screen, using: HtmlTextWriter htw = new HtmlTextWriter(sw); gridView.RenderControl(htw); Thanks!

    Read the article

  • Refresh a GridView after some event on server

    - 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. How can I solve this ?

    Read the article

  • How can I delete from a GridView when DataSource is a DataTable?

    - by David
    My DataSource is a DataTable populated from file system data in Page_Load. There is no database. How can I remove rows from the DataTable and rebind? I thought this had to be done in the GridView_RowCommand "Delete" section... if(e.CommandName == "Delete") ... When I try to access the DataRow's within //get the datatable DataTable dt = this.gridCPCP.DataSource as DataTable; // Delete the record foreach (DataRow dr in dt.Rows) { .... dt is null. How do I reference the DataTable when deleting records?

    Read the article

  • How to use a LinkButton inside gridview to delete selected username in the code-behind file?

    - by jenifer
    I have a "UserDetail" table in my "JobPost.mdf". I have a "Gridview1" showing the column from "UserDetail" table,which has a primary key "UserName". This "UserName" is originally saved using Membership class function. Now I add a "Delete" linkbutton to the GridView1. This "Delete" is not autogenerate button,I dragged inside the column itemtemplate from ToolBox. The GridView1's columns now become "Delete_LinkButton"+"UserName"(within the UserDetail table)+"City"(within the UserDetail table)+"IsAdmin"(within the UserDetail table) What I need is that by clicking this "delete_linkButton",it will ONLY delete the entire User Entity on the same row (link by the corresponding "UserName") from the "UserDetail" table,as well as delete all information from the AspNetDB.mdf (User,Membership,UserInRole,etc). I would like to fireup a user confirm,but not mandatory. At least I am trying to make it functional in the correct way. for example: Command UserName City IsAdmin delete ken Los Angles TRUE delete jim Toronto FALSE When I click "delete" on the first row, I need all the record about "ken" inside the "UserDetail" table to be removed. Meanwhile, all the record about "ken" in the AspNetDB.mdf will be gone, including UserinRole table. I am new to asp.net, so I don't know how to pass the commandargument of the "Delete_LinkButton" to the code-behind file LinkButton1_Click(object sender, EventArgs e), because I need one extra parameter "UserName". My partial code is listed below: <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID="Delete_LinkButton" runat="server" onclick="LinkButton1_Click1" CommandArgument='<%# Eval("UserName","{0}") %>'>LinkButton</asp:LinkButton> </ItemTemplate> </asp:TemplateField> protected void Delete_LinkButton_Click(object sender, EventArgs e) { ((LinkButton) GridView1.FindControl("Delete_LinkButton")).Attributes.Add("onclick", "'return confirm('Are you sure you want to delete {0} '" + UserName); Membership.DeleteUser(UserName); JobPostDataContext db = new JobPostDataContext(); var query = from u in db.UserDetails where u.UserName == UserName select u; for (var Item in query) { db.UserDetails.DeleteOnSubmit(Item); } db.SubmitChanges(); } Please do help! Thanks in advance.

    Read the article

  • How to uncheck header checkbox in GridView when sorting and paging?

    - by OutOFTouch
    Hi, I followed this article and it works great except when paging or sorting the HeaderCheckBox is still checked. How and where should this be unchecked? I think it would be best to uncheck it in the control itself, but I am not having any luck even getting a reference to it using this code: protected override void OnSorted(EventArgs e) { base.OnSorted(e); if (AutoGenerateCheckBoxColumn) { CheckBox cb = (CheckBox) HeaderRow.FindControl(String.Format(HeaderCheckBoxId, ClientID)); if(cb != null) { cb.Checked = false; } } } Thanks

    Read the article

  • GridView onTouch

    - by Jeff
    I am trying to set up a GridView of buttons that responds to onTouch. For example, if I swipe my finger across the screen horizontally, vertically or diagonally then I want the buttons which were touched to be selected. I tried setting OnTouchListener's for the buttons, but this didn't work, only the first button in the drag event received the onTouch events. Next I tried creating an OnTouchListener for the GridView and then using the X,Y coords to determine which buttons where touched. This doesn't seem to work either since the MOTION_DOWN events are only passed to the GridView's onTouch() if I start the drag on the very edge of the GridView. In fact if I drag my finger horizontally across the grid, the onTouch events aren't fired at all unless I start the drag at the edge of the GridView. Does anyone know of a better way to do this? Thanks in advance. gridview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(@SuppressWarnings("unused") View view, MotionEvent event) { float X = event.getX(); float Y = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: System.out.println("Down: " + X + "," + Y); break; case MotionEvent.ACTION_MOVE: System.out.println("Move: " + X + "," + Y); break; case MotionEvent.ACTION_UP: System.out.println("Up: " + X + "," + Y); break; } return true; } }

    Read the article

  • I want to prevent ASP.NET GridView from reacting to the enter button

    - by StephaneT
    I have an ASP.NET page with a gridview control on it with a CommandButton column with delete and select commands active. Pressing the enter key causes the first command button in the gridview to fire, which deletes a row. I don't want this to happen. Can I change the gridview control in a way that it does not react anymore to pressing the enter key? There is a textbox and button on the screen as well. They don't need to be responsive to hitting enter, but you must be able to fill in the textbox. Currently we popup a confirmation dialog to prevent accidental deletes, but we need something better than this. This is the markup for the gridview, as you can see it's inside an asp.net updatepanel (i forgot to mention that, sorry): (I left out most columns and the formatting) <asp:UpdatePanel ID="upContent" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnFilter" /> <asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" /> </Triggers> <ContentTemplate> <div id="CodeGrid" class="Grid"> <asp:GridView ID="dgCode" runat="server"> <Columns> <asp:CommandField SelectImageUrl="~/Images/Select.GIF" ShowSelectButton="True" ButtonType="Image" CancelText="" EditText="" InsertText="" NewText="" UpdateText="" DeleteImageUrl="~/Images/Delete.GIF" ShowDeleteButton="True" /> <asp:BoundField DataField="Id" HeaderText="ID" Visible="False" /> </Columns> </asp:GridView> </div> </ContentTemplate> </asp:UpdatePanel>

    Read the article

  • data source does not support server-side data paging uisng asp.net Csharp

    - by Aamir Hasan
    Yesterday some one mail me and ask about data source does not support server side data paging.So i write the the solution here please if you have got this problem read this article and see the example code this will help you a Lot.The only change you have to do is in the DataBind().Here you have used the SqlDataReader to read data retrieved from the database, but SqlDataReader is forward only. You can not traverse back and forth on it.So the solution for this is using DataAdapter and DataSet.So your function may change some what like this private void DataBind(){//for grid viewSqlCommand cmdO;string SQL = "select * from TABLE ";conn.Open();cmdO = new SqlCommand(SQL, conn);SqlDataAdapter da = new SqlDataAdapter(cmdO);DataSet ds = new DataSet();da.Fill(ds);GridView1.Visible = true;GridView1.DataSource = ds;GridView1.DataBind();ds.Dispose();da.Dispose();conn.Close();} This surely works. The reset of your code is fine. Enjoy coding.

    Read the article

  • control with ID 'GridView1' could not be found for the trigger in UpdatePanel 'UpdatePanel1'

    - by Kk
    I have two gridview in update panel and m adding entries from one gridview to another on selectedIndexChanged event what m trying to do is updating update panel on this event selectedindexchanged ...but my gridview is inside accordian control so it does not get initialized and hence i get this error ..... control with ID 'GridView1' could not be found for the trigger in UpdatePanel 'UpdatePanel1' Anybody knows solution?

    Read the article

  • Delete record in Linq to Sql

    - by Anders Svensson
    I have Linq2Sql classes User, Page, and UserPage (from a junction table), i.e. a many-to-many relationship. I'm using a gridview to show all Users, with a dropdownlist in each row to show the Pages visited by each user. Now I want to be able to delete records through the gridview, so I have added a delete button in the gridview by setting "Enable deleting" on it. Then I tried to use the RowDeleting event to specify how to delete the records since it doesn't work by default. And because its a relationship I know I need to delete the related records in the junction table before deleting the user record itself, so I added this in the RowDeleting event: protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e) { int id = (int)((DataKey)GridView2.DataKeys[e.RowIndex]).Value; UserPageDBDataContext context = new UserPageDBDataContext(); var userPages = from userPage in context.UserPages where userPage.User.UserID == id select userPage; foreach (var userPage in userPages) context.UserPages.DeleteOnSubmit(userPage); context.SubmitChanges(); var user = context.Users.Single(u => u.UserID == id); context.Users.DeleteOnSubmit(user); context.SubmitChanges(); } This actually seems to delete records, because the record with the id in question does indeed disappear, but strangely, a new record seems to be added at the end...! So, say I have 3 records in the gridview: 1 Jack stackoverflow.com 2 Betty stackoverflow.com/questions 3 Joe stackoverflow.com/whatever Now, if I try to delete user 1 (Jack), record number 1 will indeed disappear in the gridview, but the same record will appear at the end with a new id: 2 Jack stackoverflow.com 3 Betty stackoverflow.com/questions 4 Joe stackoverflow.com/whatever I have tried searching on how to delete records using Linq, and I believe I'm doing exacly as the examples I have read (e.g. the second example here: http://msdn.microsoft.com/en-us/library/Bb386925%28v=VS.100%29.aspx). I have read that you can also set cascade delete on the relationship in the database, but I wanted to do it this way in code, as your supposed to be able to. So what am I doing wrong?

    Read the article

  • WPF layout with several fixed height parts and certain parts relative to window size

    - by Daniil Harik
    Hello, At moment my main layout consists of vertically oriented stack panel and it looks like this: Root StackPanel StackPanel - fixed Height 150 (horizontal orientation) StackPanel - relative Height must be behalf of free space left on screen (but at least 150 px). Used by Telerik GridView Control, if I don't specify Height or MaxHeight Telerik GridView Height becomes very large and does not fit my window. StackPanel - fixed Height 100 (horizontal orientation) StackPanel - relative Height must be half of free space left on screen (but at least 150 px). Used by Telerik GridView Control, if I don't specify Height or MaxHeight Telerik GridView Height becomes very large and does not fit my window. StackPanel - fixed Height 100 (horizontal orientation) The view must totally fit available screen size. The problem is that I don't understand how to make certain areas of my view resize depending on available screen size. Is there is easy way to solve it, or should I be binding to Window height property and doing math? Thank You very much!

    Read the article

  • Populate table fields on query execution

    - by Jason
    I'm trying to build an ASP site that populates a Table based on the results of a selection in a ListBox. In order to do this, I've created a GridView table inside a div element. Currently the default behavior is to show all the items in the specified table in sortable order. However, I'd like to refine this further to allow for display of matches based on the results from the ListBox selection, but am not sure how to execute this. The ListBox fires off a OnSelectionChanged event to the method defined below and the GridView element is defined as <asp:GridView ID="dataListings" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" OnDataBinding="ListBox1_SelectedIndexChanged"> protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { int itemSelected = selectTopics.SelectedIndex; string[] listing = null; switch (itemSelected)//assign listing the array of course numbers { case 0: break; case 1: listing = arts; break; case 2: listing = currentEvents; break; .... More cases here default: listing = arts; break; } using (OLLIDBDataContext odb = new OLLIDBDataContext()) { var q = from c in odb.tbl_CoursesAndWorkshops where listing.Contains(c.tbl_Course_Description.tbl_CoursesAndWorkshops.course_workshop_number) select c; dataListings.DataSource = q; dataListings.DataBind(); } } However, this method never gets fired. I can see a request being made when changing the selection, but setting a breakpoint at the method declaration does nothing at all. Based on this, setup, I have three related questions What do I need to modify to get the OnSelectionChanged event handler to fire? How can I alter the GridView area to be empty on page load? How do I send the results from the dataListings.DataBind() execution to show in the GridView?

    Read the article

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