gridview

how to prevent autoselection of first item in GridView on databind?

只愿长相守 提交于 2019-12-24 09:07:24
问题 When I databind my GridView to an ObservableCollection, the first item of the collection is automatically selected. The SelectionMode property of the GridView is set to multiple . Is there some way to prevent this auto-selection? Or on what event should I listen so that I can reset the SelectedIndex of the GridView back to -1? 回答1: Set the IsSynchronizedWithCurrenItem property to false on the gridview in xaml 回答2: There is acutally a pretty simple solution. I set the SelectionMode of the

Column freeze in GridView

我只是一个虾纸丫 提交于 2019-12-24 09:05:36
问题 I have a asp .net web application where I use GridView. There is whole lot of data in it, making it to scroll horizontal as well as vertical. Now, I wanted to freeze the first column in it while horizontal scroll is happening. I got some help from the forums online and wrote this particular piece of css style: td.locked, th.locked { position: relative; top: expression(this.offsetParent.scrollTop); background-color: White; } and in the code behind I have this in my grid's RowDataBound event: e

Gridview not updating value

回眸只為那壹抹淺笑 提交于 2019-12-24 08:58:08
问题 I am trying to make my gridview update a SQL record but it is not updating the values. Here is the aspx code: <asp:GridView ID="GridView1" runat="server" GridLines="None" AutoGenerateColumns="false" onrowcancelingedit="GridView1_RowCancelling" OnRowDeleting ="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" DataKeyNames="RID" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"> <Columns> <asp:TemplateField Visible=

Get all Images in Gallery

流过昼夜 提交于 2019-12-24 08:51:52
问题 I am developing an application in which I want that When a user clicks on button "select image", it should be able to view all images of drawable folder in gallaryview or gridview. How can I do this? and after clicking on the image from grid or gallery view, I have to just fatch that image path and store into a variable. I also want that when I go back to the previous page I have all my data with the image path. 回答1: public class GetImageActivity extends Activity { private static final int

Loop Running VERY Slow

℡╲_俬逩灬. 提交于 2019-12-24 08:46:36
问题 please help me make my app a little faster, it's taking forever to loop through and give me results right now. here is what im donig: 1. load gridview from an uploaded excel file (this would probably be about 300 records or so) 2. compare manufacturer, model and serial No to my MS SQL database (about 20K records) to see if there is a match. 'find source ID based on make/model/serial No combination. Dim cSource As New clsSource() Dim ds As DataSet = cSource.GetSources() Dim found As Boolean =

generating new column in grid view for checkbox column

别等时光非礼了梦想. 提交于 2019-12-24 08:25:00
问题 i am using datatable as data source for grid view DataTable table = new DataTable(); table.Columns.Add("Dosage", typeof(int)); table.Columns.Add("Drug", typeof(string)); table.Columns.Add("Patient", typeof(string)); table.Columns.Add("Select",typeof(bool)); // // Here we add five DataRows. // table.Rows.Add(25, "Indocin", "David"); table.Rows.Add(50, "Enebrel", "Sam"); table.Rows.Add(10, "Hydralazine", "Christoff"); table.Rows.Add(21, "Combivent", "Janet"); table.Rows.Add(100, "Dilantin",

How can i arrange columns in asp.net gridview?

梦想与她 提交于 2019-12-24 08:23:01
问题 How can i arrange columns in asp.net gridview? i want to change 4 columns' location. ForExample: column1 | column2 | column3 | column4 | ChangeOrder() column2 | column1 | column3 | column4 | ChangeOrder() column4 | column2 | column3 | column1 | I want to move columns in Gridview. 回答1: 2 options from the top of my head: Turn AutoGenerateColumns off and add the columns yourself, mapping them to what you want in the dataset and in the order you want them. Change your SQL query to return the

ASP.NET GridView Column - formatting telephone number

断了今生、忘了曾经 提交于 2019-12-24 08:14:40
问题 I am adding a column to my gridview in code-behind as follows: field = new BoundField(); field.HeaderText = "Phone Number"; field.DataField = "PhoneNumber"; field.HtmlEncode = false; field.DataFormatString = "{0:###-###-####}"; gridView.Columns.Add(field); However, the DataFormatString is not working because the PhoneNumber field is a string, not a numeric. Is there anyway to take care of that in the DataFormatString, or do I need to convert the data type before I get to this point? 回答1: This

Data are missing after updating

放肆的年华 提交于 2019-12-24 08:00:04
问题 Okay I'll discuss my problem with images so we can solve it easily. Hoping. First, The image below shows the PersonalInfo gridview under PersonalInfo.aspx Second, The image below shows the MobileInfo gridview under MobileINfo.aspx Third, now we are going to edit the record in this page MobileInfo.aspx Fourth, Image below I thought everything works perfectly because the data has been updated. But... Fifth and last, I went back in PersonalInfo.aspx but it gives me this...Data has been deleted

GridView with custom ImageAdapter doesn't update after dataset changes

守給你的承諾、 提交于 2019-12-24 07:55:34
问题 I'm implementing a gallery of images with support for multiple item selection. The main layout is a GridView which uses a custom Adapter . Every displayed item is a combination ImageView + CheckBox . If several checkboxes are checked I want to uncheck them all simply by touching any image in the GridView . I'm calling notifyDataSetChanged() for implementing this functionality. Unfortunately this "uncheck all" feature doesn't work. I'm still a newbie so probably there is something basic that I